From f175ab50654afdafe225836b9e028dd14cc4644e Mon Sep 17 00:00:00 2001 From: Zhihong Chen Date: Fri, 28 Jun 2024 19:02:20 +0800 Subject: [PATCH] Revert "hpmicro: usbhost_cdcacm: fix usbhost_rxint()" This reverts commit 4ec9b68926f8186396cc19b85a1b9ba4741d1aa4. Signed-off-by: Zhihong Chen --- drivers/usbhost/usbhost_cdcacm.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/usbhost/usbhost_cdcacm.c b/drivers/usbhost/usbhost_cdcacm.c index c72f907e039f9..2abb630833de0 100644 --- a/drivers/usbhost/usbhost_cdcacm.c +++ b/drivers/usbhost/usbhost_cdcacm.c @@ -2593,11 +2593,17 @@ static void usbhost_rxint(FAR struct uart_dev_s *uartdev, bool enable) DEBUGASSERT(ret >= 0); UNUSED(ret); } + } + else if (!enable && priv->rxena) + { + /* Cancel any pending RX data reception work */ - /* Save the new RX enable state */ - - priv->rxena = enable; + work_cancel(LPWORK, &priv->rxwork); } + + /* Save the new RX enable state */ + + priv->rxena = enable; } /****************************************************************************