diff --git a/conf/Makefile.chibios b/conf/Makefile.chibios index cd01fed70eb..0956171b1b5 100644 --- a/conf/Makefile.chibios +++ b/conf/Makefile.chibios @@ -80,7 +80,6 @@ ifeq (,$(findstring $(RTOS_DEBUG),0 FALSE)) else CH_OPT ?= 2 -ggdb endif - USE_OPT = -std=gnu99 -O$(CH_OPT) \ -falign-functions=16 -fomit-frame-pointer \ -W -Wall \ diff --git a/sw/airborne/subsystems/datalink/superbitrf.c b/sw/airborne/subsystems/datalink/superbitrf.c index 83669677984..65f9c3acd40 100644 --- a/sw/airborne/subsystems/datalink/superbitrf.c +++ b/sw/airborne/subsystems/datalink/superbitrf.c @@ -563,11 +563,6 @@ void superbitrf_event(void) case 5: superbitrf.state = 7; break; - // Start receiving - cyrf6936_multi_write(&superbitrf.cyrf6936, cyrf_start_receive, 2); - superbitrf.timer = (get_sys_time_usec() + SUPERBITRF_DATARECVB_TIME) % 0xFFFFFFFF; - superbitrf.state++; - break; case 6: // Wait for telemetry data if (superbitrf.timer < get_sys_time_usec()) { diff --git a/sw/lib/ocaml/cserial.c b/sw/lib/ocaml/cserial.c index 5905077e8ab..2ece9261d90 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__ */ + /****************************************************************************/ @@ -68,7 +93,11 @@ value c_init_serial(value device, value speed, value hw_flow_control) CAMLparam3 (device, speed, hw_flow_control); struct termios orig_termios, cur_termios; - int br = baudrates[Int_val(speed)]; + int br_idx = Int_val(speed); + if (br_idx >= sizeof(baudrates)){ + failwith("Baud rate not supported - are you using MacOS? (br_idx out of bounds)"); + } + int br = baudrates[br_idx]; int fd = open(String_val(device), O_RDWR|O_NOCTTY|O_NONBLOCK);