1
0
mirror of https://github.com/UzixLS/picocom.git synced 2025-07-19 07:21:18 +03:00

Added support for setting custom baud rates.

If the requested baudrate is not a custom one (i.e. does not match one
of the Bxxx macros), then the cfsetospeed_custom() and
cfsetispeed_custom() are called to configure the "nexttermios" structure
with the requested non-standard baudrate. Same thing for reading the
baudrate: If cfgetospeed() and / or cfgetispeed() return a value that is
not among the Bxxx macros, cfgetospeed_custom() and cfgetispeed_custom()
are called, to read (and decode) the non-standard baudrate from the
"nexttermios" structure.

Currently the cf[set|get][i|o]speed_custom functions are only
implemented for Linux, and work only with non-ancient kernels (>2.6). So
in effect, custom baud-rate support is currently only supported for
Linux.
This commit is contained in:
Nick Patavalis
2015-08-20 12:40:28 +03:00
parent 30a06fd05f
commit fd306077d6
3 changed files with 48 additions and 16 deletions

View File

@ -33,6 +33,12 @@ CPPFLAGS += -DHISTFILE=\"$(HISTFILE)\" \
picocom : linenoise-1.0/linenoise.o
linenoise-1.0/linenoise.o : linenoise-1.0/linenoise.c linenoise-1.0/linenoise.h
## Comment these IN to enable custom baudrate support.
## Currently works *only* with Linux (kernels > 2.6).
CPPFLAGS += -DUSE_CUSTOM_BAUD
picocom : termios2.o
termios2.o : termios2.c termios2.h termbits2.h
## Comment this IN to remove help strings (saves ~ 4-6 Kb).
#CPPFLAGS += -DNO_HELP
@ -62,6 +68,7 @@ picocom.8.ps : picocom.8
clean:
rm -f picocom.o term.o fdio.o split.o linenoise-1.0/linenoise.o
rm -f termios2.o
rm -f *~
rm -f \#*\#