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.
This commit is contained in:
Dean Camera 2010-02-09 12:30:51 +00:00
parent 3ab0b3a027
commit 35a0fe9384
10 changed files with 29 additions and 45 deletions

View file

@ -132,15 +132,14 @@ int main(void)
{
HID_ReportItem_t* ReportItem = &HIDReportInfo.ReportItems[ReportNumber];
/* Update the report item value if it is contained within the current report */
if (!(USB_GetHIDReportItemInfo(JoystickReport, ReportItem)))
continue;
/* Determine what report item is being tested, process updated value as needed */
if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_BUTTON) &&
(ReportItem->ItemType == REPORT_ITEM_TYPE_In))
{
/* Get the joystick button value if it is contained within the current report, if not,
* skip to the next item in the parser list
*/
if (!(USB_GetHIDReportItemInfo(JoystickReport, ReportItem)))
continue;
if (ReportItem->Value)
LEDMask = LEDS_ALL_LEDS;
}
@ -149,12 +148,6 @@ int main(void)
(ReportItem->Attributes.Usage.Usage == USAGE_Y)) &&
(ReportItem->ItemType == REPORT_ITEM_TYPE_In))
{
/* Get the joystick relative position value if it is contained within the current
* report, if not, skip to the next item in the parser list
*/
if (!(USB_GetHIDReportItemInfo(JoystickReport, ReportItem)))
continue;
int16_t DeltaMovement = (int16_t)(ReportItem->Value << (16 - ReportItem->Attributes.BitSize));
if (ReportItem->Attributes.Usage.Usage == USAGE_X)