瀏覽代碼

Merge pull request #1046 from uestczyh222/JM

[Components][Drivers][USB]fix OS proerty desc bug
Bernard Xiong 7 年之前
父節點
當前提交
89fd2e9f87
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      components/drivers/include/drivers/usb_device.h

+ 2 - 2
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);
             rt_memcpy((void *)pdata,(void *)&usb_os_proerty[index],10);
             pdata += 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 = usb_os_proerty[index].bPropertyName[i];
                 pdata++;
                 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;
             *((rt_uint32_t *)pdata) = usb_os_proerty[index].dwPropertyDataLength;
             pdata += 4;
             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 = usb_os_proerty[index].bPropertyData[i];
                 pdata++;
                 pdata++;