Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #228: Non-posix baud rates #230

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions src/common/fs_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ long select_unix_serial_speed(long n) {
return B19200;
case 38400:
return B38400;
// extra baud rates (but not posix)
#ifdef B4000000
// extra baud rates are not POSIX standard
// but supported by Linux and FreeBSD
case 57600:
return B57600;
case 115200:
Expand All @@ -53,14 +55,10 @@ long select_unix_serial_speed(long n) {
return B460800;
case 500000:
return B500000;
case 576000:
return B576000;
case 921600:
return B921600;
case 1000000:
return B1000000;
case 1152000:
return B1152000;
case 1500000:
return B1500000;
case 2000000:
Expand All @@ -73,6 +71,15 @@ long select_unix_serial_speed(long n) {
return B3500000;
case 4000000:
return B4000000;
#endif
#ifdef B576000
// Following baud rates are supported in Linux but
// not defined in FreeBSD
case 576000:
return B576000;
case 1152000:
return B1152000;
#endif
}
return B9600;
}
Expand Down