8000
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 76bab8a commit 84a5d9aCopy full SHA for 84a5d9a
ports/esp32/usb.c
@@ -40,8 +40,10 @@
40
41
static uint8_t usb_rx_buf[CONFIG_TINYUSB_CDC_RX_BUFSIZE];
42
43
+// This is called from FreeRTOS task "tusb_tsk" in espressif__esp_tinyusb (not ISR).
44
static void usb_callback_rx(int itf, cdcacm_event_t *event) {
- // 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.
47
for (;;) {
48
size_t len = 0;
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
}
62
63
+ mp_hal_wake_main_task();
64
65
66
0 commit comments