File tree 1 file changed +4
-2
lines changed
examples/device/cdc_msc_freertos/src 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ void usb_device_task(void* param)
134
134
tud_task ();
135
135
136
136
// following code only run if tud_task() process at least 1 event
137
+ tud_cdc_write_flush ();
137
138
}
138
139
}
139
140
@@ -183,7 +184,7 @@ void cdc_task(void* params)
183
184
// if ( tud_cdc_connected() )
184
185
{
185
186
// There are data available
186
- if ( tud_cdc_available () )
187
+ while ( tud_cdc_available () )
187
188
{
188
189
uint8_t buf [64 ];
189
190
@@ -196,8 +197,9 @@ void cdc_task(void* params)
196
197
// for throughput test e.g
197
198
// $ dd if=/dev/zero of=/dev/ttyACM0 count=10000
198
199
tud_cdc_write (buf , count );
199
- tud_cdc_write_flush ();
200
200
}
201
+
202
+ tud_cdc_write_flush ();
201
203
}
202
204
203
205
// For ESP32-Sx this delay is essential to allow idle how to run and reset watchdog
You can’t perform that action at this time.
0 commit comments