Update DevChapter9.c - use the Endpoint_ClearStatusStage() function where possible...
authorDean Camera <dean@fourwalledcubicle.com>
Wed, 4 Nov 2009 04:17:11 +0000 (04:17 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Wed, 4 Nov 2009 04:17:11 +0000 (04:17 +0000)
Fix Joystick device demo HID descriptors - buttons should be placed outside the Pointer collection.

Demos/Device/ClassDriver/Joystick/Descriptors.c
Demos/Device/LowLevel/Joystick/Descriptors.c
LUFA/Drivers/USB/LowLevel/DevChapter9.c
LUFA/ManPages/ChangeLog.txt
LUFA/ManPages/LUFAPoweredProjects.txt

index 8f4177e..266710e 100644 (file)
@@ -58,18 +58,18 @@ USB_Descriptor_HIDReport_Datatype_t PROGMEM JoystickReport[] =
        0x75, 0x08,          /*     Report Size (8)                                */\r
        0x95, 0x02,          /*     Report Count (2)                               */\r
        0x81, 0x82,          /*     Input (Data, Variable, Absolute, Volatile)     */\r
-       0x05, 0x09,          /*     Usage Page (Button)                            */\r
-       0x09, 0x02,          /*     Usage (Button 2)                               */\r
-       0x09, 0x01,          /*     Usage (Button 1)                               */\r
-       0x15, 0x00,          /*     Logical Minimum (0)                            */\r
-       0x25, 0x01,          /*     Logical Maximum (1)                            */\r
-       0x75, 0x01,          /*     Report Size (1)                                */\r
-       0x95, 0x02,          /*     Report Count (2)                               */\r
-       0x81, 0x02,          /*     Input (Data, Variable, Absolute)               */\r
-       0x75, 0x06,          /*     Report Size (6)                                */\r
-       0x95, 0x01,          /*     Report Count (1)                               */\r
-       0x81, 0x01,          /*     Input (Constant)                               */\r
        0xc0,                /*   End Collection                                   */\r
+       0x05, 0x09,          /*   Usage Page (Button)                              */\r
+       0x09, 0x02,          /*   Usage (Button 2)                                 */\r
+       0x09, 0x01,          /*   Usage (Button 1)                                 */\r
+       0x15, 0x00,          /*   Logical Minimum (0)                              */\r
+       0x25, 0x01,          /*   Logical Maximum (1)                              */\r
+       0x75, 0x01,          /*   Report Size (1)                                  */\r
+       0x95, 0x02,          /*   Report Count (2)                                 */\r
+       0x81, 0x02,          /*   Input (Data, Variable, Absolute)                 */\r
+       0x75, 0x06,          /*   Report Size (6)                                  */\r
+       0x95, 0x01,          /*   Report Count (1)                                 */\r
+       0x81, 0x01,          /*   Input (Constant)                                 */\r
        0xc0                 /* End Collection                                     */\r
 };\r
 \r
index 63f3adc..911d7db 100644 (file)
@@ -58,18 +58,18 @@ USB_Descriptor_HIDReport_Datatype_t PROGMEM JoystickReport[] =
        0x75, 0x08,          /*     Report Size (8)                                */\r
        0x95, 0x02,          /*     Report Count (2)                               */\r
        0x81, 0x82,          /*     Input (Data, Variable, Absolute, Volatile)     */\r
-       0x05, 0x09,          /*     Usage Page (Button)                            */\r
-       0x09, 0x02,          /*     Usage (Button 2)                               */\r
-       0x09, 0x01,          /*     Usage (Button 1)                               */\r
-       0x15, 0x00,          /*     Logical Minimum (0)                            */\r
-       0x25, 0x01,          /*     Logical Maximum (1)                            */\r
-       0x75, 0x01,          /*     Report Size (1)                                */\r
-       0x95, 0x02,          /*     Report Count (2)                               */\r
-       0x81, 0x02,          /*     Input (Data, Variable, Absolute)               */\r
-       0x75, 0x06,          /*     Report Size (6)                                */\r
-       0x95, 0x01,          /*     Report Count (1)                               */\r
-       0x81, 0x01,          /*     Input (Constant)                               */\r
        0xc0,                /*   End Collection                                   */\r
+       0x05, 0x09,          /*   Usage Page (Button)                              */\r
+       0x09, 0x02,          /*   Usage (Button 2)                                 */\r
+       0x09, 0x01,          /*   Usage (Button 1)                                 */\r
+       0x15, 0x00,          /*   Logical Minimum (0)                              */\r
+       0x25, 0x01,          /*   Logical Maximum (1)                              */\r
+       0x75, 0x01,          /*   Report Size (1)                                  */\r
+       0x95, 0x02,          /*   Report Count (2)                                 */\r
+       0x81, 0x02,          /*   Input (Data, Variable, Absolute)                 */\r
+       0x75, 0x06,          /*   Report Size (6)                                  */\r
+       0x95, 0x01,          /*   Report Count (1)                                 */\r
+       0x81, 0x01,          /*   Input (Constant)                                 */\r
        0xc0                 /* End Collection                                     */\r
 };\r
 \r
index 50afb61..89c4e29 100644 (file)
@@ -121,7 +121,7 @@ static void USB_Device_SetAddress(void)
 \r
        Endpoint_ClearSETUP();\r
        \r
-       Endpoint_ClearIN();\r
+       Endpoint_ClearStatusStage();\r
        \r
        while (!(Endpoint_IsINReady()))\r
        {\r
@@ -190,7 +190,7 @@ static void USB_Device_SetConfiguration(void)
 \r
        USB_ConfigurationNumber = (uint8_t)USB_ControlRequest.wValue;\r
 \r
-       Endpoint_ClearIN();\r
+       Endpoint_ClearStatusStage();\r
 \r
        if (USB_ConfigurationNumber)\r
          USB_DeviceState = DEVICE_STATE_Configured;\r
@@ -205,16 +205,9 @@ void USB_Device_GetConfiguration(void)
        Endpoint_ClearSETUP();\r
 \r
        Endpoint_Write_Byte(USB_ConfigurationNumber);\r
-       \r
        Endpoint_ClearIN();\r
 \r
-       while (!(Endpoint_IsOUTReceived()))\r
-       {\r
-               if (USB_DeviceState == DEVICE_STATE_Unattached)\r
-                 return;       \r
-       }\r
-\r
-       Endpoint_ClearOUT();\r
+       Endpoint_ClearStatusStage();\r
 }\r
 \r
 #if !defined(NO_INTERNAL_SERIAL) && (defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR))\r
@@ -251,7 +244,9 @@ static void USB_Device_GetInternalSerialDescriptor(void)
        }\r
        \r
        Endpoint_ClearSETUP();\r
+\r
        Endpoint_Write_Control_Stream_LE(&SignatureDescriptor, sizeof(SignatureDescriptor));\r
+\r
        Endpoint_ClearOUT();\r
 }\r
 #endif\r
@@ -334,16 +329,9 @@ static void USB_Device_GetStatus(void)
        Endpoint_ClearSETUP();\r
 \r
        Endpoint_Write_Word_LE(CurrentStatus);\r
-\r
        Endpoint_ClearIN();\r
        \r
-       while (!(Endpoint_IsOUTReceived()))\r
-       {\r
-               if (USB_DeviceState == DEVICE_STATE_Unattached)\r
-                 return;       \r
-       }\r
-       \r
-       Endpoint_ClearOUT();\r
+       Endpoint_ClearStatusStage();\r
 }\r
 \r
 static void USB_Device_ClearSetFeature(void)\r
@@ -391,7 +379,7 @@ static void USB_Device_ClearSetFeature(void)
 \r
        Endpoint_ClearSETUP();\r
 \r
-       Endpoint_ClearIN();\r
+       Endpoint_ClearStatusStage();\r
 }\r
 \r
 #endif\r
index 6c25c58..aa76c44 100644 (file)
@@ -14,6 +14,7 @@
   *    Report protocol is not needed\r
   *  - Added new MIDI LowLevel and ClassDriver Host demo, add new MIDI Host Class driver\r
   *  - Added stdio.h stream examples for the virtual CDC UART in the CDC host demos\r
+  *  - Added new CDC/Mouse ClassDriver device demo\r
   *\r
   *  <b>Changed:</b>\r
   *  - Removed mostly useless "TestApp" demo, as it was mainly useful only for checking for sytax errors in the library\r
@@ -39,6 +40,7 @@
   *  - Fixed incorrect SampleFrequencyType value in the AudioInput and AudioOutput ClassDriver demos' descriptors\r
   *  - Fixed incorrect event name rule in demo/project/bootloader makefiles\r
   *  - Fixed HID device class driver not reselecting the correct endpoint once the user callback routines have been called\r
+  *  - Corrected HID descriptor in the Joystick Device demos - buttons should be placed outside the pointer collection\r
   *\r
   *  \section Sec_ChangeLog090924 Version 090924\r
   *\r
index 0023284..4c5a694 100644 (file)
@@ -35,6 +35,7 @@
  *  - "Fingerlicking Wingdinger" (WARNING: Bad Language if no Javascript), a MIDI controller - http://noisybox.net/electronics/wingdinger/\r
  *  - Garmin GPS USB to NMEA standard serial sentence translator: http://github.com/nall/garmin-transmogrifier/tree/master\r
  *  - Generic HID Device Creator : http://generichid.sourceforge.net/\r
+ *  - Mobo 4.3, some sort of Audio related device: http://sites.google.com/site/lofturj/mobo4_3\r
  *  - NES Controller USB modification: http://projects.peterpolidoro.net/video/NESUSB.htm\r
  *  - MakeTV Episode Dispenser: http://www.youtube.com/watch?v=BkWUi18hl3g\r
  *  - Opendous-JTAG, an open source JTAG device: http://code.google.com/p/opendous-jtag/\r