34
34
#include "py/ringbuf.h"
35
35
#include "extmod/misc.h"
36
36
#include "shared/runtime/interrupt_char.h"
37
+ #include "shared/tinyusb/mp_cdc_common.h"
37
38
#include "tusb.h"
38
39
#include "uart.h"
39
40
@@ -49,7 +50,6 @@ void flash_cache_commit(void);
49
50
50
51
static uint8_t stdin_ringbuf_array [MICROPY_HW_STDIN_BUFFER_LEN ];
51
52
ringbuf_t stdin_ringbuf = { stdin_ringbuf_array , sizeof (stdin_ringbuf_array ) };
52
-
53
53
#endif
54
54
55
55
// this table converts from HAL_StatusTypeDef to POSIX errno
@@ -68,7 +68,7 @@ NORETURN void mp_hal_raise(HAL_StatusTypeDef status) {
68
68
69
69
uint8_t cdc_itf_pending ; // keep track of cdc interfaces which need attention to poll
70
70
71
- void poll_cdc_interfaces (void ) {
71
+ void tud_cdc_poll_interfaces (void ) {
72
72
// any CDC interfaces left to poll?
73
73
if (cdc_itf_pending && ringbuf_free (& stdin_ringbuf )) {
74
74
for (uint8_t itf = 0 ; itf < 8 ; ++ itf ) {
@@ -106,7 +106,7 @@ void tud_cdc_rx_cb(uint8_t itf) {
106
106
uintptr_t mp_hal_stdio_poll (uintptr_t poll_flags ) {
107
107
uintptr_t ret = 0 ;
108
108
#if MICROPY_HW_USB_CDC
109
- poll_cdc_interfaces ();
109
+ tud_cdc_poll_interfaces ();
110
110
#endif
111
111
#if MICROPY_HW_ENABLE_UART_REPL || MICROPY_HW_USB_CDC
112
112
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) {
132
132
int mp_hal_stdin_rx_chr (void ) {
133
133
for (;;) {
134
134
#if MICROPY_HW_USB_CDC
135
- poll_cdc_interfaces ();
135
+ tud_cdc_poll_interfaces ();
136
136
#endif
137
137
138
138
#if MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE
0 commit comments