Skip to content

Commit

Permalink
Merge pull request #20368 from derMihai/mir/fix_async
Browse files Browse the repository at this point in the history
cpu/native: fix native_async_read_remove_handler() + enable all baudrates
  • Loading branch information
benpicco authored Feb 10, 2024
2 parents 9501f64 + fc3d0d8 commit 0723d2f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion cpu/native/async_read.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)");
Expand Down
2 changes: 0 additions & 2 deletions cpu/native/periph/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 0723d2f

Please sign in to comment.