drivers/usbdev: push cdcacm rx buffer to serial rx buffer when resetconfig

When usb is re-enumerated due to the reset signal, we need to push
the rx_pending message into the serial port buffer.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
dongjiuzhu1 2024-02-07 15:43:42 +08:00 committed by Xiang Xiao
parent e5a925543b
commit a8d7103a2b

View file

@ -868,6 +868,16 @@ errout_with_flags:
static void cdcacm_resetconfig(FAR struct cdcacm_dev_s *priv)
{
/* When the USB is pulled out, if there is an unprocessed buffer,
* it needs to be push them to upper half serial drivers RX buffer.
*/
if (priv->nrdq != 0)
{
cdcacm_release_rxpending(priv);
priv->nrdq = 0;
}
/* Are we configured? */
if (priv->config != CDCACM_CONFIGIDNONE)