File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 40
40
41
41
static uint8_t usb_rx_buf [CONFIG_TINYUSB_CDC_RX_BUFSIZE ];
42
42
43
+ // This is called from FreeRTOS task "tusb_tsk" in espressif__esp_tinyusb (not ISR).
43
44
static void usb_callback_rx (int itf , cdcacm_event_t * event ) {
44
- // TODO: what happens if more chars come in during this function, are they lost?
45
+ // espressif__esp_tinyusb places tinyusb rx data onto freertos ringbuffer which
46
+ // this function forwards onto the micropython stdin_ringbuf.
45
47
for (;;) {
46
48
size_t len = 0 ;
47
49
esp_err_t ret = tinyusb_cdcacm_read (itf , usb_rx_buf , sizeof (usb_rx_buf ), & len );
@@ -58,6 +60,7 @@ static void usb_callback_rx(int itf, cdcacm_event_t *event) {
58
60
ringbuf_put (& stdin_ringbuf , usb_rx_buf [i ]);
59
61
}
60
62
}
63
+ mp_hal_wake_main_task ();
61
64
}
62
65
}
63
66
You can’t perform that action at this time.
0 commit comments