Fixed Set/Clear Feature requests directed to a non-configured endpoint not returning...
authorDean Camera <dean@fourwalledcubicle.com>
Wed, 14 Apr 2010 13:46:49 +0000 (13:46 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Wed, 14 Apr 2010 13:46:49 +0000 (13:46 +0000)
Make TeensyHID bootloader use an 8 byte control endpoint to match the official Teensy, just in case Paul decides to authenticate on that attribute in the future.

Bootloaders/TeensyHID/makefile
LUFA/Drivers/USB/LowLevel/DevChapter9.c
LUFA/Drivers/USB/LowLevel/Template/Template_Endpoint_Control_W.c
LUFA/ManPages/ChangeLog.txt
Projects/LEDNotifier/makefile

index 0895222..10b0ebb 100644 (file)
@@ -110,7 +110,7 @@ LUFA_PATH = ../..
 # LUFA library compile-time options\r
 LUFA_OPTS  = -D USB_DEVICE_ONLY\r
 LUFA_OPTS += -D DEVICE_STATE_AS_GPIOR=0\r
-LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=64\r
+LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8\r
 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1\r
 LUFA_OPTS += -D USE_RAM_DESCRIPTORS\r
 LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"\r
index 7d9e815..17a5fd4 100644 (file)
@@ -323,7 +323,7 @@ static void USB_Device_GetStatus(void)
 #endif\r
 #if !defined(CONTROL_ONLY_DEVICE)\r
                case (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_ENDPOINT):\r
-                       Endpoint_SelectEndpoint(USB_ControlRequest.wIndex & 0xFF);\r
+                       Endpoint_SelectEndpoint((uint8_t)USB_ControlRequest.wIndex & ENDPOINT_EPNUM_MASK);\r
 \r
                        CurrentStatus = Endpoint_IsStalled();\r
 \r
@@ -344,7 +344,7 @@ static void USB_Device_GetStatus(void)
 }\r
 \r
 static void USB_Device_ClearSetFeature(void)\r
-{      \r
+{\r
        switch (USB_ControlRequest.bmRequestType & CONTROL_REQTYPE_RECIPIENT)\r
        {\r
 #if !defined(NO_DEVICE_REMOTE_WAKEUP)                  \r
@@ -367,18 +367,18 @@ static void USB_Device_ClearSetFeature(void)
 \r
                                Endpoint_SelectEndpoint(EndpointIndex);\r
 \r
-                               if (Endpoint_IsEnabled())\r
-                               {                               \r
-                                       if (USB_ControlRequest.bRequest == REQ_SetFeature)\r
-                                       {\r
-                                               Endpoint_StallTransaction();\r
-                                       }\r
-                                       else\r
-                                       {\r
-                                               Endpoint_ClearStall();\r
-                                               Endpoint_ResetFIFO(EndpointIndex);\r
-                                               Endpoint_ResetDataToggle();\r
-                                       }                                       \r
+                               if (!(Endpoint_IsEnabled()))\r
+                                 return;\r
+\r
+                               if (USB_ControlRequest.bRequest == REQ_SetFeature)\r
+                               {\r
+                                       Endpoint_StallTransaction();\r
+                               }\r
+                               else\r
+                               {\r
+                                       Endpoint_ClearStall();\r
+                                       Endpoint_ResetFIFO(EndpointIndex);\r
+                                       Endpoint_ResetDataToggle();\r
                                }\r
                        }\r
                        \r
index 70560cf..7868060 100644 (file)
@@ -21,7 +21,7 @@ uint8_t TEMPLATE_FUNC_NAME (const void* Buffer, uint16_t Length)
                  \r
                if (Endpoint_IsINReady())\r
                {\r
-                       uint16_t BytesInEndpoint = Endpoint_BytesInEndpoint();\r
+                       uint8_t BytesInEndpoint = Endpoint_BytesInEndpoint();\r
                \r
                        while (Length && (BytesInEndpoint < USB_ControlEndpointSize))\r
                        {\r
index d88e6a2..57093ae 100644 (file)
@@ -41,6 +41,7 @@
   *  - Fixed Still Image Host class driver not resetting the transaction ID when a new session is opened, fixed driver not sending\r
   *    a valid session ID to the device\r
   *  - Removed invalid dfu and flip related targets from the bootloaders - bootloaders can only be replaced with an external programmer\r
+  *  - Fixed Set/Clear Feature requests directed to a non-configured endpoint not returning a stall to the host\r
   *\r
   *  \section Sec_ChangeLog100219 Version 100219\r
   *\r
index 20cd598..7e49178 100644 (file)
@@ -60,7 +60,7 @@
 \r
 \r
 # MCU name\r
-MCU = at90usb646\r
+MCU = at90usb1287\r
 \r
 \r
 # Target board (see library "Board Types" documentation, NONE for projects not requiring\r