Skip to content

Commit 3fecab5

Browse files
andrewleechdpgeorge
authored andcommitted
esp32/mphalport: Always poll stdin ring-buffer to include UART use.
This fixes a regression introduced in commit 4247921, where this ring-buffer polling was accidentally put inside the `#if MICROPY_HW_ESP_USB_SERIAL_JTAG`. Signed-off-by: Andrew Leech <[email protected]>
1 parent 838f212 commit 3fecab5

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Diff for: ports/esp32/mphalport.c

+7-6
Original file line numberDiff line numberDiff line change
@@ -109,19 +109,20 @@ uintptr_t mp_hal_stdio_poll(uintptr_t poll_flags) {
109109
uintptr_t ret = 0;
110110
#if MICROPY_HW_ESP_USB_SERIAL_JTAG
111111
usb_serial_jtag_poll_rx();
112-
if ((poll_flags & MP_STREAM_POLL_RD) && ringbuf_peek(&stdin_ringbuf) != -1) {
113-
ret |= MP_STREAM_POLL_RD;
114-
}
115-
if (poll_flags & MP_STREAM_POLL_WR) {
116-
ret |= MP_STREAM_POLL_WR;
117-
}
118112
#endif
119113
#if MICROPY_HW_USB_CDC
120114
ret |= mp_usbd_cdc_poll_interfaces(poll_flags);
121115
#endif
122116
#if MICROPY_PY_OS_DUPTERM
123117
ret |= mp_os_dupterm_poll(poll_flags);
124118
#endif
119+
// Check ringbuffer directly for uart and usj.
120+
if ((poll_flags & MP_STREAM_POLL_RD) && ringbuf_peek(&stdin_ringbuf) != -1) {
121+
ret |= MP_STREAM_POLL_RD;
122+
}
123+
if (poll_flags & MP_STREAM_POLL_WR) {
124+
ret |= MP_STREAM_POLL_WR;
125+
}
125126
return ret;
126127
}
127128

0 commit comments

Comments
 (0)