Fix accidental struct copies on the stack in the old RNDISEthernet demo TCP code.
[pub/USBasp.git] / Demos / Host / ClassDriver / KeyboardHostWithParser / KeyboardHostWithParser.c
index 273cdde..6ef1820 100644 (file)
@@ -1,13 +1,13 @@
 /*
              LUFA Library
-     Copyright (C) Dean Camera, 2011.
+     Copyright (C) Dean Camera, 2012.
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
-  Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com)
+  Copyright 2012  Dean Camera (dean [at] fourwalledcubicle [dot] com)
 
   Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
@@ -47,14 +47,17 @@ USB_ClassInfo_HID_Host_t Keyboard_HID_Interface =
        {
                .Config =
                        {
-                               .DataINPipeNumber       = 1,
-                               .DataINPipeDoubleBank   = false,
-
-                               .DataOUTPipeNumber      = 2,
-                               .DataOUTPipeDoubleBank  = false,
-
+                               .DataINPipe             =
+                                       {
+                                               .Address        = (PIPE_DIR_IN  | 1),
+                                               .Banks          = 1,
+                                       },
+                               .DataOUTPipe            =
+                                       {
+                                               .Address        = (PIPE_DIR_OUT | 2),
+                                               .Banks          = 1,
+                                       },
                                .HIDInterfaceProtocol   = HID_CSCP_NonBootProtocol,
-
                                .HIDParserData          = &HIDReportInfo
                        },
        };
@@ -107,7 +110,7 @@ void KeyboardHost_Task(void)
 {
        if (USB_HostState != HOST_STATE_Configured)
          return;
-       
+
        if (HID_Host_IsReportReceived(&Keyboard_HID_Interface))
        {
                uint8_t KeyboardReport[Keyboard_HID_Interface.State.LargestReportSize];
@@ -228,6 +231,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
        {
                puts_P(PSTR("Error Setting Report Protocol Mode or Not a Valid Keyboard.\r\n"));
                LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
+               USB_Host_SetDeviceConfiguration(0);
                return;
        }