Add new attributes to the HID Report Parser and HID Host Mode Class driver to keep track of the largest report the device can send for buffer allocation purposes. Change MouseHostWithParser and KeyboardHostWithParser demos to only allocate the needed number of bytes.

This commit is contained in:
Dean Camera committed 2009-09-21 12:23:09 +00:00
1 parent 3ffa7543a0
commit 242303c160
9 files changed
+41 -25

No files matched your search

@@ -120,7 +120,7 @@ int main(void)
case HOST_STATE_Configured:
if (HID_Host_IsReportReceived(&Keyboard_HID_Interface))
{
uint8_t KeyboardReport[50];
uint8_t KeyboardReport[Keyboard_HID_Interface.State.LargestReportSize];
HID_Host_ReceiveReport(&Keyboard_HID_Interface, &KeyboardReport);
for (uint8_t ReportNumber = 0; ReportNumber < HIDReportInfo.TotalReportItems; ReportNumber++)
@@ -120,7 +120,7 @@ int main(void)
case HOST_STATE_Configured:
if (HID_Host_IsReportReceived(&Mouse_HID_Interface))
{
uint8_t MouseReport[50];
uint8_t MouseReport[Keyboard_HID_Interface.State.LargestReportSize];
HID_Host_ReceiveReport(&Mouse_HID_Interface, &MouseReport);
uint8_t LEDMask = LEDS_NO_LEDS;