projects
/
pub
/
USBasp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
eb060db
)
Fixed USB_GetHIDReportItemInfo() function modifying the given report item's data...
author
Dean Camera
<dean@fourwalledcubicle.com>
Tue, 10 Aug 2010 12:13:07 +0000
(12:13 +0000)
committer
Dean Camera
<dean@fourwalledcubicle.com>
Tue, 10 Aug 2010 12:13:07 +0000
(12:13 +0000)
LUFA/Drivers/USB/Class/Host/HIDParser.c
patch
|
blob
|
blame
|
history
LUFA/Drivers/USB/Class/Host/HIDParser.h
patch
|
blob
|
blame
|
history
LUFA/ManPages/ChangeLog.txt
patch
|
blob
|
blame
|
history
diff --git
a/LUFA/Drivers/USB/Class/Host/HIDParser.c
b/LUFA/Drivers/USB/Class/Host/HIDParser.c
index
1492112
..
49f9452
100644
(file)
--- a/
LUFA/Drivers/USB/Class/Host/HIDParser.c
+++ b/
LUFA/Drivers/USB/Class/Host/HIDParser.c
@@
-276,7
+276,7
@@
uint8_t USB_ProcessHIDReport(const uint8_t* ReportData,
{
UsageMinMax.Minimum = 0;
UsageMinMax.Maximum = 0;
{
UsageMinMax.Minimum = 0;
UsageMinMax.Maximum = 0;
- UsageListSize = 0;
+ UsageListSize
= 0;
}
}
}
}
@@
-292,9
+292,6
@@
bool USB_GetHIDReportItemInfo(const uint8_t* ReportData,
uint16_t DataBitsRem = ReportItem->Attributes.BitSize;
uint16_t CurrentBit = ReportItem->BitOffset;
uint32_t BitMask = (1 << 0);
uint16_t DataBitsRem = ReportItem->Attributes.BitSize;
uint16_t CurrentBit = ReportItem->BitOffset;
uint32_t BitMask = (1 << 0);
-
- ReportItem->PreviousValue = ReportItem->Value;
- ReportItem->Value = 0;
if (ReportItem->ReportID)
{
if (ReportItem->ReportID)
{
@@
-304,6
+301,9
@@
bool USB_GetHIDReportItemInfo(const uint8_t* ReportData,
ReportData++;
}
ReportData++;
}
+ ReportItem->PreviousValue = ReportItem->Value;
+ ReportItem->Value = 0;
+
while (DataBitsRem--)
{
if (ReportData[CurrentBit / 8] & (1 << (CurrentBit % 8)))
while (DataBitsRem--)
{
if (ReportData[CurrentBit / 8] & (1 << (CurrentBit % 8)))
diff --git
a/LUFA/Drivers/USB/Class/Host/HIDParser.h
b/LUFA/Drivers/USB/Class/Host/HIDParser.h
index
5f8fa37
..
f772fed
100644
(file)
--- a/
LUFA/Drivers/USB/Class/Host/HIDParser.h
+++ b/
LUFA/Drivers/USB/Class/Host/HIDParser.h
@@
-285,8
+285,10
@@
/** Extracts the given report item's value out of the given HID report and places it into the Value
* member of the report item's \ref HID_ReportItem_t structure.
*
/** Extracts the given report item's value out of the given HID report and places it into the Value
* member of the report item's \ref HID_ReportItem_t structure.
*
- * When called, this copies the report item's Value element to it's PreviousValue element for easy
- * checking to see if an item's value has changed before processing a report.
+ * When called on a report with an item that exists in that report, this copies the report item's Value
+ * to it's PreviousValue element for easy checking to see if an item's value has changed before processing
+ * a report. If the given item does not exist in the report, the function does not modify the report item's
+ * data.
*
* \param[in] ReportData Buffer containing an IN or FEATURE report from an attached device.
* \param[in,out] ReportItem Pointer to the report item of interest in a \ref HID_ReportInfo_t ReportItem array.
*
* \param[in] ReportData Buffer containing an IN or FEATURE report from an attached device.
* \param[in,out] ReportItem Pointer to the report item of interest in a \ref HID_ReportInfo_t ReportItem array.
diff --git
a/LUFA/ManPages/ChangeLog.txt
b/LUFA/ManPages/ChangeLog.txt
index
bdbfd4a
..
999959f
100644
(file)
--- a/
LUFA/ManPages/ChangeLog.txt
+++ b/
LUFA/ManPages/ChangeLog.txt
@@
-13,6
+13,10
@@
* with basic code
* - Changed over all device demos to use a clearer algorithm for the configuring of the application's endpoints
*
* with basic code
* - Changed over all device demos to use a clearer algorithm for the configuring of the application's endpoints
*
+ * <b>Fixed:</b>
+ * - Fixed USB_GetHIDReportItemInfo() function modifying the given report item's data when the report item does not exist
+ * within the supplied report of a multiple report HID device
+ *
* \section Sec_ChangeLog100807 Version 100807
* <b>New:</b>
* - Added new ADC_DisableChannel() function (thanks to Mich Davis)
* \section Sec_ChangeLog100807 Version 100807
* <b>New:</b>
* - Added new ADC_DisableChannel() function (thanks to Mich Davis)