Skip to content

Commit 8a0fe09

Browse files
Old-DingRbb666
authored andcommitted
components/usb: configure CDC VCOM strings
1 parent 31e6343 commit 8a0fe09

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

components/legacy/usb/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,12 @@ menu "Using USB legacy version"
119119
config RT_VCOM_TX_USE_DMA
120120
bool "Enable to use dma for vcom tx"
121121
default n
122+
config RT_VCOM_MANUFACTURER_STRING
123+
string "virtual com manufacturer string"
124+
default "RT-Thread Team."
125+
config RT_VCOM_PRODUCT_STRING
126+
string "virtual com product string"
127+
default "RTT Virtual Serial"
122128
config RT_VCOM_SERNO
123129
string "serial number of virtual com"
124130
default "32021919830108"

components/legacy/usb/usbdevice/class/cdc_vcom.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,18 @@
4949
#define VCOM_TX_USE_DMA
5050
#endif /*RT_VCOM_TX_USE_DMA*/
5151

52+
#ifdef RT_VCOM_MANUFACTURER_STRING
53+
#define VCOM_MANUFACTURER_STRING RT_VCOM_MANUFACTURER_STRING
54+
#else /*!RT_VCOM_MANUFACTURER_STRING*/
55+
#define VCOM_MANUFACTURER_STRING "RT-Thread Team."
56+
#endif /*RT_VCOM_MANUFACTURER_STRING*/
57+
58+
#ifdef RT_VCOM_PRODUCT_STRING
59+
#define VCOM_PRODUCT_STRING RT_VCOM_PRODUCT_STRING
60+
#else /*!RT_VCOM_PRODUCT_STRING*/
61+
#define VCOM_PRODUCT_STRING "RTT Virtual Serial"
62+
#endif /*RT_VCOM_PRODUCT_STRING*/
63+
5264
#ifdef RT_VCOM_SERNO
5365
#define _SER_NO RT_VCOM_SERNO
5466
#else /*!RT_VCOM_SERNO*/
@@ -250,8 +262,8 @@ rt_align(4)
250262
const static char* _ustring[] =
251263
{
252264
"Language",
253-
"RT-Thread Team.",
254-
"RTT Virtual Serial",
265+
VCOM_MANUFACTURER_STRING,
266+
VCOM_PRODUCT_STRING,
255267
serno,
256268
"Configuration",
257269
"Interface",

0 commit comments

Comments
 (0)