diff --git a/drivers/usbdev/cdcacm.c b/drivers/usbdev/cdcacm.c index a76ae8f1b0aa759c662c21034d7f194319c38539..82fc2b646146bf16249a299335d72cf80a7dd519 100644 --- a/drivers/usbdev/cdcacm.c +++ b/drivers/usbdev/cdcacm.c @@ -703,6 +703,10 @@ static int cdcacm_serialstate(FAR struct cdcacm_dev_s *priv) } errout_with_flags: + /* Reset all of the "irregular" notification */ + + priv->serialstate &= CDC_UART_CONSISTENT; + leave_critical_section(flags); return ret; } @@ -2117,7 +2121,7 @@ static int cdcuart_ioctl(FAR struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_CDCACM_IFLOWCONTROL /* Report state of input flow control */ - termiosp->c_lflag = (priv->iflow) ? CRTS_IFLOW : 0; + termiosp->c_cflag |= (priv->iflow) ? CRTS_IFLOW : 0; #endif } break; diff --git a/include/nuttx/usb/cdc.h b/include/nuttx/usb/cdc.h index 65d15d8dce4edbb28416e91b7442d5d3c6d1b9f6..b4a88add86a80988c6e1a4dedc9d6227c6543e67 100644 --- a/include/nuttx/usb/cdc.h +++ b/include/nuttx/usb/cdc.h @@ -419,6 +419,8 @@ * 105 and RS-232 signal RTS. */ +/* CDC/ACM friendly naming */ + #define CDCACM_UART_DTR CDC_DTE_PRESENT #define CDCACM_UART_RTS CDC_ACTIVATE_CARRIER @@ -547,9 +549,21 @@ * overrun in the device. */ +/* CDC/ACM friendly naming */ + #define CDCACM_UART_DCD CDC_UART_RXCARRIER #define CDCACM_UART_DSR CDC_UART_TXCARRIER +/* "SerialState is used like a real interrupt status register. Once a notification has been + * sent, the device will reset and reevaluate the different signals. For the consistent + * signals like carrier detect or transmission carrier, this will mean another notification + * will not be generated until there is a state change. For the irregular signals like + * break, the incoming ring signal, or the overrun error state, this will reset their values + * to zero and again will not send another notification until their state changes." + */ + +#define CDC_UART_CONSISTENT (CDC_UART_RXCARRIER | CDC_UART_TXCARRIER) + /* Table 70: Call State Change Value Definitions */ #define CDC_CALLST_IDLE 0x01 /* Call has become idle */