diff options
| author | Bernard Xiong <[email protected]> | 2017-11-28 16:39:54 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-11-28 16:39:54 +0800 |
| commit | 89fd2e9f875e8a80961761bd902166a0c69621a8 (patch) | |
| tree | 6a3b59bf160e6648a4811a2db40cb7d0f85444b9 | |
| parent | 128c184554bf7c0955f8de97a59e39c8a6f6198f (diff) | |
| parent | a8fc894c19c4025d2a71ed0a72ed10725ff1b219 (diff) | |
Merge pull request #1046 from uestczyh222/JM
[Components][Drivers][USB]fix OS proerty desc bug
| -rw-r--r-- | components/drivers/include/drivers/usb_device.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/components/drivers/include/drivers/usb_device.h b/components/drivers/include/drivers/usb_device.h index 8f2c1d1116..48f407cc3d 100644 --- a/components/drivers/include/drivers/usb_device.h +++ b/components/drivers/include/drivers/usb_device.h @@ -435,7 +435,7 @@ rt_inline void usbd_os_proerty_descriptor_send(ufunction_t func, ureq_t setup, u { rt_memcpy((void *)pdata,(void *)&usb_os_proerty[index],10); pdata += 10; - for(i = 0;i < usb_os_proerty[index].wPropertyNameLength;i++) + for(i = 0;i < usb_os_proerty[index].wPropertyNameLength/2;i++) { *pdata = usb_os_proerty[index].bPropertyName[i]; pdata++; @@ -444,7 +444,7 @@ rt_inline void usbd_os_proerty_descriptor_send(ufunction_t func, ureq_t setup, u } *((rt_uint32_t *)pdata) = usb_os_proerty[index].dwPropertyDataLength; pdata += 4; - for(i = 0;i < usb_os_proerty[index].dwPropertyDataLength;i++) + for(i = 0;i < usb_os_proerty[index].dwPropertyDataLength/2;i++) { *pdata = usb_os_proerty[index].bPropertyData[i]; pdata++; |
