diff options
author | robert-hh <robert@hammelrath.com> | 2024-03-13 09:17:50 +0100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2024-08-29 16:27:43 +1000 |
commit | a86619fb6ffb4c860f4c1cc25643f13c6db92467 (patch) | |
tree | dd68c33f08c6114544ed3b6f09e6cb83b5deed1d | |
parent | bae809070e0d62cda1b04e97652cf80d513fe86f (diff) |
stm32/machine_uart: Add the UART.IRQ_RX event for UART.irq().
Just adding the event symbol. No code change required, and no impact on
code execution time when the event is not selected.
Tested with STM32F4xx, STM32F7xx and STM32H7xx.
Signed-off-by: robert-hh <robert@hammelrath.com>
-rw-r--r-- | ports/stm32/machine_uart.c | 1 | ||||
-rw-r--r-- | ports/stm32/uart.h | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/ports/stm32/machine_uart.c b/ports/stm32/machine_uart.c index 0f139ae83..277ae67ef 100644 --- a/ports/stm32/machine_uart.c +++ b/ports/stm32/machine_uart.c @@ -41,6 +41,7 @@ { MP_ROM_QSTR(MP_QSTR_RTS), MP_ROM_INT(UART_HWCONTROL_RTS) }, \ { MP_ROM_QSTR(MP_QSTR_CTS), MP_ROM_INT(UART_HWCONTROL_CTS) }, \ { MP_ROM_QSTR(MP_QSTR_IRQ_RXIDLE), MP_ROM_INT(UART_FLAG_IDLE) }, \ + { MP_ROM_QSTR(MP_QSTR_IRQ_RX), MP_ROM_INT(UART_FLAG_RXNE) }, \ static void mp_machine_uart_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { machine_uart_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/ports/stm32/uart.h b/ports/stm32/uart.h index 956cbb044..de4b70cde 100644 --- a/ports/stm32/uart.h +++ b/ports/stm32/uart.h @@ -52,7 +52,7 @@ typedef enum { #define CHAR_WIDTH_9BIT (1) // OR-ed IRQ flags which are allowed to be used by the user -#define MP_UART_ALLOWED_FLAGS UART_FLAG_IDLE +#define MP_UART_ALLOWED_FLAGS (UART_FLAG_IDLE | UART_FLAG_RXNE) // OR-ed IRQ flags which should not be touched by the user #define MP_UART_RESERVED_FLAGS UART_FLAG_RXNE |