Fixed PrinterHost demo returning invalid Device ID data when the attached device...
authorDean Camera <dean@fourwalledcubicle.com>
Mon, 28 Sep 2009 15:56:27 +0000 (15:56 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Mon, 28 Sep 2009 15:56:27 +0000 (15:56 +0000)
Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c
LUFA/Drivers/USB/Class/Host/MassStorage.h
LUFA/ManPages/ChangeLog.txt
LUFA/ManPages/FutureChanges.txt
LUFA/ManPages/MigrationInformation.txt

index 7ed8898..c75b7f9 100644 (file)
@@ -77,7 +77,7 @@ uint8_t Printer_SendData(void* PrinterCommands, uint16_t CommandSize)
 uint8_t Printer_GetDeviceID(char* DeviceIDString, uint16_t BufferSize)\r
 {\r
        uint8_t  ErrorCode = HOST_SENDCONTROL_Successful;\r
 uint8_t Printer_GetDeviceID(char* DeviceIDString, uint16_t BufferSize)\r
 {\r
        uint8_t  ErrorCode = HOST_SENDCONTROL_Successful;\r
-       uint16_t DeviceIDStringLength;\r
+       uint16_t DeviceIDStringLength = 0;\r
 \r
        USB_ControlRequest = (USB_Request_Header_t)\r
                {\r
 \r
        USB_ControlRequest = (USB_Request_Header_t)\r
                {\r
@@ -92,6 +92,12 @@ uint8_t Printer_GetDeviceID(char* DeviceIDString, uint16_t BufferSize)
 \r
        if ((ErrorCode = USB_Host_SendControlRequest(&DeviceIDStringLength)) != HOST_SENDCONTROL_Successful)\r
          return ErrorCode;\r
 \r
        if ((ErrorCode = USB_Host_SendControlRequest(&DeviceIDStringLength)) != HOST_SENDCONTROL_Successful)\r
          return ErrorCode;\r
+         \r
+       if (!(DeviceIDStringLength))\r
+       {\r
+               DeviceIDString[0] = 0x00;\r
+               return HOST_SENDCONTROL_Successful;\r
+       }\r
        \r
        DeviceIDStringLength = SwapEndian_16(DeviceIDStringLength);\r
 \r
        \r
        DeviceIDStringLength = SwapEndian_16(DeviceIDStringLength);\r
 \r
index a65a352..8abe573 100644 (file)
@@ -97,7 +97,7 @@
                         */\r
                        typedef struct\r
                        {\r
                         */\r
                        typedef struct\r
                        {\r
-                               uint8_t       ReponseCode;\r
+                               uint8_t       ResponseCode;\r
 \r
                                uint8_t       SegmentNumber;\r
                                \r
 \r
                                uint8_t       SegmentNumber;\r
                                \r
index 18b6090..9ef7302 100644 (file)
@@ -9,6 +9,16 @@
   *  \section Sec_ChangeLogXXXXXX Version XXXXXX\r
   *\r
   *  <b>New:</b>\r
   *  \section Sec_ChangeLogXXXXXX Version XXXXXX\r
   *\r
   *  <b>New:</b>\r
+  *\r
+  *  <b>Changed:</b>\r
+  *\r
+  *  <b>Fixed:</b>\r
+  *  - Fixed PrinterHost demo returning invalid Device ID data when the attached device does not have a\r
+  *    device ID (thanks to Andrei Krainev)\r
+  *\r
+  *  \section Sec_ChangeLog090924 Version 090924\r
+  *\r
+  *  <b>New:</b>\r
   *  - Added new host mode class drivers and matching demos to the library for rapid application development\r
   *  - Added flag to the HID report parser to indicate if a device has multiple reports\r
   *  - Added new EVENT_USB_Device_StartOfFrame() event, controlled by the new USB_Device_EnableSOFEvents() and\r
   *  - Added new host mode class drivers and matching demos to the library for rapid application development\r
   *  - Added flag to the HID report parser to indicate if a device has multiple reports\r
   *  - Added new EVENT_USB_Device_StartOfFrame() event, controlled by the new USB_Device_EnableSOFEvents() and\r
index c5f6fe2..6024a3a 100644 (file)
   *  or post your suggestion as an enhancement request to the project bug tracker.\r
   *\r
   *  <b>Targeted for This Release (SVN Development Only):</b>\r
   *  or post your suggestion as an enhancement request to the project bug tracker.\r
   *\r
   *  <b>Targeted for This Release (SVN Development Only):</b>\r
-  *  - N/A\r
+  *  - Add hub support to match Atmel's stack\r
+  *  - Add ability to get number of bytes not written with pipe/endpoint write routines after an error\r
   *\r
   *  <b>Targeted for Future Releases:</b>\r
   *\r
   *  <b>Targeted for Future Releases:</b>\r
-  *  - Add hub support to match Atmel's stack\r
   *  - Add standardized descriptor names to device and host class driver structures\r
   *  - Remake AVRStudio project files\r
   *  - Add detailed overviews of how each demo works\r
   *  - Add standardized descriptor names to device and host class driver structures\r
   *  - Remake AVRStudio project files\r
   *  - Add detailed overviews of how each demo works\r
index 0070a34..081bd96 100644 (file)
@@ -12,6 +12,8 @@
  *\r
  * \section Sec_MigrationXXXXXX Migrating from 090810 to XXXXXX\r
  *\r
  *\r
  * \section Sec_MigrationXXXXXX Migrating from 090810 to XXXXXX\r
  *\r
+ * \section Sec_Migration090924 Migrating from 090810 to 090924\r
+ *\r
  *  <b>Non-USB Library Components</b>\r
  *    - The ADC_Off() function has been renamed to \ref ADC_ShutDown() to be consistent with the rest of the library.\r
  *    - The \ref SPI_Init() routine's parameters have changed, so that the clock polarity and data sampling modes can be set. See\r
  *  <b>Non-USB Library Components</b>\r
  *    - The ADC_Off() function has been renamed to \ref ADC_ShutDown() to be consistent with the rest of the library.\r
  *    - The \ref SPI_Init() routine's parameters have changed, so that the clock polarity and data sampling modes can be set. See\r