USB_IsConnected is now cleared before the USB_Disconnect() event is fired in response...
[pub/USBasp.git] / Demos / Device / GenericHID / Descriptors.c
index a14fc50..0eed6e9 100644 (file)
@@ -134,7 +134,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                                                                         \r
                        .HIDSpec                = VERSION_BCD(01.11),\r
                        .CountryCode            = 0x00,\r
-                       .TotalHIDReports        = 0x01,\r
+                       .TotalReportDescriptors = 1,\r
                        .HIDReportType          = DTYPE_Report,\r
                        .HIDReportLength        = sizeof(GenericReport)\r
                },\r
@@ -210,37 +210,37 @@ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** c
        switch (DescriptorType)\r
        {\r
                case DTYPE_Device:\r
-                       Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);\r
+                       Address = (void*)&DeviceDescriptor;\r
                        Size    = sizeof(USB_Descriptor_Device_t);\r
                        break;\r
                case DTYPE_Configuration: \r
-                       Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);\r
+                       Address = (void*)&ConfigurationDescriptor;\r
                        Size    = sizeof(USB_Descriptor_Configuration_t);\r
                        break;\r
                case DTYPE_String: \r
                        switch (DescriptorNumber)\r
                        {\r
                                case 0x00: \r
-                                       Address = DESCRIPTOR_ADDRESS(LanguageString);\r
+                                       Address = (void*)&LanguageString;\r
                                        Size    = pgm_read_byte(&LanguageString.Header.Size);\r
                                        break;\r
                                case 0x01: \r
-                                       Address = DESCRIPTOR_ADDRESS(ManufacturerString);\r
+                                       Address = (void*)&ManufacturerString;\r
                                        Size    = pgm_read_byte(&ManufacturerString.Header.Size);\r
                                        break;\r
                                case 0x02: \r
-                                       Address = DESCRIPTOR_ADDRESS(ProductString);\r
+                                       Address = (void*)&ProductString;\r
                                        Size    = pgm_read_byte(&ProductString.Header.Size);\r
                                        break;\r
                        }\r
                        \r
                        break;\r
                case DTYPE_HID: \r
-                       Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor.GenericHID);\r
+                       Address = (void*)&ConfigurationDescriptor.GenericHID;\r
                        Size    = sizeof(USB_Descriptor_HID_t);\r
                        break;\r
                case DTYPE_Report: \r
-                       Address = DESCRIPTOR_ADDRESS(GenericReport);\r
+                       Address = (void*)&GenericReport;\r
                        Size    = sizeof(GenericReport);\r
                        break;\r
        }\r