@@ -190,10 +190,16 @@ uint32_t tu_edpt_stream_write_available(tu_edpt_stream_t* s)
190
190
return (uint32_t ) tu_fifo_remaining (& s -> ff );
191
191
}
192
192
193
- void tu_edpt_stream_read_clear (uint8_t daddr , tu_edpt_stream_t * s )
193
+ bool tu_edpt_stream_read_clear (uint8_t daddr , tu_edpt_stream_t * s )
194
194
{
195
- tu_fifo_clear (& s -> ff );
195
+ bool ret = tu_fifo_clear (& s -> ff );
196
196
tu_edpt_stream_read_xfer (daddr , s );
197
+ return ret ;
198
+ }
199
+
200
+ bool tu_edpt_stream_write_clear (tu_edpt_stream_t * s )
201
+ {
202
+ return tu_fifo_clear (& s -> ff );
197
203
}
198
204
199
205
typedef struct {
@@ -331,6 +337,14 @@ uint32_t tuh_cdc_write_flush(uint8_t idx)
331
337
return tu_edpt_stream_write_xfer (p_cdc -> daddr , & p_cdc -> stream .tx );
332
338
}
333
339
340
+ bool tuh_cdc_write_clear (uint8_t idx )
341
+ {
342
+ cdch_interface_t * p_cdc = get_itf (idx );
343
+ TU_VERIFY (p_cdc );
344
+
345
+ return tu_edpt_stream_write_clear (& p_cdc -> stream .tx );
346
+ }
347
+
334
348
uint32_t tuh_cdc_write_available (uint8_t idx )
335
349
{
336
350
cdch_interface_t * p_cdc = get_itf (idx );
@@ -355,12 +369,12 @@ uint32_t tuh_cdc_read_available(uint8_t idx)
355
369
return tu_edpt_stream_read_available (& p_cdc -> stream .rx );
356
370
}
357
371
358
- void tuh_cdc_read_flush (uint8_t idx )
372
+ bool tuh_cdc_read_clear (uint8_t idx )
359
373
{
360
374
cdch_interface_t * p_cdc = get_itf (idx );
361
- TU_VERIFY (p_cdc , );
375
+ TU_VERIFY (p_cdc );
362
376
363
- tu_edpt_stream_read_clear (p_cdc -> daddr , & p_cdc -> stream .rx );
377
+ return tu_edpt_stream_read_clear (p_cdc -> daddr , & p_cdc -> stream .rx );
364
378
}
365
379
366
380
//--------------------------------------------------------------------+
0 commit comments