X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/754ea083d4c828318ffc621e00d2053acb842e20..bb3879331211a19c3adc3927cac870cc7e36b775:/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c diff --git a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c index 01553354d..cdce70071 100644 --- a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c +++ b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c @@ -45,13 +45,16 @@ USB_ClassInfo_MS_Host_t FlashDisk_MS_Interface = .Config = { .DataINPipeNumber = 1, + .DataINPipeDoubleBank = false, + .DataOUTPipeNumber = 2, + .DataOUTPipeDoubleBank = 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) { @@ -71,9 +74,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); @@ -82,9 +84,9 @@ int main(void) } if (MS_Host_ConfigurePipes(&FlashDisk_MS_Interface, - ConfigDescriptorSize, ConfigDescriptorData) != MS_ENUMERROR_NoError) + ConfigDescriptorSize, ConfigDescriptorData) != MS_ENUMERROR_NoError) { - printf("Attached Device Not a Valid Mouse.\r\n"); + printf("Attached Device Not a Valid Mass Storage Device.\r\n"); LEDs_SetAllLEDs(LEDMASK_USB_ERROR); USB_HostState = HOST_STATE_WaitForDeviceRemoval; break; @@ -113,6 +115,8 @@ int main(void) break; } + printf("Total LUNs: %d - Using first LUN in device.\r\n", (MaxLUNIndex + 1)); + if (MS_Host_ResetMSInterface(&FlashDisk_MS_Interface)) { printf("Error resetting Mass Storage interface.\r\n"); @@ -141,7 +145,7 @@ int main(void) SCSI_Inquiry_Response_t InquiryData; if (MS_Host_GetInquiryData(&FlashDisk_MS_Interface, 0, &InquiryData)) { - printf("Error retreiving device Inquiry data.\r\n"); + printf("Error retrieving device Inquiry data.\r\n"); LEDs_SetAllLEDs(LEDMASK_USB_ERROR); USB_HostState = HOST_STATE_WaitForDeviceRemoval; break;