From d3345d751138b82cbdc2c584dbe523701aa5cd13 Mon Sep 17 00:00:00 2001 From: Andrew Leech Date: Sat, 11 May 2024 08:53:21 +1000 Subject: [PATCH] renesas-ra/mphalport: Use shared/tinyusb cdc functions. Signed-off-by: Andrew Leech --- ports/renesas-ra/mphalport.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/renesas-ra/mphalport.c b/ports/renesas-ra/mphalport.c index 7a5bcba2c9128..9e4c5368948e5 100644 --- a/ports/renesas-ra/mphalport.c +++ b/ports/renesas-ra/mphalport.c @@ -34,6 +34,7 @@ #include "py/ringbuf.h" #include "extmod/misc.h" #include "shared/runtime/interrupt_char.h" +#include "shared/tinyusb/mp_cdc_common.h" #include "tusb.h" #include "uart.h" @@ -49,7 +50,6 @@ void flash_cache_commit(void); static uint8_t stdin_ringbuf_array[MICROPY_HW_STDIN_BUFFER_LEN]; ringbuf_t stdin_ringbuf = { stdin_ringbuf_array, sizeof(stdin_ringbuf_array) }; - #endif // this table converts from HAL_StatusTypeDef to POSIX errno @@ -68,7 +68,7 @@ NORETURN void mp_hal_raise(HAL_StatusTypeDef status) { uint8_t cdc_itf_pending; // keep track of cdc interfaces which need attention to poll -void poll_cdc_interfaces(void) { +void tud_cdc_poll_interfaces(void) { // any CDC interfaces left to poll? if (cdc_itf_pending && ringbuf_free(&stdin_ringbuf)) { for (uint8_t itf = 0; itf < 8; ++itf) { @@ -106,7 +106,7 @@ void tud_cdc_rx_cb(uint8_t itf) { uintptr_t mp_hal_stdio_poll(uintptr_t poll_flags) { uintptr_t ret = 0; #if MICROPY_HW_USB_CDC - poll_cdc_interfaces(); + tud_cdc_poll_interfaces(); #endif #if MICROPY_HW_ENABLE_UART_REPL || MICROPY_HW_USB_CDC if ((poll_flags & MP_STREAM_POLL_RD) && ringbuf_peek(&stdin_ringbuf) != -1) { @@ -132,7 +132,7 @@ uintptr_t mp_hal_stdio_poll(uintptr_t poll_flags) { int mp_hal_stdin_rx_chr(void) { for (;;) { #if MICROPY_HW_USB_CDC - poll_cdc_interfaces(); + tud_cdc_poll_interfaces(); #endif #if MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE