clean up device cdc

separate cdc tx & rx bufsize
This commit is contained in:
hathach
2018-06-23 13:19:36 +07:00
parent d438000b99
commit b9f8575e2d
5 changed files with 22 additions and 16 deletions

View File

@@ -37,6 +37,7 @@
/**************************************************************************/
#include "tusb_fifo.h"
#include "common/tusb_verify.h" // for ASSERT
/*------------------------------------------------------------------*/
/*
@@ -207,7 +208,9 @@ bool fifo_peek_at(fifo_t* f, uint16_t position, void * p_buffer)
bool fifo_write(fifo_t* f, void const * p_data)
{
if ( !fifo_initalized(f) ) return false;
if ( fifo_full(f) && !f->overwritable ) return false;
// if ( fifo_full(f) && !f->overwritable ) return false;
TU_ASSERT( !(fifo_full(f) && !f->overwritable) );
mutex_lock_if_needed(f);