初级会员

- 积分
- 115
- 金钱
- 115
- 注册时间
- 2014-11-16
- 在线时间
- 0 小时
|
5金钱
在usbd_desc.c中, 有一个结构体,记录着各种返回描述符的函数,定义如下所示
USBD_DEVICE USR_desc =
{
USBD_USR_DeviceDescriptor,
USBD_USR_LangIDStrDescriptor,
USBD_USR_ManufacturerStrDescriptor,
USBD_USR_ProductStrDescriptor,
USBD_USR_SerialStrDescriptor,
USBD_USR_ConfigStrDescriptor,
USBD_USR_InterfaceStrDescriptor,
};
再看其中的函数定义,我举个例子,比如倒数第二个USBD_USR_ConfigStrDescriptor,具体定义如下:
uint8_t * USBD_USR_ConfigStrDescriptor( uint8_t speed , uint16_t *length)
{
if(speed == USB_OTG_SPEED_HIGH)
{
USBD_GetString (USBD_CONFIGURATION_HS_STRING, USBD_StrDesc, length);
}
else
{
USBD_GetString (USBD_CONFIGURATION_FS_STRING, USBD_StrDesc, length);
}
return USBD_StrDesc;
}
这里的USBD_GetString就把USBD_CONFIGURATION_FS_STRING转换成unicode放到了 USBD_StrDesc中,可是:
#define USBD_CONFIGURATION_FS_STRING "MSC Config"
这里的"MSC Config"就是配置描述符吗,就这么几个字符吗?
|
|