Skip to content

Commit

Permalink
stm32/machine_uart.c: Add the UART.IRQ_RX event for UART.irq().
Browse files Browse the repository at this point in the history
Just adding the event symbol. No code change required, 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>
  • Loading branch information
robert-hh committed Jun 27, 2024
1 parent 440f91d commit 99fce16
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions ports/stm32/machine_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion ports/stm32/uart.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 99fce16

Please sign in to comment.