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:
parent
e5a925543b
commit
a8d7103a2b
1 changed files with 10 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue