diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-09-21 12:23:09 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-09-21 12:23:09 +0000 |
commit | 242303c1607fca405d9407b9fab6fb78cae676e2 (patch) | |
tree | 1163c20f5035ee4df711d1c718ef310ba89d2b53 /Demos/Host/ClassDriver | |
parent | 3ffa7543a05761a0c69144c9b66196b08d8f1249 (diff) | |
download | lufa-242303c1607fca405d9407b9fab6fb78cae676e2.tar.gz lufa-242303c1607fca405d9407b9fab6fb78cae676e2.tar.bz2 lufa-242303c1607fca405d9407b9fab6fb78cae676e2.zip |
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.
Diffstat (limited to 'Demos/Host/ClassDriver')
-rw-r--r-- | Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c | 2 | ||||
-rw-r--r-- | Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c index d87c0e72c..d89807461 100644 --- a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c +++ b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c @@ -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++)
diff --git a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c index 8133c8743..c33b2ebde 100644 --- a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c +++ b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c @@ -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;
|