Skip to content

Commit

Permalink
update example for better cdc echo
Browse files Browse the repository at this point in the history
  • Loading branch information
hathach committed Apr 20, 2022
1 parent 6a022c7 commit 8757287
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/device/cdc_msc_freertos/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ void usb_device_task(void* param)
tud_task();

// following code only run if tud_task() process at least 1 event
tud_cdc_write_flush();
}
}

Expand Down Expand Up @@ -183,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];

Expand All @@ -196,8 +197,9 @@ 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-Sx this delay is essential to allow idle how to run and reset watchdog
Expand Down

0 comments on commit 8757287

Please sign in to comment.