if (USB_Host_GetDeviceConfigDescriptor(1, &ConfigDescriptorSize, ConfigDescriptorData,\r
sizeof(ConfigDescriptorData)) != HOST_GETCONFIG_Successful)\r
{\r
- printf("ERROR - GetConfig\r\n");\r
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
USB_HostState = HOST_STATE_WaitForDeviceRemoval;\r
return;\r
}\r
\r
if (MS_Host_ConfigurePipes(&DiskHost_MS_Interface,\r
- ConfigDescriptorSize, ConfigDescriptorData) != MS_ENUMERROR_NoError)\r
+ ConfigDescriptorSize, ConfigDescriptorData) != MS_ENUMERROR_NoError)\r
{\r
- printf("ERROR - Pipes\r\n");\r
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
USB_HostState = HOST_STATE_WaitForDeviceRemoval;\r
return;\r
\r
if (USB_Host_SetDeviceConfiguration(1) != HOST_SENDCONTROL_Successful)\r
{\r
- printf("ERROR - SetConfig\r\n");\r
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
USB_HostState = HOST_STATE_WaitForDeviceRemoval;\r
return;\r
}\r
-\r
+ \r
+ USB_HostState = HOST_STATE_Configured;\r
+ \r
uint8_t MaxLUNIndex;\r
if (MS_Host_GetMaxLUN(&DiskHost_MS_Interface, &MaxLUNIndex))\r
{\r
- printf("ERROR - MaxLUN\r\n");\r
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
USB_HostState = HOST_STATE_WaitForDeviceRemoval;\r
return;\r
\r
if (MS_Host_ResetMSInterface(&DiskHost_MS_Interface))\r
{\r
- printf("ERROR - ResetMS\r\n");\r
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
USB_HostState = HOST_STATE_WaitForDeviceRemoval;\r
return;\r
SCSI_Request_Sense_Response_t SenseData;\r
if (MS_Host_RequestSense(&DiskHost_MS_Interface, 0, &SenseData) != 0)\r
{\r
- printf("ERROR - Sense\r\n");\r
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
USB_HostState = HOST_STATE_WaitForDeviceRemoval;\r
return;\r
pf_mount(&DiskFATState);\r
\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
- USB_HostState = HOST_STATE_Configured;\r
}\r
\r
MS_Host_USBTask(&DiskHost_MS_Interface); \r
else if (MS_Host_ReadDeviceBlocks(&DiskHost_MS_Interface, 0, sector, 1, 512, BlockTemp))\r
ErrorCode = RES_ERROR;\r
\r
- printf("BLOCK READ #%lu Ret %d\r\n", sector, MS_Host_ReadDeviceBlocks(&DiskHost_MS_Interface, 0, sector, 1, 512, BlockTemp));\r
+ MS_Host_ReadDeviceBlocks(&DiskHost_MS_Interface, 0, sector, 1, 512, BlockTemp);\r
#endif\r
}\r
else\r
return (ByteWasRead ? ReadByte : _FDEV_EOF);\r
}\r
\r
+#if defined(USB_CAN_BE_BOTH)\r
+/** Event to handle mode changes in the library, to clear the FAT library's drive state structure when transitioning\r
+ * between modes. This ensures that the library always works with current disk data.\r
+ */\r
+void EVENT_USB_UIDChange(void)\r
+{\r
+ pf_mount(&DiskFATState);\r
+}\r
+#endif\r
+\r
/** Task to determine if the user is wishes to start the programming sequence, and if so executes the \r
* required functions to program the attached target (if any) with the files loaded to the dataflash.\r
*/\r