Removed specialized Endpoint_ClearControl* and Pipe_ClearControl* macros in favour...
authorDean Camera <dean@fourwalledcubicle.com>
Tue, 21 Apr 2009 06:05:50 +0000 (06:05 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Tue, 21 Apr 2009 06:05:50 +0000 (06:05 +0000)
23 files changed:
Bootloaders/CDC/BootloaderCDC.c
Bootloaders/DFU/BootloaderDFU.c
Bootloaders/TeensyHID/TeensyHID.c
Demos/Device/AudioInput/AudioInput.c
Demos/Device/AudioOutput/AudioOutput.c
Demos/Device/CDC/CDC.c
Demos/Device/DualCDC/DualCDC.c
Demos/Device/GenericHID/GenericHID.c
Demos/Device/Joystick/Joystick.c
Demos/Device/Keyboard/Keyboard.c
Demos/Device/KeyboardMouse/KeyboardMouse.c
Demos/Device/MassStorage/MassStorage.c
Demos/Device/Mouse/Mouse.c
Demos/Device/RNDISEthernet/RNDISEthernet.c
Demos/Device/USBtoSerial/USBtoSerial.c
LUFA/ChangeLog.txt
LUFA/Drivers/USB/LowLevel/DevChapter9.c
LUFA/Drivers/USB/LowLevel/Endpoint.c
LUFA/Drivers/USB/LowLevel/Endpoint.h
LUFA/Drivers/USB/LowLevel/HostChapter9.c
LUFA/Drivers/USB/LowLevel/Pipe.h
LUFA/MigrationInformation.txt
Projects/Magstripe/Magstripe.c

index 9cdb776..6b69421 100644 (file)
@@ -160,45 +160,45 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                case REQ_GetLineEncoding:\r
                        if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {\r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
 \r
                                for (uint8_t i = 0; i < sizeof(LineCoding); i++)\r
                                  Endpoint_Write_Byte(*(LineCodingData++));     \r
                                \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
                case REQ_SetLineEncoding:\r
                        if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {\r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
 \r
                                while (!(Endpoint_IsOUTReceived()));\r
 \r
                                for (uint8_t i = 0; i < sizeof(LineCoding); i++)\r
                                  *(LineCodingData++) = Endpoint_Read_Byte();\r
 \r
-                               Endpoint_ClearControlOUT();\r
+                               Endpoint_ClearOUT();\r
 \r
                                /* Acknowledge status stage */\r
                                while (!(Endpoint_IsINReady()));\r
-                               Endpoint_ClearControlIN();\r
+                               Endpoint_ClearIN();\r
                        }\r
        \r
                        break;\r
                case REQ_SetControlLineState:\r
                        if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {\r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
                                \r
                                /* Acknowledge status stage */\r
                                while (!(Endpoint_IsINReady()));\r
-                               Endpoint_ClearControlIN();\r
+                               Endpoint_ClearIN();\r
                        }\r
        \r
                        break;\r
index 00c1ea5..289b4eb 100644 (file)
@@ -163,7 +163,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
        switch (bRequest)\r
        {\r
                case DFU_DNLOAD:\r
-                       Endpoint_ClearControlSETUP();\r
+                       Endpoint_ClearSETUP();\r
                        \r
                        /* Check if bootloader is waiting to terminate */\r
                        if (WaitForExit)\r
@@ -235,7 +235,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                                                        /* Check if endpoint is empty - if so clear it and wait until ready for next packet */\r
                                                        if (!(Endpoint_BytesInEndpoint()))\r
                                                        {\r
-                                                               Endpoint_ClearControlOUT();\r
+                                                               Endpoint_ClearOUT();\r
                                                                while (!(Endpoint_IsOUTReceived()));\r
                                                        }\r
 \r
@@ -279,7 +279,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                                                        /* Check if endpoint is empty - if so clear it and wait until ready for next packet */\r
                                                        if (!(Endpoint_BytesInEndpoint()))\r
                                                        {\r
-                                                               Endpoint_ClearControlOUT();\r
+                                                               Endpoint_ClearOUT();\r
                                                                while (!(Endpoint_IsOUTReceived()));\r
                                                        }\r
 \r
@@ -296,15 +296,15 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                                }\r
                        }\r
 \r
-                       Endpoint_ClearControlOUT();\r
+                       Endpoint_ClearOUT();\r
 \r
                        /* Acknowledge status stage */\r
                        while (!(Endpoint_IsINReady()));\r
-                       Endpoint_ClearControlIN();\r
+                       Endpoint_ClearIN();\r
                                \r
                        break;\r
                case DFU_UPLOAD:\r
-                       Endpoint_ClearControlSETUP();\r
+                       Endpoint_ClearSETUP();\r
 \r
                        while (!(Endpoint_IsINReady()));\r
 \r
@@ -343,7 +343,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                                                /* Check if endpoint is full - if so clear it and wait until ready for next packet */\r
                                                if (Endpoint_BytesInEndpoint() == FIXED_CONTROL_ENDPOINT_SIZE)\r
                                                {\r
-                                                       Endpoint_ClearControlIN();\r
+                                                       Endpoint_ClearIN();\r
                                                        while (!(Endpoint_IsINReady()));\r
                                                }\r
 \r
@@ -368,7 +368,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                                                /* Check if endpoint is full - if so clear it and wait until ready for next packet */\r
                                                if (Endpoint_BytesInEndpoint() == FIXED_CONTROL_ENDPOINT_SIZE)\r
                                                {\r
-                                                       Endpoint_ClearControlIN();\r
+                                                       Endpoint_ClearIN();\r
                                                        while (!(Endpoint_IsINReady()));\r
                                                }\r
 \r
@@ -384,15 +384,15 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                                DFU_State = dfuIDLE;\r
                        }\r
 \r
-                       Endpoint_ClearControlIN();\r
+                       Endpoint_ClearIN();\r
 \r
                        /* Acknowledge status stage */\r
                        while (!(Endpoint_IsOUTReceived()));\r
-                       Endpoint_ClearControlOUT();\r
+                       Endpoint_ClearOUT();\r
 \r
                        break;\r
                case DFU_GETSTATUS:\r
-                       Endpoint_ClearControlSETUP();\r
+                       Endpoint_ClearSETUP();\r
                        \r
                        /* Write 8-bit status value */\r
                        Endpoint_Write_Byte(DFU_Status);\r
@@ -407,46 +407,46 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                        /* Write 8-bit state string ID number */\r
                        Endpoint_Write_Byte(0);\r
 \r
-                       Endpoint_ClearControlIN();\r
+                       Endpoint_ClearIN();\r
                        \r
                        /* Acknowledge status stage */\r
                        while (!(Endpoint_IsOUTReceived()));\r
-                       Endpoint_ClearControlOUT();\r
+                       Endpoint_ClearOUT();\r
        \r
                        break;          \r
                case DFU_CLRSTATUS:\r
-                       Endpoint_ClearControlSETUP();\r
+                       Endpoint_ClearSETUP();\r
                        \r
                        /* Reset the status value variable to the default OK status */\r
                        DFU_Status = OK;\r
 \r
                        /* Acknowledge status stage */\r
                        while (!(Endpoint_IsINReady()));\r
-                       Endpoint_ClearControlIN();\r
+                       Endpoint_ClearIN();\r
                        \r
                        break;\r
                case DFU_GETSTATE:\r
-                       Endpoint_ClearControlSETUP();\r
+                       Endpoint_ClearSETUP();\r
                        \r
                        /* Write the current device state to the endpoint */\r
                        Endpoint_Write_Byte(DFU_State);\r
                \r
-                       Endpoint_ClearControlIN();\r
+                       Endpoint_ClearIN();\r
                        \r
                        /* Acknowledge status stage */\r
                        while (!(Endpoint_IsOUTReceived()));\r
-                       Endpoint_ClearControlOUT();\r
+                       Endpoint_ClearOUT();\r
 \r
                        break;\r
                case DFU_ABORT:\r
-                       Endpoint_ClearControlSETUP();\r
+                       Endpoint_ClearSETUP();\r
                        \r
                        /* Reset the current state variable to the default idle state */\r
                        DFU_State = dfuIDLE;\r
                        \r
                        /* Acknowledge status stage */\r
                        while (!(Endpoint_IsINReady()));\r
-                       Endpoint_ClearControlIN();\r
+                       Endpoint_ClearIN();\r
 \r
                        break;\r
        }\r
@@ -463,7 +463,7 @@ static void DiscardFillerBytes(uint8_t NumberOfBytes)
        {\r
                if (!(Endpoint_BytesInEndpoint()))\r
                {\r
-                       Endpoint_ClearControlOUT();\r
+                       Endpoint_ClearOUT();\r
 \r
                        /* Wait until next data packet received */\r
                        while (!(Endpoint_IsOUTReceived()));\r
index f82e28e..e81c462 100644 (file)
@@ -101,7 +101,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                case REQ_SetReport:\r
                        if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {\r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
                                \r
                                /* Wait until the command (report) has been sent by the host */\r
                                while (!(Endpoint_IsOUTReceived()));\r
@@ -126,7 +126,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                                                /* Check if endpoint is empty - if so clear it and wait until ready for next packet */\r
                                                if (!(Endpoint_BytesInEndpoint()))\r
                                                {\r
-                                                       Endpoint_ClearControlOUT();\r
+                                                       Endpoint_ClearOUT();\r
                                                        while (!(Endpoint_IsOUTReceived()));\r
                                                }\r
 \r
@@ -142,11 +142,11 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                                        boot_rww_enable();\r
                                }\r
 \r
-                               Endpoint_ClearControlOUT();\r
+                               Endpoint_ClearOUT();\r
 \r
                                /* Acknowledge status stage */\r
                                while (!(Endpoint_IsINReady()));\r
-                               Endpoint_ClearControlIN();\r
+                               Endpoint_ClearIN();\r
                        }\r
                        \r
                        break;\r
index ade3aa5..45b9971 100644 (file)
@@ -139,7 +139,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                        {\r
                                uint16_t wValue = Endpoint_Read_Word_LE();\r
                                \r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
                                \r
                                /* Check if the host is enabling the audio interface (setting AlternateSetting to 1) */\r
                                if (wValue)\r
@@ -155,7 +155,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                                \r
                                /* Acknowledge status stage */\r
                                while (!(Endpoint_IsINReady()));\r
-                               Endpoint_ClearControlIN();\r
+                               Endpoint_ClearIN();\r
                        }\r
 \r
                        break;\r
index aae0168..ba9a499 100644 (file)
@@ -166,7 +166,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                        {\r
                                uint16_t wValue = Endpoint_Read_Word_LE();\r
                                \r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
                                \r
                                /* Check if the host is enabling the audio interface (setting AlternateSetting to 1) */\r
                                if (wValue)\r
@@ -182,7 +182,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                                \r
                                /* Acknowledge status stage */\r
                                while (!(Endpoint_IsINReady()));\r
-                               Endpoint_ClearControlIN();\r
+                               Endpoint_ClearIN();\r
                        }\r
 \r
                        break;\r
index 4c51fc6..fb7d74b 100644 (file)
@@ -166,13 +166,13 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                        if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {       \r
                                /* Acknowledge the SETUP packet, ready for data transfer */\r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
 \r
                                /* Write the line coding data to the control endpoint */\r
                                Endpoint_Write_Control_Stream_LE(LineCodingData, sizeof(CDC_Line_Coding_t));\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
@@ -180,13 +180,13 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                        if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {\r
                                /* Acknowledge the SETUP packet, ready for data transfer */\r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
 \r
                                /* Read the line coding data in from the host into the global struct */\r
                                Endpoint_Read_Control_Stream_LE(LineCodingData, sizeof(CDC_Line_Coding_t));\r
 \r
                                /* Finalize the stream transfer to clear the last packet from the host */\r
-                               Endpoint_ClearControlIN();\r
+                               Endpoint_ClearIN();\r
                        }\r
        \r
                        break;\r
@@ -205,11 +205,11 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
 #endif\r
                                \r
                                /* Acknowledge the SETUP packet, ready for data transfer */\r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
                                \r
                                /* Acknowledge status stage */\r
                                while (!(Endpoint_IsINReady()));\r
-                               Endpoint_ClearControlIN();\r
+                               Endpoint_ClearIN();\r
                        }\r
        \r
                        break;\r
index 69d26c4..bbcbecc 100644 (file)
@@ -204,13 +204,13 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                        if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {       \r
                                /* Acknowledge the SETUP packet, ready for data transfer */\r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
 \r
                                /* Write the line coding data to the control endpoint */\r
                                Endpoint_Write_Control_Stream_LE(LineCodingData, sizeof(CDC_Line_Coding_t));\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
@@ -218,13 +218,13 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                        if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {\r
                                /* Acknowledge the SETUP packet, ready for data transfer */\r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
 \r
                                /* Read the line coding data in from the host into the global struct */\r
                                Endpoint_Read_Control_Stream_LE(LineCodingData, sizeof(CDC_Line_Coding_t));\r
 \r
                                /* Finalize the stream transfer to clear the last packet from the host */\r
-                               Endpoint_ClearControlIN();\r
+                               Endpoint_ClearIN();\r
                        }\r
        \r
                        break;\r
@@ -232,11 +232,11 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                        if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {\r
                                /* Acknowledge the SETUP packet, ready for data transfer */\r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
                                \r
                                /* Acknowledge status stage */\r
                                while (!(Endpoint_IsINReady()));\r
-                               Endpoint_ClearControlIN();\r
+                               Endpoint_ClearIN();\r
                        }\r
        \r
                        break;\r
index a0d4f15..207f63c 100644 (file)
@@ -165,7 +165,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                case REQ_GetReport:\r
                        if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {\r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
        \r
                                uint8_t GenericData[GENERIC_REPORT_SIZE];\r
                                \r
@@ -175,14 +175,14 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                                Endpoint_Write_Control_Stream_LE(&GenericData, sizeof(GenericData));\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_SetReport:\r
                        if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {\r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
                                \r
                                /* Wait until the generic report has been sent by the host */\r
                                while (!(Endpoint_IsOUTReceived()));\r
@@ -194,13 +194,13 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                                ProcessGenericHIDReport(GenericData);\r
                        \r
                                /* Clear the endpoint data */\r
-                               Endpoint_ClearControlOUT();\r
+                               Endpoint_ClearOUT();\r
 \r
                                /* Wait until the host is ready to receive the request confirmation */\r
                                while (!(Endpoint_IsINReady()));\r
                                \r
                                /* Handshake the request by sending an empty IN packet */\r
-                               Endpoint_ClearControlIN();\r
+                               Endpoint_ClearIN();\r
                        }\r
                        \r
                        break;\r
index 60eef54..e5d23bd 100644 (file)
@@ -145,13 +145,13 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                                if (wLength > sizeof(JoystickReportData))\r
                                  wLength = sizeof(JoystickReportData);\r
 \r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
        \r
                                /* Write the report data to the control endpoint */\r
                                Endpoint_Write_Control_Stream_LE(&JoystickReportData, wLength);\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
index f0e0186..6d7ee3f 100644 (file)
@@ -216,20 +216,20 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                                if (wLength > sizeof(KeyboardReportData))\r
                                  wLength = sizeof(KeyboardReportData);\r
 \r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
        \r
                                /* Write the report data to the control endpoint */\r
                                Endpoint_Write_Control_Stream_LE(&KeyboardReportData, wLength);\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_SetReport:\r
                        if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {\r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
                                \r
                                /* Wait until the LED report has been sent by the host */\r
                                while (!(Endpoint_IsOUTReceived()));\r
@@ -241,28 +241,28 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                                ProcessLEDReport(LEDStatus);\r
                        \r
                                /* Clear the endpoint data */\r
-                               Endpoint_ClearControlOUT();\r
+                               Endpoint_ClearOUT();\r
 \r
                                /* Acknowledge status stage */\r
                                while (!(Endpoint_IsINReady()));\r
-                               Endpoint_ClearControlIN();\r
+                               Endpoint_ClearIN();\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
@@ -272,14 +272,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
@@ -289,31 +289,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
index 957b9b3..9cae69a 100644 (file)
@@ -167,7 +167,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                                if (wLength > ReportSize)\r
                                  wLength = ReportSize;\r
 \r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
        \r
                                /* Write the report data to the control endpoint */\r
                                Endpoint_Write_Control_Stream_LE(ReportData, wLength);\r
@@ -176,14 +176,14 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                                memset(ReportData, 0, ReportSize);\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_SetReport:\r
                        if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {\r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
                                \r
                                /* Wait until the LED report has been sent by the host */\r
                                while (!(Endpoint_IsOUTReceived()));\r
@@ -205,11 +205,11 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                                LEDs_SetAllLEDs(LEDMask);\r
 \r
                                /* Clear the endpoint data */\r
-                               Endpoint_ClearControlOUT();\r
+                               Endpoint_ClearOUT();\r
 \r
                                /* Acknowledge status stage */\r
                                while (!(Endpoint_IsINReady()));\r
-                               Endpoint_ClearControlIN();\r
+                               Endpoint_ClearIN();\r
                        }\r
                        \r
                        break;\r
index 7ddb8f0..8c7db93 100644 (file)
@@ -153,30 +153,30 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                case REQ_MassStorageReset:\r
                        if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {\r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
 \r
                                /* Indicate that the current transfer should be aborted */\r
                                IsMassStoreReset = true;                        \r
 \r
                                /* Acknowledge status stage */\r
                                while (!(Endpoint_IsINReady()));\r
-                               Endpoint_ClearControlIN();\r
+                               Endpoint_ClearIN();\r
                        }\r
 \r
                        break;\r
                case REQ_GetMaxLUN:\r
                        if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {\r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
 \r
                                /* Indicate to the host the number of supported LUNs (virtual disks) on the device */\r
                                Endpoint_Write_Byte(TOTAL_LUNS - 1);\r
                                \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
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
index d77cc45..ec8eb7b 100644 (file)
@@ -156,13 +156,13 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                        if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {\r
                                /* Clear the SETUP packet, ready for data transfer */\r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
                                \r
                                /* Read in the RNDIS message into the message buffer */\r
                                Endpoint_Read_Control_Stream_LE(RNDISMessageBuffer, wLength);\r
 \r
                                /* Finalize the stream transfer to clear the last packet from the host */\r
-                               Endpoint_ClearControlIN();\r
+                               Endpoint_ClearIN();\r
 \r
                                /* Process the RNDIS message */\r
                                ProcessRNDISControlMessage();\r
@@ -185,13 +185,13 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                                  wLength = MessageHeader->MessageLength;\r
 \r
                                /* Clear the SETUP packet, ready for data transfer */\r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
                                \r
                                /* Write the message response data to the endpoint */\r
                                Endpoint_Write_Control_Stream_LE(RNDISMessageBuffer, wLength);\r
                                \r
                                /* Finalize the stream transfer to send the last packet or clear the host abort */\r
-                               Endpoint_ClearControlOUT();\r
+                               Endpoint_ClearOUT();\r
 \r
                                /* Reset the message header once again after transmission */\r
                                MessageHeader->MessageLength = 0;\r
index 6bd14cc..e1c22fc 100644 (file)
@@ -159,13 +159,13 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                        if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {       \r
                                /* Acknowledge the SETUP packet, ready for data transfer */\r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
 \r
                                /* Write the line coding data to the control endpoint */\r
                                Endpoint_Write_Control_Stream_LE(LineCodingData, sizeof(LineCoding));\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
@@ -173,13 +173,13 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                        if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {\r
                                /* Acknowledge the SETUP packet, ready for data transfer */\r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
 \r
                                /* Read the line coding data in from the host into the global struct */\r
                                Endpoint_Read_Control_Stream_LE(LineCodingData, sizeof(LineCoding));\r
 \r
                                /* Finalize the stream transfer to clear the last packet from the host */\r
-                               Endpoint_ClearControlIN();\r
+                               Endpoint_ClearIN();\r
                                \r
                                /* Reconfigure the USART with the new settings */\r
                                ReconfigureUSART();\r
@@ -201,11 +201,11 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
 #endif\r
                                \r
                                /* Acknowledge the SETUP packet, ready for data transfer */\r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
                                \r
                                /* Acknowledge status stage */\r
                                while (!(Endpoint_IsINReady()));\r
-                               Endpoint_ClearControlIN();\r
+                               Endpoint_ClearIN();\r
                        }\r
        \r
                        break;\r
index 38b666b..f0c33e0 100644 (file)
   *  - The USB Host management task now saves and restores the currently selected pipe before and after the task completes\r
   *  - Fixed GenericHIDHost demo report write routine incorrect for control type requests (thanks to Andrei Krainev)\r
   *  - Removed Endpoint_ClearCurrentBank() and Pipe_ClearCurrentBank() in favour of new Endpoint_ClearIN(), Endpoint_ClearOUT(),\r
-  *    Endpoint_ClearControlIN(), Endpoint_ClearControlOUT(), Pipe_ClearIN(), Pipe_ClearOUT(), Pipe_ClearControlIN() and\r
-  *    Pipe_ClearControlOUT() macros (done to allow for the detection of packets of zero length)\r
+  *    Pipe_ClearIN() and Pipe_ClearOUT() macros (done to allow for the detection of packets of zero length)\r
   *  - Renamed *_ReadWriteAllowed() macros to *_IsReadWriteAllowed() to remain consistent with the rest of the LUFA API\r
   *  - Endpoint_IsSetupReceived() macro has been renamed to Endpoint_IsSETUPReceived(), Endpoint_ClearSetupReceived() macro has been\r
-  *    renamed to Endpoint_ClearControlSETUP(), the Pipe_IsSetupSent() macro has been renamed to Pipe_IsSETUPSent() and the\r
+  *    renamed to Endpoint_ClearSETUP(), the Pipe_IsSetupSent() macro has been renamed to Pipe_IsSETUPSent() and the\r
   *    Pipe_ClearSetupSent() macro is no longer applicable and should be removed - changes made to compliment the new endpoint and pipe\r
   *    bank management API\r
-  *  - Updated all demos, bootloaders and projects to use the new endpoint and pipe management APIs (thanks to Roman Thiel)\r
+  *  - Updated all demos, bootloaders and projects to use the new endpoint and pipe management APIs (thanks to Roman Thiel (Curetis AG))\r
   *  - Updated library doxygen documentation, added groups, changed documentation macro functions to real functions for clarity\r
   *  - Removed old endpoint and pipe aliased read/write/discard routines which did not have an explicit endian specifier for clarity\r
   *  - Removed the ButtLoadTag.h header file, as no one used for its intended purpose anyway\r
index 19d7298..3f2805c 100644 (file)
@@ -108,7 +108,7 @@ void USB_Device_ProcessControlPacket(void)
        if (Endpoint_IsSETUPReceived())\r
        {\r
                Endpoint_StallTransaction();\r
-               Endpoint_ClearControlSETUP();           \r
+               Endpoint_ClearSETUP();          \r
        }\r
 }\r
 \r
@@ -116,11 +116,11 @@ static void USB_Device_SetAddress(void)
 {\r
        uint8_t wValue_LSB = Endpoint_Read_Byte();\r
 \r
-       Endpoint_ClearControlSETUP();\r
+       Endpoint_ClearSETUP();\r
        \r
        while (!(Endpoint_IsINReady()));\r
        \r
-       Endpoint_ClearControlIN();\r
+       Endpoint_ClearIN();\r
        \r
        while (!(Endpoint_IsINReady()));\r
 \r
@@ -152,11 +152,11 @@ static void USB_Device_SetConfiguration(void)
                return;\r
        }\r
        \r
-       Endpoint_ClearControlSETUP();\r
+       Endpoint_ClearSETUP();\r
 \r
        USB_ConfigurationNumber = wValue_LSB;\r
 \r
-       Endpoint_ClearControlIN();\r
+       Endpoint_ClearIN();\r
 \r
        if (!(AlreadyConfigured) && USB_ConfigurationNumber)\r
          RAISE_EVENT(USB_DeviceEnumerationComplete);\r
@@ -166,14 +166,14 @@ static void USB_Device_SetConfiguration(void)
 \r
 void USB_Device_GetConfiguration(void)\r
 {\r
-       Endpoint_ClearControlSETUP();   \r
+       Endpoint_ClearSETUP();  \r
 \r
        Endpoint_Write_Byte(USB_ConfigurationNumber);\r
        \r
-       Endpoint_ClearControlIN();\r
+       Endpoint_ClearIN();\r
 \r
        while (!(Endpoint_IsOUTReceived()));\r
-       Endpoint_ClearControlOUT();\r
+       Endpoint_ClearOUT();\r
 }\r
 \r
 static void USB_Device_GetDescriptor(void)\r
@@ -190,7 +190,7 @@ static void USB_Device_GetDescriptor(void)
        if ((DescriptorSize = USB_GetDescriptor(wValue, wIndex, &DescriptorPointer)) == NO_DESCRIPTOR)\r
          return;\r
        \r
-       Endpoint_ClearControlSETUP();   \r
+       Endpoint_ClearSETUP();  \r
        \r
        if (wLength > DescriptorSize)\r
          wLength = DescriptorSize;\r
@@ -201,7 +201,7 @@ static void USB_Device_GetDescriptor(void)
                {\r
                        if (Endpoint_IsOUTReceived())\r
                        {\r
-                               Endpoint_ClearControlOUT();\r
+                               Endpoint_ClearOUT();\r
                                return;\r
                        }               \r
                }\r
@@ -220,17 +220,17 @@ static void USB_Device_GetDescriptor(void)
                }\r
                \r
                SendZLP = (Endpoint_BytesInEndpoint() == USB_ControlEndpointSize);\r
-               Endpoint_ClearControlIN();\r
+               Endpoint_ClearIN();\r
        }\r
        \r
        if (SendZLP)\r
        {\r
                while (!(Endpoint_IsINReady()));\r
-               Endpoint_ClearControlIN();\r
+               Endpoint_ClearIN();\r
        }\r
 \r
        while (!(Endpoint_IsOUTReceived()));\r
-       Endpoint_ClearControlOUT();\r
+       Endpoint_ClearOUT();\r
 }\r
 \r
 static void USB_Device_GetStatus(const uint8_t bmRequestType)\r
@@ -264,14 +264,14 @@ static void USB_Device_GetStatus(const uint8_t bmRequestType)
        }\r
        \r
        Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);                      \r
-       Endpoint_ClearControlSETUP();\r
+       Endpoint_ClearSETUP();\r
 \r
        Endpoint_Write_Word_LE(CurrentStatus);\r
 \r
-       Endpoint_ClearControlIN();\r
+       Endpoint_ClearIN();\r
        \r
        while (!(Endpoint_IsOUTReceived()));\r
-       Endpoint_ClearControlOUT();\r
+       Endpoint_ClearOUT();\r
 }\r
 \r
 #if !defined(FEATURELESS_CONTROL_ONLY_DEVICE)\r
@@ -306,8 +306,8 @@ static void USB_Device_ClearSetFeature(const uint8_t bRequest, const uint8_t bmR
                                        }\r
 \r
                                        Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);\r
-                                       Endpoint_ClearControlSETUP();\r
-                                       Endpoint_ClearControlIN();\r
+                                       Endpoint_ClearSETUP();\r
+                                       Endpoint_ClearIN();\r
                                }\r
                        }\r
                        \r
index b885471..e196b6a 100644 (file)
@@ -59,7 +59,7 @@ bool Endpoint_ConfigureEndpointStatic(const uint8_t Number, const uint8_t UECFG0
        Endpoint_SelectEndpoint(Number);\r
        Endpoint_EnableEndpoint();\r
 \r
-       UECFG1X = 0;    \r
+       UECFG1X = 0;\r
 \r
        UECFG0X = UECFG0XData;\r
        UECFG1X = UECFG1XData;\r
@@ -307,7 +307,7 @@ uint8_t Endpoint_Write_Control_Stream_LE(const void* Buffer, uint16_t Length)
                }\r
                \r
                SendZLP = (Endpoint_BytesInEndpoint() == USB_ControlEndpointSize);\r
-               Endpoint_ClearControlIN();\r
+               Endpoint_ClearIN();\r
        }\r
        \r
        if (Endpoint_IsOUTReceived())\r
@@ -316,7 +316,7 @@ uint8_t Endpoint_Write_Control_Stream_LE(const void* Buffer, uint16_t Length)
        if (SendZLP)\r
        {\r
                while (!(Endpoint_IsINReady()));\r
-               Endpoint_ClearControlIN();\r
+               Endpoint_ClearIN();\r
        }\r
        \r
        while (!(Endpoint_IsOUTReceived()));\r
@@ -341,7 +341,7 @@ uint8_t Endpoint_Write_Control_Stream_BE(const void* Buffer, uint16_t Length)
                }\r
                \r
                SendZLP = (Endpoint_BytesInEndpoint() == USB_ControlEndpointSize);\r
-               Endpoint_ClearControlIN();\r
+               Endpoint_ClearIN();\r
        }\r
        \r
        if (Endpoint_IsOUTReceived())\r
@@ -350,7 +350,7 @@ uint8_t Endpoint_Write_Control_Stream_BE(const void* Buffer, uint16_t Length)
        if (SendZLP)\r
        {\r
                while (!(Endpoint_IsINReady()));\r
-               Endpoint_ClearControlIN();\r
+               Endpoint_ClearIN();\r
        }\r
        \r
        while (!(Endpoint_IsOUTReceived()));\r
@@ -373,7 +373,7 @@ uint8_t Endpoint_Read_Control_Stream_LE(void* Buffer, uint16_t Length)
                        Length--;\r
                }\r
                \r
-               Endpoint_ClearControlOUT();\r
+               Endpoint_ClearOUT();\r
        }\r
        \r
        while (!(Endpoint_IsINReady()));\r
@@ -396,7 +396,7 @@ uint8_t Endpoint_Read_Control_Stream_BE(void* Buffer, uint16_t Length)
                        Length--;\r
                }\r
                \r
-               Endpoint_ClearControlOUT();\r
+               Endpoint_ClearOUT();\r
        }\r
        \r
        while (!(Endpoint_IsINReady()));\r
index 90375b0..816e763 100644 (file)
                                 *\r
                                 *  \note This is not applicable for non CONTROL type endpoints.                         \r
                                 */\r
-                               static inline void Endpoint_ClearControlSETUP(void);\r
+                               static inline void Endpoint_ClearSETUP(void);\r
                                \r
-                               /** Sends an IN packet to the host on the currently selected CONTROL type endpoint, freeing up the\r
-                                *  endpoint for the next packet.\r
-                                *\r
-                                *  \ingroup Group_EndpointPacketManagement\r
-                                *\r
-                                *  \note For non CONTROL type endpoints, use Endpoint_ClearIN() instead.                        \r
-                                */\r
-                               static inline void Endpoint_ClearControlIN(void);\r
-                               \r
-                               /** Acknowledges an OUT packet to the host on the currently selected CONTROL type endpoint, freeing\r
-                                *  up the endpoint for the next packet.\r
+                               /** Sends an IN packet to the host on the currently selected endpoint, freeing up the endpoint for the\r
+                                *  next packet and switching to the alternative endpoint bank if double banked.\r
                                 *\r
                                 *  \ingroup Group_EndpointPacketManagement\r
-                                *\r
-                                *  \note For non CONTROL type endpoints, use Endpoint_ClearOUT() instead.\r
-                                */\r
-                               static inline void Endpoint_ClearControlOUT(void);\r
-                               \r
-                               /** Sends an IN packet to the host on the currently selected non CONTROL type endpoint, freeing\r
-                                *  up the endpoint for the next packet and switching to the alternative endpoint bank if double banked.\r
-                                *\r
-                                *  \ingroup Group_EndpointPacketManagement\r
-                                *\r
-                                *  \note For CONTROL type endpoints, use Endpoint_ClearControlIN() instead.\r
                                 */\r
                                static inline void Endpoint_ClearIN(void);\r
                                \r
-                               /** Acknowledges an OUT packet to the host on the currently selected non CONTROL type endpoint, freeing\r
-                                *  up the endpoint for the next packet and switching to the alternative endpoint bank if double banked.\r
+                               /** Acknowledges an OUT packet to the host on the currently selected endpoint, freeing up the endpoint\r
+                                *  for the next packet and switching to the alternative endpoint bank if double banked.\r
                                 *\r
                                 *  \ingroup Group_EndpointPacketManagement\r
-                                *\r
-                                *  \note For CONTROL type endpoints, use Endpoint_ClearControlOUT() instead.\r
                                 */\r
                                static inline void Endpoint_ClearOUT(void);\r
                                \r
 \r
                                #define Endpoint_IsSETUPReceived()            ((UEINTX & (1 << RXSTPI)) ? true : false)\r
 \r
-                               #define Endpoint_ClearControlSETUP()          MACROS{ UEINTX &= ~(1 << RXSTPI); }MACROE\r
-\r
-                               #define Endpoint_ClearControlIN()             MACROS{ UEINTX &= ~(1 << TXINI); }MACROE\r
-\r
-                               #define Endpoint_ClearControlOUT()            MACROS{ UEINTX &= ~(1 << RXOUTI); }MACROE\r
+                               #define Endpoint_ClearSETUP()                 MACROS{ UEINTX &= ~(1 << RXSTPI); }MACROE\r
 \r
                                #define Endpoint_ClearIN()                    MACROS{ uint8_t Temp = UEINTX; UEINTX = (Temp & ~(1 << TXINI)); \\r
                                                                                      UEINTX = (Temp & ~(1 << FIFOCON)); }MACROE\r
                        /** Writes the given number of bytes to the CONTROL type endpoint from the given buffer in little endian,\r
                         *  sending full packets to the host as needed. The host OUT acknowledgement is not automatically cleared\r
                         *  in both failure and success states; the user is responsible for manually clearing the setup OUT to\r
-                        *  finalize the transfer via the Endpoint_ClearControlOUT() macro.\r
+                        *  finalize the transfer via the Endpoint_ClearOUT() macro.\r
                         *\r
                         *  \note This routine should only be used on CONTROL type endpoints.\r
                         *\r
                        /** Writes the given number of bytes to the CONTROL type endpoint from the given buffer in big endian,\r
                         *  sending full packets to the host as needed. The host OUT acknowledgement is not automatically cleared\r
                         *  in both failure and success states; the user is responsible for manually clearing the setup OUT to\r
-                        *  finalize the transfer via the Endpoint_ClearControlOUT() macro.\r
+                        *  finalize the transfer via the Endpoint_ClearOUT() macro.\r
                         *\r
                         *  \note This routine should only be used on CONTROL type endpoints.\r
                         *\r
                        /** Reads the given number of bytes from the CONTROL endpoint from the given buffer in little endian,\r
                         *  discarding fully read packets from the host as needed. The device IN acknowledgement is not\r
                         *  automatically sent after success or failure states; the user is responsible for manually sending the\r
-                        *  setup IN to finalize the transfer via the Endpoint_ClearControlIN() macro.\r
+                        *  setup IN to finalize the transfer via the Endpoint_ClearIN() macro.\r
                         *\r
                         *  \note This routine should only be used on CONTROL type endpoints.\r
                         *\r
                         *\r
                         *  \return A value from the Endpoint_ControlStream_RW_ErrorCodes_t enum.\r
                         */\r
-                       uint8_t Endpoint_Read_Control_Stream_LE(void* Buffer, uint16_t Length)  ATTR_NON_NULL_PTR_ARG(1);\r
+                       uint8_t Endpoint_Read_Control_Stream_LE(void* Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);\r
 \r
                        /** Reads the given number of bytes from the CONTROL endpoint from the given buffer in big endian,\r
                         *  discarding fully read packets from the host as needed. The device IN acknowledgement is not\r
                         *  automatically sent after success or failure states; the user is responsible for manually sending the\r
-                        *  setup IN to finalize the transfer via the Endpoint_ClearControlIN() macro.\r
+                        *  setup IN to finalize the transfer via the Endpoint_ClearIN() macro.\r
                         *\r
                         *  \note This routine should only be used on CONTROL type endpoints.\r
                         *\r
                         *\r
                         *  \return A value from the Endpoint_ControlStream_RW_ErrorCodes_t enum.\r
                         */\r
-                       uint8_t Endpoint_Read_Control_Stream_BE(void* Buffer, uint16_t Length)  ATTR_NON_NULL_PTR_ARG(1);               \r
+                       uint8_t Endpoint_Read_Control_Stream_BE(void* Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);                \r
                        \r
        /* Private Interface - For use in library only: */\r
        #if !defined(__DOXYGEN__)\r
index c89910e..dfc3f44 100644 (file)
@@ -58,7 +58,7 @@ uint8_t USB_Host_SendControlRequest(void* BufferPtr)
        for (uint8_t HeaderByte = 0; HeaderByte < sizeof(USB_Host_Request_Header_t); HeaderByte++)\r
          Pipe_Write_Byte(*(HeaderStream++));\r
 \r
-       Pipe_ClearControlSETUP();\r
+       Pipe_ClearSETUP();\r
        \r
        if ((ReturnStatus = USB_Host_Wait_For_Setup_IOS(USB_HOST_WAITFOR_SetupSent)))\r
          goto End_Of_Control_Send;\r
@@ -91,7 +91,7 @@ uint8_t USB_Host_SendControlRequest(void* BufferPtr)
                                }\r
 \r
                                Pipe_Freeze();\r
-                               Pipe_ClearControlIN();\r
+                               Pipe_ClearIN();\r
                        }\r
                }\r
 \r
@@ -101,7 +101,7 @@ uint8_t USB_Host_SendControlRequest(void* BufferPtr)
                if ((ReturnStatus = USB_Host_Wait_For_Setup_IOS(USB_HOST_WAITFOR_OutReady)))\r
                  goto End_Of_Control_Send;\r
 \r
-               Pipe_ClearControlOUT();\r
+               Pipe_ClearOUT();\r
 \r
                if ((ReturnStatus = USB_Host_Wait_For_Setup_IOS(USB_HOST_WAITFOR_OutReady)))\r
                  goto End_Of_Control_Send;\r
@@ -124,7 +124,7 @@ uint8_t USB_Host_SendControlRequest(void* BufferPtr)
                                        DataLen--;\r
                                }\r
                                \r
-                               Pipe_ClearControlOUT();\r
+                               Pipe_ClearOUT();\r
                        }\r
 \r
                        if ((ReturnStatus = USB_Host_Wait_For_Setup_IOS(USB_HOST_WAITFOR_OutReady)))\r
@@ -139,7 +139,7 @@ uint8_t USB_Host_SendControlRequest(void* BufferPtr)
                if ((ReturnStatus = USB_Host_Wait_For_Setup_IOS(USB_HOST_WAITFOR_InReceived)))\r
                  goto End_Of_Control_Send;\r
 \r
-               Pipe_ClearControlIN();\r
+               Pipe_ClearIN();\r
        }\r
 \r
 End_Of_Control_Send:\r
index c4a58b4..3f512c0 100644 (file)
                                 */\r
                                static inline bool Pipe_IsSETUPSent(void);\r
                                \r
-                               /** Acknowledges the reception of a setup IN request from the attached device on the currently selected\r
-                                *  CONTROL type pipe, freeing the bank ready for the next packet.\r
-                                *\r
-                                *  \ingroup Group_PipePacketManagement\r
-                                *\r
-                                *  \note For non CONTROL type pipes, use Pipe_ClearIN() instead.                        \r
-                                */\r
-                               static inline void Pipe_ClearControlIN(void);\r
-\r
-                               /** Sends the currently selected pipe's contents to the device as an OUT packet on the selected pipe, freeing\r
-                                *  the bank ready for the next packet.\r
-                                *\r
-                                *  \ingroup Group_PipePacketManagement\r
-                                *\r
-                                *  \note For non CONTROL type pipes, use Pipe_ClearOUT() instead.      \r
-                                */\r
-                               static inline void Pipe_ClearControlOUT(void);\r
-\r
                                /** Sends the currently selected CONTROL type pipe's contents to the device as a SETUP packet.\r
                                 *\r
-                                *  \ingroup Group_PipePacketManagement\r
-                                *\r
-                                *  \note This is not applicable for non CONTROL type pipes.                    \r
+                                *  \ingroup Group_PipePacketManagement         \r
                                 */\r
-                               static inline void Pipe_ClearControlSETUP(void);\r
+                               static inline void Pipe_ClearSETUP(void);\r
 \r
                                /** Acknowledges the reception of a setup IN request from the attached device on the currently selected\r
                                 *  pipe, freeing the bank ready for the next packet.\r
                                 *\r
                                 *  \ingroup Group_PipePacketManagement\r
-                                *\r
-                                *  \note For CONTROL type pipes, use Pipe_ClearControlIN() instead.    \r
                                 */\r
                                static inline void Pipe_ClearIN(void);\r
 \r
                                 *  the bank ready for the next packet.\r
                                 *\r
                                 *  \ingroup Group_PipePacketManagement\r
-                                *\r
-                                *  \note For CONTROL type pipes, use Pipe_ClearControlOUT() instead.   \r
                                 */\r
                                static inline void Pipe_ClearOUT(void);\r
 \r
                                #define Pipe_ClearIN()                 MACROS{ uint8_t Temp = UPINTX; UPINTX = (Temp & ~(1 << RXINI)); \\r
                                                                               UPINTX = (Temp & ~(1 << FIFOCON)); }MACROE\r
 \r
-                               #define Pipe_ClearControlIN()          MACROS{ uint8_t Temp = UPINTX; UPINTX = (Temp & ~(1 << RXINI)); \\r
-                                                                              UPINTX = (Temp & ~(1 << FIFOCON)); }MACROE\r
-\r
                                #define Pipe_ClearOUT()                MACROS{ uint8_t Temp = UPINTX; UPINTX = (Temp & ~(1 << TXOUTI)); \\r
                                                                               UPINTX = (Temp & ~(1 << FIFOCON)); }MACROE\r
                                \r
-                               #define Pipe_ClearControlOUT()         MACROS{ uint8_t Temp = UPINTX; UPINTX = (Temp & ~(1 << TXOUTI)); \\r
-                                                                              UPINTX = (Temp & ~(1 << FIFOCON)); }MACROE\r
-\r
-                               #define Pipe_ClearControlSETUP()       MACROS{ uint8_t Temp = UPINTX; UPINTX = (Temp & ~(1 << TXSTPI)); \\r
+                               #define Pipe_ClearSETUP()              MACROS{ uint8_t Temp = UPINTX; UPINTX = (Temp & ~(1 << TXSTPI)); \\r
                                                                               UPINTX = (Temp & ~(1 << FIFOCON)); }MACROE\r
 \r
                                #define Pipe_IsNAKReceived()           ((UPINTX & (1 << NAKEDI)) ? true : false)\r
index 104f098..576ba64 100644 (file)
  *      library demos should update to the latest versions.\r
  *\r
  *  <b>Device Mode</b>\r
- *    - The Endpoint_ClearCurrentBank() macro has been removed, and is now replaced with the Endpoint_ClearIN(), Endpoint_ClearOUT(),\r
- *      Endpoint_ClearControlIN(), Endpoint_ClearControlOUT() and other related macros. See Endpoint.h documentation for more details\r
- *      on the new endpoint management macros.\r
+ *    - The Endpoint_ClearCurrentBank() macro has been removed, and is now replaced with the Endpoint_ClearIN(), Endpoint_ClearOUT() \r
+ *      macros. See Endpoint.h documentation for more details on the new endpoint management macros.\r
  *    - The Endpoint_ReadWriteAllowed() macro has been renamed to Endpoint_IsReadWriteAllowed() to be more consistent with the rest of\r
  *      the API naming scheme.\r
  *    - The Endpoint_IsSetupINReady() and Endpoint_IsSetupOutReceived() macros have been renamed to Endpoint_IsINReady() and\r
  *      Endpoint_IsOUTReceived() respectively.\r
  *    - The Endpoint_IsSetupReceived() macro has been renamed to Endpoint_IsSETUPReceived().\r
- *    - The Endpoint_ClearSetupReceived() macro has been renamed to Endpoint_ClearControlSETUP().\r
+ *    - The Endpoint_ClearSetupReceived() macro has been renamed to Endpoint_ClearSETUP().\r
  *    - All endpoint read/write/discard aliases which did not have an explicitly endianness specifier (such as Endpoint_Read_Word()) have\r
  *      been removed for clarity. Existing projects should use the "_LE" suffix on such calls to use the explicit Little Endian versions.\r
  *\r
  *      in existing projects where the Control pipe is to be operated on.\r
  *    - The USB Host management task now saves and restores the currently selected pipe before and after the task runs. Projects no longer\r
  *      need to manage this manually when calling the USB management task.\r
- *    - The Pipe_ClearCurrentBank() macro has been removed, and is now replaced with the Pipe_ClearIN(), Pipe_ClearOUT(),\r
- *      Pipe_ClearControlIN(), Pipe_ClearControlOUT() and other related macros. See Pipe.h documentation for more details on the new pipe\r
- *      management macros.\r
+ *    - The Pipe_ClearCurrentBank() macro has been removed, and is now replaced with the Pipe_ClearIN(), Pipe_ClearOUT() macros. See\r
+ *      Pipe.h documentation for more details on the new pipe management macros.\r
  *    - The Pipe_ReadWriteAllowed() macro has been renamed to Pipe_IsReadWriteAllowed() to be more consistent with the rest of the API\r
  *      naming scheme.\r
  *    - The Pipe_IsSetupINReceived() and Pipe_IsOutReady() macros have been renamed to Pipe_IsINReceived() and Pipe_IsOUTReady()\r
  *      respectively.\r
- *    - The new Pipe_ClearControlSETUP() macro should be used to send CONTROL transactions, rather than the previous Pipe_ClearSetupOUT() macro.\r
+ *    - The new Pipe_ClearSETUP() macro should be used to send SETUP transactions, rather than the previous Pipe_ClearSetupOUT() macro.\r
  *    - The Pipe_IsSetupSent() macro has been renamed to Pipe_IsSETUPSent().\r
  *    - The Pipe_ClearSetupSent() macro is no longer applicable and should be removed.\r
  *    - All pipe read/write/discard aliases which did not have an explicitly endianness specifier (such as Pipe_Read_Word()) have\r
index 4511b1c..94eed31 100644 (file)
@@ -178,30 +178,30 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                                if (wLength > sizeof(KeyboardReportData))\r
                                  wLength = sizeof(KeyboardReportData);\r
 \r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
        \r
                                /* Write the report data to the control endpoint */\r
                                Endpoint_Write_Control_Stream_LE(&KeyboardReportData, wLength);\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
@@ -211,14 +211,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
@@ -228,31 +228,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