Revert changed CDC_Device_Flush() prototype accidentially changed in the last commit.
[pub/USBasp.git] / Demos / Host / ClassDriver / MouseHost / MouseHost.c
index 76a1238..844fa33 100644 (file)
@@ -47,7 +47,6 @@ USB_ClassInfo_HID_Host_t Mouse_HID_Interface =
                                .DataINPipeNumber       = 1,\r
                                .DataOUTPipeNumber      = 2,\r
                                \r
-                               .MatchInterfaceProtocol = true,\r
                                .HIDInterfaceProtocol   = 0x02,\r
                        },\r
        };\r
@@ -74,9 +73,8 @@ int main(void)
                                uint16_t ConfigDescriptorSize;\r
                                uint8_t  ConfigDescriptorData[512];\r
 \r
-                               if ((USB_GetDeviceConfigDescriptor(1, &ConfigDescriptorSize, NULL) != HOST_SENDCONTROL_Successful) ||\r
-                                   (ConfigDescriptorSize > sizeof(ConfigDescriptorData)) ||\r
-                                       (USB_GetDeviceConfigDescriptor(1, &ConfigDescriptorSize, ConfigDescriptorData)))\r
+                               if (USB_GetDeviceConfigDescriptor(1, &ConfigDescriptorSize, ConfigDescriptorData,\r
+                                                                 sizeof(ConfigDescriptorData)) != HOST_GETCONFIG_Successful)\r
                                {\r
                                        printf("Error Retrieving Configuration Descriptor.\r\n");\r
                                        LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
@@ -105,6 +103,11 @@ int main(void)
                                USB_HostState = HOST_STATE_Configured;\r
                                break;\r
                        case HOST_STATE_Configured:\r
+                               if (HID_Host_IsReportReceived(&Mouse_HID_Interface))\r
+                               {\r
+                                       \r
+                               }\r
+                       \r
                                break;\r
                }\r
        \r
@@ -160,8 +163,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode)
 {\r
        USB_ShutDown();\r
 \r
-       puts_P(PSTR(ESC_FG_RED "Host Mode Error\r\n"));\r
-       printf_P(PSTR(" -- Error Code %d\r\n" ESC_FG_WHITE), ErrorCode);\r
+       printf_P(PSTR(ESC_FG_RED "Host Mode Error\r\n"\r
+                                " -- Error Code %d\r\n" ESC_FG_WHITE), ErrorCode);\r
 \r
        LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
        for(;;);\r
@@ -172,10 +175,10 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode)
  */\r
 void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
 {\r
-       puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));\r
-       printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
-       printf_P(PSTR(" -- Sub Error Code %d\r\n"), SubErrorCode);\r
-       printf_P(PSTR(" -- In State %d\r\n" ESC_FG_WHITE), USB_HostState);\r
+       printf_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"\r
+                                " -- Error Code %d\r\n"\r
+                                " -- Sub Error Code %d\r\n"\r
+                                " -- In State %d\r\n" ESC_FG_WHITE), ErrorCode, SubErrorCode, USB_HostState);\r
        \r
        LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
 }\r