From fc3d0d867685dfa3f4691c0b8c223062320c10c7 Mon Sep 17 00:00:00 2001 From: Mihai Renea Date: Sat, 10 Feb 2024 15:46:00 +0100 Subject: [PATCH] cpu/native: fix native_async_read_remove_handler() + enable all baudrates --- cpu/native/async_read.c | 2 +- cpu/native/periph/uart.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/cpu/native/async_read.c b/cpu/native/async_read.c index 806e1c4cf419..5aed77739e76 100644 --- a/cpu/native/async_read.c +++ b/cpu/native/async_read.c @@ -103,7 +103,7 @@ void native_async_read_remove_handler(int fd) if (res < 0) { err(EXIT_FAILURE, "native_async_read_remove_handler(): fcntl(F_GETFL)"); } - unsigned flags = (unsigned)res & !O_ASYNC; + unsigned flags = (unsigned)res & ~O_ASYNC; res = real_fcntl(fd, F_SETFL, flags); if (res < 0) { err(EXIT_FAILURE, "native_async_read_remove_handler(): fcntl(F_SETFL)"); diff --git a/cpu/native/periph/uart.c b/cpu/native/periph/uart.c index d7809e31e4ea..c3bd7ea0bcf1 100644 --- a/cpu/native/periph/uart.c +++ b/cpu/native/periph/uart.c @@ -135,7 +135,6 @@ int uart_init(uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg) case 57600: speed = B57600; break; case 115200: speed = B115200; break; case 230400: speed = B230400; break; -#if __linux__ case 460800 : speed = B460800; break; case 500000 : speed = B500000; break; case 576000 : speed = B576000; break; @@ -148,7 +147,6 @@ int uart_init(uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg) case 3000000: speed = B3000000; break; case 3500000: speed = B3500000; break; case 4000000: speed = B4000000; break; -#endif default: return UART_NOBAUD;