8000 stm32/machine_uart: Add the UART.IRQ_RX event for UART.irq(). · projectgus/micropython@a86619f · GitHub
[go: up one dir, main page]

Skip to content

Commit a86619f

Browse files
robert-hhdpgeorge
authored andcommitted
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>
1 parent bae8090 commit a86619f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

ports/stm32/machine_uart.c

Lines changed: 1 addition & 0 deletions
< 8000 tr class="diff-line-row">
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
{ MP_ROM_QSTR(MP_QSTR_RTS), MP_ROM_INT(UART_HWCONTROL_RTS) }, \
4242
{ MP_ROM_QSTR(MP_QSTR_CTS), MP_ROM_INT(UART_HWCONTROL_CTS) }, \
4343
{ MP_ROM_QSTR(MP_QSTR_IRQ_RXIDLE), MP_ROM_INT(UART_FLAG_IDLE) }, \
44+
{ MP_ROM_QSTR(MP_QSTR_IRQ_RX), MP_ROM_INT(UART_FLAG_RXNE) }, \
4445

4546
static void mp_machine_uart_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
4647
machine_uart_obj_t *self = MP_OBJ_TO_PTR(self_in);

ports/stm32/uart.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ typedef enum {
5252
#define CHAR_WIDTH_9BIT (1)
5353

5454
// OR-ed IRQ flags which are allowed to be used by the user
55-
#define MP_UART_ALLOWED_FLAGS UART_FLAG_IDLE
55+
#define MP_UART_ALLOWED_FLAGS (UART_FLAG_IDLE | UART_FLAG_RXNE)
5656

5757
// OR-ed IRQ flags which should not be touched by the user
5858
#define MP_UART_RESERVED_FLAGS UART_FLAG_RXNE

0 commit comments

Comments
 (0)
0