Merge branch 'master' into ch32v307

This commit is contained in:
Ha Thach
2022-05-21 13:54:25 +07:00
committed by GitHub
59 changed files with 993 additions and 408 deletions

View File

@@ -130,8 +130,11 @@ void usb_device_task(void* param)
// RTOS forever loop
while (1)
{
// tinyusb device task
// put this thread to waiting state until there is new events
tud_task();
// following code only run if tud_task() process at least 1 event
tud_cdc_write_flush();
}
}
@@ -181,7 +184,7 @@ void cdc_task(void* params)
// if ( tud_cdc_connected() )
{
// There are data available
if ( tud_cdc_available() )
while ( tud_cdc_available() )
{
uint8_t buf[64];
@@ -194,12 +197,13 @@ void cdc_task(void* params)
// for throughput test e.g
// $ dd if=/dev/zero of=/dev/ttyACM0 count=10000
tud_cdc_write(buf, count);
tud_cdc_write_flush();
}
tud_cdc_write_flush();
}
// For ESP32-S2 this delay is essential to allow idle how to run and reset wdt
vTaskDelay(pdMS_TO_TICKS(10));
// For ESP32-Sx this delay is essential to allow idle how to run and reset watchdog
vTaskDelay(1);
}
}