mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-30 19:47:50 +08:00
[GCS] Aded support for higher baud rates
This commit is contained in:
+25
-1
@@ -35,7 +35,31 @@
|
|||||||
#include <caml/alloc.h>
|
#include <caml/alloc.h>
|
||||||
#include <caml/memory.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 };
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|||||||
@@ -45,6 +45,9 @@ type speed =
|
|||||||
| B57600
|
| B57600
|
||||||
| B115200
|
| B115200
|
||||||
| B230400
|
| B230400
|
||||||
|
| B921600
|
||||||
|
| B1500000
|
||||||
|
| B3000000
|
||||||
|
|
||||||
let speed_of_baudrate = fun baudrate ->
|
let speed_of_baudrate = fun baudrate ->
|
||||||
match baudrate with
|
match baudrate with
|
||||||
@@ -67,6 +70,9 @@ let speed_of_baudrate = fun baudrate ->
|
|||||||
| "57600" -> B57600
|
| "57600" -> B57600
|
||||||
| "115200" -> B115200
|
| "115200" -> B115200
|
||||||
| "230400" -> B230400
|
| "230400" -> B230400
|
||||||
|
| "921600" -> B921600
|
||||||
|
| "1500000" -> B1500000
|
||||||
|
| "3000000" -> B3000000
|
||||||
| _ -> invalid_arg "Serial.speed_of_baudrate"
|
| _ -> invalid_arg "Serial.speed_of_baudrate"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,9 @@ type speed =
|
|||||||
| B57600
|
| B57600
|
||||||
| B115200
|
| B115200
|
||||||
| B230400
|
| B230400
|
||||||
|
| B921600
|
||||||
|
| B1500000
|
||||||
|
| B3000000
|
||||||
|
|
||||||
val speed_of_baudrate : string -> speed
|
val speed_of_baudrate : string -> speed
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user