Removed specialized Endpoint_ClearControl* and Pipe_ClearControl* macros in favour...
[pub/USBasp.git] / Demos / Device / Mouse / Mouse.c
index 38a7086..0959a4a 100644 (file)
@@ -206,7 +206,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                                if (wLength > sizeof(MouseReportData))\r
                                  wLength = sizeof(MouseReportData);\r
 \r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
        \r
                                /* Write the report data to the control endpoint */\r
                                Endpoint_Write_Control_Stream_LE(&MouseReportData, wLength);\r
@@ -215,24 +215,24 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                                memset(&MouseReportData, 0, sizeof(MouseReportData));\r
 \r
                                /* Finalize the stream transfer to send the last packet or clear the host abort */\r
-                               Endpoint_ClearControlOUT();\r
+                               Endpoint_ClearOUT();\r
                        }\r
                \r
                        break;\r
                case REQ_GetProtocol:\r
                        if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {\r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
                                \r
                                /* Write the current protocol flag to the host */\r
                                Endpoint_Write_Byte(UsingReportProtocol);\r
                                \r
                                /* Send the flag to the host */\r
-                               Endpoint_ClearControlIN();\r
+                               Endpoint_ClearIN();\r
 \r
                                /* Acknowledge status stage */\r
                                while (!(Endpoint_IsOUTReceived()));\r
-                               Endpoint_ClearControlOUT();\r
+                               Endpoint_ClearOUT();\r
                        }\r
                        \r
                        break;\r
@@ -242,14 +242,14 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                                /* Read in the wValue parameter containing the new protocol mode */\r
                                uint16_t wValue = Endpoint_Read_Word_LE();\r
                                \r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
                                \r
                                /* Set or clear the flag depending on what the host indicates that the current Protocol should be */\r
                                UsingReportProtocol = (wValue != 0x0000);\r
                                \r
                                /* Acknowledge status stage */\r
                                while (!(Endpoint_IsINReady()));\r
-                               Endpoint_ClearControlIN();\r
+                               Endpoint_ClearIN();\r
                        }\r
                        \r
                        break;\r
@@ -259,31 +259,31 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                                /* Read in the wValue parameter containing the idle period */\r
                                uint16_t wValue = Endpoint_Read_Word_LE();\r
                                \r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
                                \r
                                /* Get idle period in MSB */\r
                                IdleCount = (wValue >> 8);\r
                                \r
                                /* Acknowledge status stage */\r
                                while (!(Endpoint_IsINReady()));\r
-                               Endpoint_ClearControlIN();\r
+                               Endpoint_ClearIN();\r
                        }\r
                        \r
                        break;\r
                case REQ_GetIdle:\r
                        if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {               \r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
                                \r
                                /* Write the current idle duration to the host */\r
                                Endpoint_Write_Byte(IdleCount);\r
                                \r
                                /* Send the flag to the host */\r
-                               Endpoint_ClearControlIN();\r
+                               Endpoint_ClearIN();\r
 \r
                                /* Acknowledge status stage */\r
                                while (!(Endpoint_IsOUTReceived()));\r
-                               Endpoint_ClearControlOUT();\r
+                               Endpoint_ClearOUT();\r
                        }\r
 \r
                        break;\r