diff options
author | Alessandro Gatti <a.gatti@frob.it> | 2025-07-25 11:49:23 +0200 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2025-09-09 10:29:38 +1000 |
commit | 1f7952e749d02f74492605ed9a50bd73dd4b4ead (patch) | |
tree | 30de2703e445ee4fbadf81317a583f3da28d09e5 | |
parent | 5f3e6b5b5381fd180280b0c852826db079808cce (diff) |
rp2/mphalport: Fix building with USB CDC disabled.
This commit fixes the linking issues in the RP2 port that arise when
explicitly disabling USB CDC support.
The console input ringbuffer needs to be made available if dupterm
support is enabled, and the console character input function would
always attempt to read from the input ringbuffer even if CDC support is
disabled and the console isn't bound to any UART.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
-rw-r--r-- | ports/rp2/mphalport.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ports/rp2/mphalport.c b/ports/rp2/mphalport.c index b581b3b59..4dd510dea 100644 --- a/ports/rp2/mphalport.c +++ b/ports/rp2/mphalport.c @@ -50,7 +50,7 @@ static uint64_t time_us_64_offset_from_epoch; #endif -#if MICROPY_HW_ENABLE_UART_REPL || MICROPY_HW_USB_CDC +#if MICROPY_HW_ENABLE_UART_REPL || MICROPY_HW_USB_CDC || MICROPY_PY_OS_DUPTERM_NOTIFY #ifndef MICROPY_HW_STDIN_BUFFER_LEN #define MICROPY_HW_STDIN_BUFFER_LEN 512 @@ -83,11 +83,12 @@ int mp_hal_stdin_rx_chr(void) { #if MICROPY_HW_USB_CDC mp_usbd_cdc_poll_interfaces(0); #endif - + #if MICROPY_HW_USB_CDC || MICROPY_HW_ENABLE_UART_REPL || MICROPY_PY_OS_DUPTERM_NOTIFY int c = ringbuf_get(&stdin_ringbuf); if (c != -1) { return c; } + #endif #if MICROPY_PY_OS_DUPTERM int dupterm_c = mp_os_dupterm_rx_chr(); if (dupterm_c >= 0) { |