aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-02-09 12:30:51 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-02-09 12:30:51 +0000
commit35a0fe93848cc6e1a79d2e606a2e3f6a84ba5755 (patch)
tree66d7ecb248071bca4f6159d783ba0970bf37caa1 /LUFA
parent3ab0b3a027db2549bc024780d7787061705056f6 (diff)
downloadlufa-35a0fe93848cc6e1a79d2e606a2e3f6a84ba5755.tar.gz
lufa-35a0fe93848cc6e1a79d2e606a2e3f6a84ba5755.tar.bz2
lufa-35a0fe93848cc6e1a79d2e606a2e3f6a84ba5755.zip
Fixed USB_GetHIDReportSize() returning the number of bits in the specified report instead of bytes.
Moved the USB_GetHIDReportItemInfo() calls into the main report item passing loop in the *HostWithParser demos - it is fast enough not to effect performance, and avoids duplicate code. Make Webserver project report the LUFA version as part of the HTTP header.
Diffstat (limited to 'LUFA')
-rw-r--r--LUFA/Drivers/USB/Class/Host/HIDParser.c4
-rw-r--r--LUFA/Drivers/USB/Class/Host/HIDParser.h2
-rw-r--r--LUFA/ManPages/ChangeLog.txt1
-rw-r--r--LUFA/ManPages/LUFAPoweredProjects.txt1
4 files changed, 6 insertions, 2 deletions
diff --git a/LUFA/Drivers/USB/Class/Host/HIDParser.c b/LUFA/Drivers/USB/Class/Host/HIDParser.c
index 3ef9c7812..6c81ae8e5 100644
--- a/LUFA/Drivers/USB/Class/Host/HIDParser.c
+++ b/LUFA/Drivers/USB/Class/Host/HIDParser.c
@@ -340,8 +340,10 @@ uint16_t USB_GetHIDReportSize(HID_ReportInfo_t* const ParserData, const uint8_t
{
for (uint8_t i = 0; i < HID_MAX_REPORT_IDS; i++)
{
+ uint16_t ReportSizeBits = ParserData->ReportIDSizes[i].ReportSizeBits[ReportType];
+
if (ParserData->ReportIDSizes[i].ReportID == ReportID)
- return ParserData->ReportIDSizes[i].ReportSizeBits[ReportType];
+ return ((ReportSizeBits >> 3) + ((ReportSizeBits & 0x07) ? 1 : 0));
}
return 0;
diff --git a/LUFA/Drivers/USB/Class/Host/HIDParser.h b/LUFA/Drivers/USB/Class/Host/HIDParser.h
index 53601ec61..b7225f332 100644
--- a/LUFA/Drivers/USB/Class/Host/HIDParser.h
+++ b/LUFA/Drivers/USB/Class/Host/HIDParser.h
@@ -215,7 +215,7 @@
typedef struct
{
uint8_t ReportID; /** Report ID of the report within the HID interface */
- uint8_t ReportSizeBits[3]; /** Total number of bits in each report type for the given Report ID,
+ uint16_t ReportSizeBits[3]; /** Total number of bits in each report type for the given Report ID,
* indexed by the \ref HID_ReportItemTypes_t enum
*/
} HID_ReportSizeInfo_t;
diff --git a/LUFA/ManPages/ChangeLog.txt b/LUFA/ManPages/ChangeLog.txt
index 9f9157de5..1b5ede67b 100644
--- a/LUFA/ManPages/ChangeLog.txt
+++ b/LUFA/ManPages/ChangeLog.txt
@@ -57,6 +57,7 @@
* - Fixed incorrect values of USB_CONFIG_ATTR_SELFPOWERED and USB_CONFIG_ATTR_REMOTEWAKEUP tokens (thanks to Claus Christensen)
* - Fixed SerialStream driver blocking while waiting for characters to be received instead of returning EOF
* - Fixed SerialStream driver not setting stdin to the created serial stream
+ * - Fixed USB_GetHIDReportSize() returning the number of bits in the specified report instead of bytes
*
* \section Sec_ChangeLog091223 Version 091223
*
diff --git a/LUFA/ManPages/LUFAPoweredProjects.txt b/LUFA/ManPages/LUFAPoweredProjects.txt
index e7561e603..bf61e9d4b 100644
--- a/LUFA/ManPages/LUFAPoweredProjects.txt
+++ b/LUFA/ManPages/LUFAPoweredProjects.txt
@@ -36,6 +36,7 @@
* - AVR USB Modem, a 3G Wireless Modem host: http://code.google.com/p/avrusbmodem/
* - Bicycle POV: http://www.code.google.com/p/bicycleledpov/
* - CAMTRIG, a remote Camera Trigger device: http://code.astraw.com/projects/motmot/camtrig
+ * - CD Driver Emulator Dongle for ISO Files: http://cdemu.blogspot.com/
* - ClockTamer, a configurable clock generator: http://code.google.com/p/clock-tamer/
* - "Fingerlicking Wingdinger" (WARNING: Bad Language if no Javascript), a MIDI controller: http://noisybox.net/electronics/wingdinger/
* - Garmin GPS USB to NMEA standard serial sentence translator: http://github.com/nall/garmin-transmogrifier/tree/master