forked from nuttx/nuttx-update
drivers/usbdev: Add a debug assertion to CDC/ACM driver.
This commit is contained in:
parent
85a1a3cc98
commit
8dd1bb03b2
1 changed files with 2 additions and 1 deletions
|
@ -521,6 +521,7 @@ static int cdcacm_recvpacket(FAR struct cdcacm_dev_s *priv,
|
|||
*/
|
||||
|
||||
watermark = (CONFIG_SERIAL_IFLOWCONTROL_UPPER_WATERMARK * recv->size) / 100;
|
||||
DEBUGASSERT(watermark > 0 && watermark < (recv->size - 1));
|
||||
#endif
|
||||
|
||||
/* Then copy data into the RX buffer until either: (1) all of the data has
|
||||
|
@ -601,7 +602,7 @@ static int cdcacm_recvpacket(FAR struct cdcacm_dev_s *priv,
|
|||
|
||||
if (nexthead == recv->tail)
|
||||
{
|
||||
(void)cdcuart_rxflowcontrol(&priv->serdev, recv->size, true);
|
||||
(void)cdcuart_rxflowcontrol(&priv->serdev, recv->size - 1, true);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue