summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/renesas-ra/machine_uart.c1
-rw-r--r--ports/renesas-ra/uart.c18
2 files changed, 12 insertions, 7 deletions
diff --git a/ports/renesas-ra/machine_uart.c b/ports/renesas-ra/machine_uart.c
index 26ed62540..4a659d107 100644
--- a/ports/renesas-ra/machine_uart.c
+++ b/ports/renesas-ra/machine_uart.c
@@ -41,6 +41,7 @@
#define MICROPY_PY_MACHINE_UART_CLASS_CONSTANTS \
{ 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_RX), MP_ROM_INT(0x10) }, \
static const char *_parity_name[] = {"None", "ODD", "EVEN"};
diff --git a/ports/renesas-ra/uart.c b/ports/renesas-ra/uart.c
index 30707552b..83b3394f7 100644
--- a/ports/renesas-ra/uart.c
+++ b/ports/renesas-ra/uart.c
@@ -71,14 +71,18 @@ static void uart_rx_cb(uint32_t ch, int d) {
// even disable the IRQ. This should never happen.
return;
}
- #if MICROPY_KBD_EXCEPTION
- if (keyex_cb[ch]) {
- (*keyex_cb[ch])(d);
- }
- #endif
+ #if defined(MICROPY_HW_UART_REPL)
+ if (ch == MICROPY_HW_UART_REPL) {
+ #if MICROPY_KBD_EXCEPTION
+ if (keyex_cb[ch]) {
+ (*keyex_cb[ch])(d);
+ }
+ #endif
- #if MICROPY_HW_ENABLE_UART_REPL
- ringbuf_put(&stdin_ringbuf, d);
+ #if MICROPY_HW_ENABLE_UART_REPL
+ ringbuf_put(&stdin_ringbuf, d);
+ #endif
+ }
#endif
// Check the flags to see if the user handler should be called