USB_IsConnected is now cleared before the USB_Disconnect() event is fired in response...
[pub/USBasp.git] / Demos / Device / Mouse / Descriptors.c
index e58e997..0a6cbde 100644 (file)
@@ -144,7 +144,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(MouseReport)\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.MouseHID);\r
+                       Address = (void*)&ConfigurationDescriptor.MouseHID;\r
                        Size    = sizeof(USB_Descriptor_HID_t);\r
                        break;\r
                case DTYPE_Report: \r
-                       Address = DESCRIPTOR_ADDRESS(MouseReport);\r
+                       Address = (void*)&MouseReport;\r
                        Size    = sizeof(MouseReport);\r
                        break;\r
        }\r