We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f543c84 commit 08cbb03Copy full SHA for 08cbb03
ports/nrf/common-hal/busio/UART.c
@@ -250,7 +250,11 @@ uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) {
250
}
251
252
void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) {
253
-
+ // Discard received byte, and queue 1-byte transfer for rx_characters_available()
254
+ if ( self->rx_count > 0 ) {
255
+ self->rx_count = -1;
256
+ _VERIFY_ERR(nrfx_uarte_rx(&self->uarte, self->buffer, 1));
257
+ }
258
259
260
bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self) {
0 commit comments