Bernard Xiong 7 лет назад
Родитель
Сommit
053dbc902b
2 измененных файлов с 38 добавлено и 30 удалено
  1. 1 1
      examples/rdbd_shell.c
  2. 37 29
      src/usb_rdbd.c

+ 1 - 1
examples/rdbd_shell.c

@@ -335,7 +335,7 @@ int rdbd_shell_service_init(void)
     LOG_I("status %d", shell_service->status);
     shell_device->type       = RT_Device_Class_Char;
 #ifdef RT_USING_DEVICE_OPS
-    device->ops         = &shell_ops;
+    shell_device->ops        = &shell_ops;
 #else
     shell_device->init       = rt_shell_service_device_init;
     shell_device->open       = rt_shell_service_device_open;

+ 37 - 29
src/usb_rdbd.c

@@ -79,39 +79,47 @@ struct usb_rdbd_descriptor _usb_rdbd_desc =
 {
 #ifdef RT_USB_DEVICE_COMPOSITE
     /* Interface Association Descriptor */
-    USB_DESC_LENGTH_IAD,
-    USB_DESC_TYPE_IAD,
-    USB_DYNAMIC,
-    0x01,
-    0xFF,
-    0x00,
-    0x00,
-    0x00,
+    {
+        USB_DESC_LENGTH_IAD,
+        USB_DESC_TYPE_IAD,
+        USB_DYNAMIC,
+        0x01,
+        0xFF,
+        0x00,
+        0x00,
+        0x00,
+    },
 #endif
     /*interface descriptor*/
-    USB_DESC_LENGTH_INTERFACE,  //bLength;
-    USB_DESC_TYPE_INTERFACE,    //type;
-    USB_DYNAMIC,                //bInterfaceNumber;
-    0x00,                       //bAlternateSetting;
-    0x02,                       //bNumEndpoints
-    0xFF,                       //bInterfaceClass;
-    0x00,                       //bInterfaceSubClass;
-    0x00,                       //bInterfaceProtocol;
-    0x00,                       //iInterface;
+    {
+        USB_DESC_LENGTH_INTERFACE,  //bLength;
+        USB_DESC_TYPE_INTERFACE,    //type;
+        USB_DYNAMIC,                //bInterfaceNumber;
+        0x00,                       //bAlternateSetting;
+        0x02,                       //bNumEndpoints
+        0xFF,                       //bInterfaceClass;
+        0x00,                       //bInterfaceSubClass;
+        0x00,                       //bInterfaceProtocol;
+        0x00,                       //iInterface;
+    },
     /*endpoint descriptor*/
-    USB_DESC_LENGTH_ENDPOINT,
-    USB_DESC_TYPE_ENDPOINT,
-    USB_DYNAMIC | USB_DIR_OUT,
-    USB_EP_ATTR_BULK,
-    USB_DYNAMIC,
-    0x00,
+    {
+        USB_DESC_LENGTH_ENDPOINT,
+        USB_DESC_TYPE_ENDPOINT,
+        USB_DYNAMIC | USB_DIR_OUT,
+        USB_EP_ATTR_BULK,
+        USB_DYNAMIC,
+        0x00,
+    },
     /*endpoint descriptor*/
-    USB_DESC_LENGTH_ENDPOINT,
-    USB_DESC_TYPE_ENDPOINT,
-    USB_DYNAMIC | USB_DIR_IN,
-    USB_EP_ATTR_BULK,
-    USB_DYNAMIC,
-    0x00,
+    {
+        USB_DESC_LENGTH_ENDPOINT,
+        USB_DESC_TYPE_ENDPOINT,
+        USB_DYNAMIC | USB_DIR_IN,
+        USB_EP_ATTR_BULK,
+        USB_DYNAMIC,
+        0x00,
+    }
 };