fix cdc driver for connected state.

This commit is contained in:
hathach
2018-04-09 18:48:38 +07:00
parent fb27ae96b0
commit a74b2d34e5
3 changed files with 25 additions and 37 deletions

View File

@@ -131,8 +131,8 @@ bool fifo_read(fifo_t* f, void * p_buffer)
/******************************************************************************/
uint16_t fifo_read_n (fifo_t* f, void * p_buffer, uint16_t count)
{
if( !fifo_initalized(f) ) return false;
if( fifo_empty(f) ) return false;
if( !fifo_initalized(f) ) return 0;
if( fifo_empty(f) ) return 0;
/* Limit up to fifo's count */
count = min16_of(count, f->count);