1
0
Fork 0
forked from nuttx/nuttx-update

drivers/usbdev: Add a debug assertion to CDC/ACM driver.

This commit is contained in:
Gregory Nutt 2017-10-18 07:10:34 -06:00
parent 85a1a3cc98
commit 8dd1bb03b2

View file

@ -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