X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/8711dc7ced0ed02a33a96222d86bd27f65c239ed..f69f03cb0d02937dee018264f0ac4e9be76fc1f4:/Demos/Host/ClassDriver/CDCHost/CDCHost.c?ds=inline diff --git a/Demos/Host/ClassDriver/CDCHost/CDCHost.c b/Demos/Host/ClassDriver/CDCHost/CDCHost.c index 7aa8deeee..4b08f7d57 100644 --- a/Demos/Host/ClassDriver/CDCHost/CDCHost.c +++ b/Demos/Host/ClassDriver/CDCHost/CDCHost.c @@ -44,15 +44,19 @@ USB_ClassInfo_CDC_Host_t VirtualSerial_CDC_Interface = { .Config = { - .DataINPipeNumber = 1, - .DataOUTPipeNumber = 2, - .NotificationPipeNumber = 3, + .DataINPipeNumber = 1, + .DataINPipeDoubleBank = false, + + .DataOUTPipeNumber = 2, + .DataOUTPipeDoubleBank = false, + + .NotificationPipeNumber = 3, + .NotificationPipeDoubleBank = false, }, }; - /** 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) { @@ -72,9 +76,8 @@ int main(void) uint16_t ConfigDescriptorSize; uint8_t ConfigDescriptorData[512]; - if ((USB_GetDeviceConfigDescriptor(1, &ConfigDescriptorSize, NULL) != HOST_SENDCONTROL_Successful) || - (ConfigDescriptorSize > sizeof(ConfigDescriptorData)) || - (USB_GetDeviceConfigDescriptor(1, &ConfigDescriptorSize, ConfigDescriptorData))) + if (USB_Host_GetDeviceConfigDescriptor(1, &ConfigDescriptorSize, ConfigDescriptorData, + sizeof(ConfigDescriptorData)) != HOST_GETCONFIG_Successful) { printf("Error Retrieving Configuration Descriptor.\r\n"); LEDs_SetAllLEDs(LEDMASK_USB_ERROR); @@ -108,6 +111,8 @@ int main(void) /* Echo received bytes from the attached device through the USART */ while (CDC_Host_BytesReceived(&VirtualSerial_CDC_Interface)) putchar(CDC_Host_ReceiveByte(&VirtualSerial_CDC_Interface)); + + CDC_Host_Flush(&VirtualSerial_CDC_Interface); } break;