correct return for write flush

This commit is contained in:
hathach 2020-04-17 15:57:24 +07:00
parent 4571ce0d29
commit 464b1e8e89
No known key found for this signature in database
GPG Key ID: 2FA891220FBFD581
1 changed files with 2 additions and 2 deletions

View File

@ -167,8 +167,8 @@ uint32_t tud_cdc_n_write_flush (uint8_t itf)
uint16_t count = tu_fifo_read_n(&_cdcd_itf[itf].tx_ff, p_cdc->epin_buf, TU_ARRAY_SIZE(p_cdc->epin_buf));
if ( count )
{
TU_VERIFY( tud_cdc_n_connected(itf) ); // fifo is empty if not connected
TU_ASSERT( usbd_edpt_xfer(TUD_OPT_RHPORT, p_cdc->ep_in, p_cdc->epin_buf, count) );
TU_VERIFY( tud_cdc_n_connected(itf), 0 ); // fifo is empty if not connected
TU_ASSERT( usbd_edpt_xfer(TUD_OPT_RHPORT, p_cdc->ep_in, p_cdc->epin_buf, count), 0 );
}
return count;