diff options
| author | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2009-08-26 08:20:55 +0000 |
|---|---|---|
| committer | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2009-08-26 08:20:55 +0000 |
| commit | 53f4cd87c56f3f9e3274ce6c302eddf90c15ad8a (patch) | |
| tree | 774fb6a1eb6edcbeb20fea8b09136ecfebe0363d /Demos | |
| parent | 1ae15e8e905c6156a69008e7ebd488326e7c9fa8 (diff) | |
Added MS_Host_TestUnitReady() and MS_Host_ReadDeviceCapacity() to the host mode Mass Storage Class driver.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@777 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'Demos')
| -rw-r--r-- | Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c index d9fe47d3..57aba459 100644 --- a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c +++ b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c @@ -150,11 +150,16 @@ int main(void) printf("Vendor \"%.8s\", Product \"%.16s\"\r\n", InquiryData.VendorID, InquiryData.ProductID);
printf("Waiting until ready...\r\n");
- bool DeviceReady;
- do
+ for (;;)
{
- if (MS_Host_TestUnitReady(&FlashDisk_MS_Interface, 0, &DeviceReady))
+ uint8_t ErrorCode = MS_Host_TestUnitReady(&FlashDisk_MS_Interface, 0);
+
+ if (!(ErrorCode))
+ break;
+
+ /* Check if an error other than a logical command error (device busy) received */
+ if (ErrorCode != MS_ERROR_LOGICAL_CMD_FAILED)
{
printf("Error waiting for device to be ready.\r\n");
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
@@ -162,7 +167,6 @@ int main(void) break;
}
}
- while (!(DeviceReady));
printf("Retrieving Capacity... ");
|
