summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsakumisu <[email protected]>2026-01-26 21:16:12 +0800
committersakumisu <[email protected]>2026-01-28 13:15:53 +0800
commitbad94dfc670f5215c1a9abb80af5970fe592af39 (patch)
tree17d0f742e2d7a33fbda3292955c4e23882e9f1fc
parent2783329509c70b625dae5c24222e690b8310f687 (diff)
update(class/cdc): change serial state macro
Signed-off-by: sakumisu <[email protected]>
-rw-r--r--class/cdc/usb_cdc.h12
-rw-r--r--class/serial/usbh_cdc_acm.c10
2 files changed, 11 insertions, 11 deletions
diff --git a/class/cdc/usb_cdc.h b/class/cdc/usb_cdc.h
index 65ab025f..6a8e807d 100644
--- a/class/cdc/usb_cdc.h
+++ b/class/cdc/usb_cdc.h
@@ -217,12 +217,12 @@
#define CDC_SERIAL_STATE_BREAK (1 << 2) /* state of break detection */
#define CDC_SERIAL_STATE_BREAK_Pos (2)
#define CDC_SERIAL_STATE_BREAK_Msk (1 << CDC_SERIAL_STATE_BREAK_Pos)
-#define CDC_SERIAL_STATE_TX_CARRIER (1 << 1) /* state of transmission carrier */
-#define CDC_SERIAL_STATE_TX_CARRIER_Pos (1)
-#define CDC_SERIAL_STATE_TX_CARRIER_Msk (1 << CDC_SERIAL_STATE_TX_CARRIER_Pos)
-#define CDC_SERIAL_STATE_RX_CARRIER (1 << 0) /* state of receiver carrier */
-#define CDC_SERIAL_STATE_RX_CARRIER_Pos (0)
-#define CDC_SERIAL_STATE_RX_CARRIER_Msk (1 << CDC_SERIAL_STATE_RX_CARRIER_Pos)
+#define CDC_SERIAL_STATE_DSR (1 << 1) /* state of transmission carrier */
+#define CDC_SERIAL_STATE_DSR_Pos (1)
+#define CDC_SERIAL_STATE_DSR_Msk (1 << CDC_SERIAL_STATE_DSR_Pos)
+#define CDC_SERIAL_STATE_DCD (1 << 0) /* state of receiver carrier */
+#define CDC_SERIAL_STATE_DCD_Pos (0)
+#define CDC_SERIAL_STATE_DCD_Msk (1 << CDC_SERIAL_STATE_DCD_Pos)
#define CDC_ECM_XMIT_OK (1 << 0)
#define CDC_ECM_RVC_OK (1 << 1)
diff --git a/class/serial/usbh_cdc_acm.c b/class/serial/usbh_cdc_acm.c
index 121649b1..cf5363ef 100644
--- a/class/serial/usbh_cdc_acm.c
+++ b/class/serial/usbh_cdc_acm.c
@@ -147,9 +147,9 @@ static int usbh_cdc_acm_get_modem_status(struct usbh_serial *serial)
cdc_acm_class = (struct usbh_cdc_acm *)serial->priv;
- status = (cdc_acm_class->modem_status & CDC_SERIAL_STATE_TX_CARRIER ? USBH_SERIAL_TIOCM_DSR : 0) |
+ status = (cdc_acm_class->modem_status & CDC_SERIAL_STATE_DSR ? USBH_SERIAL_TIOCM_DSR : 0) |
(cdc_acm_class->modem_status & CDC_SERIAL_STATE_RING ? USBH_SERIAL_TIOCM_RI : 0) |
- (cdc_acm_class->modem_status & CDC_SERIAL_STATE_RX_CARRIER ? USBH_SERIAL_TIOCM_CD : 0) |
+ (cdc_acm_class->modem_status & CDC_SERIAL_STATE_DCD ? USBH_SERIAL_TIOCM_CD : 0) |
(serial->line_state & USBH_SERIAL_TIOCM_DTR ? USBH_SERIAL_TIOCM_DTR : 0) |
(serial->line_state & USBH_SERIAL_TIOCM_RTS ? USBH_SERIAL_TIOCM_RTS : 0);
@@ -192,10 +192,10 @@ static int __usbh_cdc_acm_get_modem_status(struct usbh_serial *serial)
difference = cdc_acm_class->modem_status ^ notification->data;
cdc_acm_class->modem_status = notification->data;
- if (difference & CDC_SERIAL_STATE_TX_CARRIER)
- serial->iocount.dsr++;
- if (difference & CDC_SERIAL_STATE_RX_CARRIER)
+ if (difference & CDC_SERIAL_STATE_DSR)
serial->iocount.dsr++;
+ if (difference & CDC_SERIAL_STATE_DCD)
+ serial->iocount.dcd++;
if (notification->data & CDC_SERIAL_STATE_BREAK)
serial->iocount.brk++;
if (notification->data & CDC_SERIAL_STATE_FRAMING)