mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 03:45:50 +08:00
drivers/usbdev/cdcacm.c: fix check priv->nwrq issue
When enable CONFIG_CDCACM_DISABLE_TXBUF, dev->xmit.buffer always take one req, so just compare CONFIG_CDCACM_NWRREQS - 1. Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
This commit is contained in:
@@ -1485,7 +1485,12 @@ static void cdcacm_unbind(FAR struct usbdevclass_driver_s *driver,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
flags = enter_critical_section();
|
flags = enter_critical_section();
|
||||||
|
|
||||||
|
#ifdef CONFIG_CDCACM_DISABLE_TXBUF
|
||||||
|
DEBUGASSERT(priv->nwrq >= CONFIG_CDCACM_NWRREQS - 1);
|
||||||
|
#else
|
||||||
DEBUGASSERT(priv->nwrq == CONFIG_CDCACM_NWRREQS);
|
DEBUGASSERT(priv->nwrq == CONFIG_CDCACM_NWRREQS);
|
||||||
|
#endif
|
||||||
|
|
||||||
while (!sq_empty(&priv->txfree))
|
while (!sq_empty(&priv->txfree))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user