From a5f7a3022d4273257f6fa26f9743a4a6f30791e7 Mon Sep 17 00:00:00 2001 From: Damien George Date: Sat, 29 Dec 2018 22:43:35 +1100 Subject: [PATCH] stm32/uart: Fix uart_rx_any in case of no buffer to return 0 or 1. --- ports/stm32/uart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/stm32/uart.c b/ports/stm32/uart.c index 74e601f3b8..4031d8acd4 100644 --- a/ports/stm32/uart.c +++ b/ports/stm32/uart.c @@ -517,7 +517,7 @@ mp_uint_t uart_rx_any(pyb_uart_obj_t *self) { } else if (buffer_bytes > 0) { return buffer_bytes; } else { - return UART_RXNE_IS_SET(self->uartx); + return UART_RXNE_IS_SET(self->uartx) != 0; } }