diff --git a/sw/lib/ocaml/cserial.c b/sw/lib/ocaml/cserial.c index 5905077e8a..e782cde56d 100644 --- a/sw/lib/ocaml/cserial.c +++ b/sw/lib/ocaml/cserial.c @@ -35,6 +35,29 @@ #include #include +/* MacOS doesn't support higher baudrates (>230400B) */ +#ifdef __APPLE__ +static int baudrates[] = { + B0, + B50, + B75, + B110, + B134, + B150, + B200, + B300, + B600, + B1200, + B1800, + B2400, + B4800, + B9600, + B19200, + B38400, + B57600, + B115200, + B230400 }; +#else /* regular Linux with higher baudrates */ static int baudrates[] = { B0, B50, @@ -58,6 +81,8 @@ static int baudrates[] = { B921600, B1500000, B3000000 }; +#endif /* ifdef __APPLE__ */ + /****************************************************************************/