[GCS] Aded support for higher baud rates

This commit is contained in:
podhrmic
2016-07-28 10:30:03 -07:00
committed by Felix Ruess
parent cbf54f111c
commit 724d3f2c2b
3 changed files with 34 additions and 1 deletions
+25 -1
View File
@@ -35,7 +35,31 @@
#include <caml/alloc.h>
#include <caml/memory.h>
static int baudrates[] = { B0, B50, B75, B110, B134, B150, B200, B300, B600, B1200, B1800, B2400, B4800, B9600, B19200, B38400, B57600, B115200, B230400 };
#include <stropts.h>
static int baudrates[] = {
B0,
B50,
B75,
B110,
B134,
B150,
B200,
B300,
B600,
B1200,
B1800,
B2400,
B4800,
B9600,
B19200,
B38400,
B57600,
B115200,
B230400,
B921600,
B1500000,
B3000000 };
/****************************************************************************/
+6
View File
@@ -45,6 +45,9 @@ type speed =
| B57600
| B115200
| B230400
| B921600
| B1500000
| B3000000
let speed_of_baudrate = fun baudrate ->
match baudrate with
@@ -67,6 +70,9 @@ let speed_of_baudrate = fun baudrate ->
| "57600" -> B57600
| "115200" -> B115200
| "230400" -> B230400
| "921600" -> B921600
| "1500000" -> B1500000
| "3000000" -> B3000000
| _ -> invalid_arg "Serial.speed_of_baudrate"
+3
View File
@@ -44,6 +44,9 @@ type speed =
| B57600
| B115200
| B230400
| B921600
| B1500000
| B3000000
val speed_of_baudrate : string -> speed