summaryrefslogtreecommitdiff
path: root/components/drivers/usb
diff options
context:
space:
mode:
authormazhiyuan <[email protected]>2021-10-14 11:42:05 +0800
committermazhiyuan <[email protected]>2021-10-14 11:42:05 +0800
commitf04941c95109257aa3ce8426bf4cd239f4d790da (patch)
treebc6d638fb997688dd14b91d8010b884d257f5cab /components/drivers/usb
parentbc5744b1ba0dc5af6fc392fdd3ad5d2a00aca0c5 (diff)
[cdc_vcom.c]adapt to both v1 and v2 of serial
Diffstat (limited to 'components/drivers/usb')
-rw-r--r--components/drivers/usb/usbdevice/class/cdc_vcom.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/components/drivers/usb/usbdevice/class/cdc_vcom.c b/components/drivers/usb/usbdevice/class/cdc_vcom.c
index a8440bf15f..1a24b79f2e 100644
--- a/components/drivers/usb/usbdevice/class/cdc_vcom.c
+++ b/components/drivers/usb/usbdevice/class/cdc_vcom.c
@@ -939,9 +939,12 @@ static void rt_usb_vcom_init(struct ufunction *func)
config.parity = PARITY_NONE;
config.bit_order = BIT_ORDER_LSB;
config.invert = NRZ_NORMAL;
+#if defined(RT_USING_SERIAL_V1)
+ config.bufsz = CDC_RX_BUFSIZE;
+#elif defined(RT_USING_SERIAL_V2)
config.rx_bufsz = CDC_RX_BUFSIZE;
config.tx_bufsz = CDC_TX_BUFSIZE;
-
+#endif
data->serial.ops = &usb_vcom_ops;
data->serial.serial_rx = RT_NULL;
data->serial.config = config;