diff options
| author | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2009-11-24 14:10:28 +0000 |
|---|---|---|
| committer | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2009-11-24 14:10:28 +0000 |
| commit | be7e7eafe3e212f51ab1aa2f77e5a7eec02112e4 (patch) | |
| tree | be584b0f1df4272db2d20da3fbd86e736b6ddade /Projects/Incomplete/StandaloneProgrammer/DiskHost.c | |
| parent | 5250050f502f7f78bd13283e128976564c24b0de (diff) | |
Make the StandaloneProgrammer project seamlessly read out drive contents from either an attached FAT formatted drive when in host mode, or the onboard FAT formatted dataflash when in device mode.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@915 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'Projects/Incomplete/StandaloneProgrammer/DiskHost.c')
| -rw-r--r-- | Projects/Incomplete/StandaloneProgrammer/DiskHost.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/Projects/Incomplete/StandaloneProgrammer/DiskHost.c b/Projects/Incomplete/StandaloneProgrammer/DiskHost.c index c5541417..8e518209 100644 --- a/Projects/Incomplete/StandaloneProgrammer/DiskHost.c +++ b/Projects/Incomplete/StandaloneProgrammer/DiskHost.c @@ -59,16 +59,14 @@ void DiskHost_USBTask(void) if (USB_Host_GetDeviceConfigDescriptor(1, &ConfigDescriptorSize, ConfigDescriptorData,
sizeof(ConfigDescriptorData)) != HOST_GETCONFIG_Successful)
{
- printf("ERROR - GetConfig\r\n");
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
return;
}
if (MS_Host_ConfigurePipes(&DiskHost_MS_Interface,
- ConfigDescriptorSize, ConfigDescriptorData) != MS_ENUMERROR_NoError)
+ ConfigDescriptorSize, ConfigDescriptorData) != MS_ENUMERROR_NoError)
{
- printf("ERROR - Pipes\r\n");
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
return;
@@ -76,16 +74,16 @@ void DiskHost_USBTask(void) if (USB_Host_SetDeviceConfiguration(1) != HOST_SENDCONTROL_Successful)
{
- printf("ERROR - SetConfig\r\n");
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
return;
}
-
+
+ USB_HostState = HOST_STATE_Configured;
+
uint8_t MaxLUNIndex;
if (MS_Host_GetMaxLUN(&DiskHost_MS_Interface, &MaxLUNIndex))
{
- printf("ERROR - MaxLUN\r\n");
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
return;
@@ -93,7 +91,6 @@ void DiskHost_USBTask(void) if (MS_Host_ResetMSInterface(&DiskHost_MS_Interface))
{
- printf("ERROR - ResetMS\r\n");
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
return;
@@ -102,7 +99,6 @@ void DiskHost_USBTask(void) SCSI_Request_Sense_Response_t SenseData;
if (MS_Host_RequestSense(&DiskHost_MS_Interface, 0, &SenseData) != 0)
{
- printf("ERROR - Sense\r\n");
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
return;
@@ -111,7 +107,6 @@ void DiskHost_USBTask(void) pf_mount(&DiskFATState);
LEDs_SetAllLEDs(LEDMASK_USB_READY);
- USB_HostState = HOST_STATE_Configured;
}
MS_Host_USBTask(&DiskHost_MS_Interface);
|
