X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/9d6a373cb61b55b94312de3809ac76fcbd0a696c..05fcf7e2a79bebb978d4aeaef26b12f70c6826f8:/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c diff --git a/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c b/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c index effd16b01..ed8f723c0 100644 --- a/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c +++ b/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c @@ -45,7 +45,10 @@ USB_ClassInfo_HID_Host_t Keyboard_HID_Interface = .Config = { .DataINPipeNumber = 1, + .DataINPipeDoubleBank = false, + .DataOUTPipeNumber = 2, + .DataOUTPipeDoubleBank = false, .HIDInterfaceProtocol = HID_BOOT_KEYBOARD_PROTOCOL, }, @@ -53,7 +56,7 @@ USB_ClassInfo_HID_Host_t Keyboard_HID_Interface = /** Main program entry point. This routine configures the hardware required by the application, then - * starts the scheduler to run the application tasks. + * enters a loop to run the application tasks in sequence. */ int main(void) { @@ -73,8 +76,8 @@ int main(void) uint16_t ConfigDescriptorSize; uint8_t ConfigDescriptorData[512]; - if (USB_GetDeviceConfigDescriptor(1, &ConfigDescriptorSize, ConfigDescriptorData, - sizeof(ConfigDescriptorData)) != HOST_GETCONFIG_Successful) + if (USB_Host_GetDeviceConfigDescriptor(1, &ConfigDescriptorSize, ConfigDescriptorData, + sizeof(ConfigDescriptorData)) != HOST_GETCONFIG_Successful) { printf("Error Retrieving Configuration Descriptor.\r\n"); LEDs_SetAllLEDs(LEDMASK_USB_ERROR); @@ -99,7 +102,7 @@ int main(void) break; } - if (USB_HID_Host_SetBootProtocol(&Keyboard_HID_Interface) != 0) + if (HID_Host_SetBootProtocol(&Keyboard_HID_Interface) != 0) { printf("Could not Set Boot Protocol Mode.\r\n"); LEDs_SetAllLEDs(LEDMASK_USB_ERROR); @@ -113,10 +116,8 @@ int main(void) case HOST_STATE_Configured: if (HID_Host_IsReportReceived(&Keyboard_HID_Interface)) { - USB_KeyboardReport_Data_t KeyboardReport; - uint8_t ReportID = 0; - - HID_Host_ReceiveReport(&Keyboard_HID_Interface, false, &ReportID, &KeyboardReport); + USB_KeyboardReport_Data_t KeyboardReport; + HID_Host_ReceiveReport(&Keyboard_HID_Interface, &KeyboardReport); LEDs_ChangeLEDs(LEDS_LED1, (KeyboardReport.Modifier) ? LEDS_LED1 : 0);