Oops - restore deleted MissileLauncher project, fix all spelling errors for "missile...
[pub/USBasp.git] / LUFA / Drivers / USB / LowLevel / DevChapter9.c
index f02d32b..829bd13 100644 (file)
@@ -62,7 +62,8 @@ void USB_Device_ProcessControlPacket(void)
                        break;\r
                case REQ_ClearFeature:\r
                case REQ_SetFeature:\r
                        break;\r
                case REQ_ClearFeature:\r
                case REQ_SetFeature:\r
-                       if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_ENDPOINT))\r
+                       if ((bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE)) ||\r
+                           (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_ENDPOINT)))\r
                        {\r
                                USB_Device_ClearSetFeature();\r
                                RequestHandled = true;\r
                        {\r
                                USB_Device_ClearSetFeature();\r
                                RequestHandled = true;\r
@@ -105,7 +106,7 @@ void USB_Device_ProcessControlPacket(void)
        }\r
 \r
        if (!(RequestHandled))\r
        }\r
 \r
        if (!(RequestHandled))\r
-         RAISE_EVENT(USB_UnhandledControlPacket);\r
+         EVENT_USB_UnhandledControlPacket();\r
          \r
        if (Endpoint_IsSETUPReceived())\r
        {\r
          \r
        if (Endpoint_IsSETUPReceived())\r
        {\r
@@ -118,8 +119,6 @@ static void USB_Device_SetAddress(void)
 {\r
        Endpoint_ClearSETUP();\r
        \r
 {\r
        Endpoint_ClearSETUP();\r
        \r
-       while (!(Endpoint_IsINReady()));\r
-       \r
        Endpoint_ClearIN();\r
        \r
        while (!(Endpoint_IsINReady()));\r
        Endpoint_ClearIN();\r
        \r
        while (!(Endpoint_IsINReady()));\r
@@ -138,7 +137,7 @@ static void USB_Device_SetConfiguration(void)
 #else\r
        USB_Descriptor_Device_t* DevDescriptorPtr;\r
 \r
 #else\r
        USB_Descriptor_Device_t* DevDescriptorPtr;\r
 \r
-       if ((USB_GetDescriptor((DTYPE_Device << 8), 0, (void*)&DevDescriptorPtr) == NO_DESCRIPTOR) ||\r
+       if ((CALLBACK_USB_GetDescriptor((DTYPE_Device << 8), 0, (void*)&DevDescriptorPtr) == NO_DESCRIPTOR) ||\r
        #if defined(USE_RAM_DESCRIPTORS)\r
            ((uint8_t)USB_ControlRequest.wValue > DevDescriptorPtr->NumberOfConfigurations))\r
        #elif defined (USE_EEPROM_DESCRIPTORS)\r
        #if defined(USE_RAM_DESCRIPTORS)\r
            ((uint8_t)USB_ControlRequest.wValue > DevDescriptorPtr->NumberOfConfigurations))\r
        #elif defined (USE_EEPROM_DESCRIPTORS)\r
@@ -158,14 +157,14 @@ static void USB_Device_SetConfiguration(void)
        Endpoint_ClearIN();\r
 \r
        if (!(AlreadyConfigured) && USB_ConfigurationNumber)\r
        Endpoint_ClearIN();\r
 \r
        if (!(AlreadyConfigured) && USB_ConfigurationNumber)\r
-         RAISE_EVENT(USB_DeviceEnumerationComplete);\r
+         EVENT_USB_DeviceEnumerationComplete();\r
 \r
 \r
-       RAISE_EVENT(USB_ConfigurationChanged);\r
+       EVENT_USB_ConfigurationChanged();\r
 }\r
 \r
 void USB_Device_GetConfiguration(void)\r
 {\r
 }\r
 \r
 void USB_Device_GetConfiguration(void)\r
 {\r
-       Endpoint_ClearSETUP();  \r
+       Endpoint_ClearSETUP();\r
 \r
        Endpoint_Write_Byte(USB_ConfigurationNumber);\r
        \r
 \r
        Endpoint_Write_Byte(USB_ConfigurationNumber);\r
        \r
@@ -180,8 +179,11 @@ static void USB_Device_GetDescriptor(void)
        void*    DescriptorPointer;\r
        uint16_t DescriptorSize;\r
        \r
        void*    DescriptorPointer;\r
        uint16_t DescriptorSize;\r
        \r
-       if ((DescriptorSize = USB_GetDescriptor(USB_ControlRequest.wValue, USB_ControlRequest.wIndex, &DescriptorPointer)) == NO_DESCRIPTOR)\r
-         return;\r
+       if ((DescriptorSize = CALLBACK_USB_GetDescriptor(USB_ControlRequest.wValue, USB_ControlRequest.wIndex,\r
+                                                        &DescriptorPointer)) == NO_DESCRIPTOR)\r
+       {\r
+               return;\r
+       }\r
        \r
        Endpoint_ClearSETUP();\r
        \r
        \r
        Endpoint_ClearSETUP();\r
        \r
@@ -207,7 +209,7 @@ static void USB_Device_GetDescriptor(void)
                while (USB_ControlRequest.wLength && (Endpoint_BytesInEndpoint() < USB_ControlEndpointSize))\r
                {\r
                        #if defined (USE_EEPROM_DESCRIPTORS)\r
                while (USB_ControlRequest.wLength && (Endpoint_BytesInEndpoint() < USB_ControlEndpointSize))\r
                {\r
                        #if defined (USE_EEPROM_DESCRIPTORS)\r
-                       Endpoint_Write_Byte(eeprom_read_byte(DescriptorPointer++));                     \r
+                       Endpoint_Write_Byte(eeprom_read_byte(DescriptorPointer++));             \r
                        #else\r
                        Endpoint_Write_Byte(pgm_read_byte(DescriptorPointer++));\r
                        #endif\r
                        #else\r
                        Endpoint_Write_Byte(pgm_read_byte(DescriptorPointer++));\r
                        #endif\r
@@ -299,7 +301,7 @@ static void USB_Device_ClearSetFeature(void)
                                        }\r
                                        else\r
                                        {\r
                                        }\r
                                        else\r
                                        {\r
-                                               Endpoint_StallTransaction();                                            \r
+                                               Endpoint_StallTransaction();\r
                                        }\r
                                }\r
                        }\r
                                        }\r
                                }\r
                        }\r
@@ -313,9 +315,6 @@ static void USB_Device_ClearSetFeature(void)
        Endpoint_ClearSETUP();\r
 \r
        Endpoint_ClearIN();\r
        Endpoint_ClearSETUP();\r
 \r
        Endpoint_ClearIN();\r
-\r
-       while (!(Endpoint_IsOUTReceived()));\r
-       Endpoint_ClearOUT();\r
 }\r
 \r
 #endif\r
 }\r
 \r
 #endif\r