diff --git a/components/st3m/st3m_console.c b/components/st3m/st3m_console.c index 12f1b892452dfd016aeb593b813704fd32aae188..53bf2e86b36a0000160d0f3c219cf05d0f9a908d 100644 --- a/components/st3m/st3m_console.c +++ b/components/st3m/st3m_console.c @@ -145,16 +145,6 @@ void st3m_gfx_splash(const char *c); // Called by st3m_usb_cdc when it has the opportunity to send some data to the // host. size_t st3m_console_cdc_on_txpoll(uint8_t *buffer, size_t bufsize) { - // I have no idea why this is needed, but it is. Otherwise a large backlog - // of data cuases the IN endpoint to get stuck. - // - // I've spend three days debugging this. - // - // No, I'm not fine. Thanks for asking, though. I appreciate it. - if (bufsize > 0) { - bufsize -= 1; - } - int64_t now = esp_timer_get_time(); xSemaphoreTake(_state.mu, portMAX_DELAY); @@ -400,4 +390,4 @@ static esp_vfs_t _vfs = { .open = &_console_open, .read = &_console_read, .write = &_console_write, -}; \ No newline at end of file +}; diff --git a/components/st3m/st3m_usb_cdc.c b/components/st3m/st3m_usb_cdc.c index a3b12b8222de19110f6ef3e6a7cfca84e3a44258..8bb7999560ca912eafaed97addedfc491bcae096 100644 --- a/components/st3m/st3m_usb_cdc.c +++ b/components/st3m/st3m_usb_cdc.c @@ -46,6 +46,7 @@ void st3m_usb_cdc_txpoll(void) { for (;;) { uint32_t space = tud_cdc_n_write_available(st3m_usb_interface_app_cdc); if (space == 0) { + tud_cdc_n_write_flush(st3m_usb_interface_app_cdc); return; }