-/*-----------------------------------------------------------------------*/\r
-/* Low level disk I/O module skeleton for Petit FatFs (C)ChaN, 2009 */\r
-/*-----------------------------------------------------------------------*/\r
-\r
-#include "diskio.h"\r
-\r
-#include <string.h>\r
-#include <LUFA/Drivers/USB/Class/MassStorage.h>\r
-#include "../DataflashManager.h"\r
-#include "../../DiskHost.h"\r
-\r
-/*-----------------------------------------------------------------------*/\r
-/* Initialize Disk Drive */\r
-/*-----------------------------------------------------------------------*/\r
-\r
-DSTATUS disk_initialize (void)\r
-{\r
- return RES_OK;\r
-}\r
-\r
-\r
-\r
-/*-----------------------------------------------------------------------*/\r
-/* Read Partial Sector */\r
-/*-----------------------------------------------------------------------*/\r
-\r
-DRESULT disk_readp (\r
- void* dest, /* Pointer to the destination object */\r
- DWORD sector, /* Sector number (LBA) */\r
- WORD sofs, /* Offset in the sector */\r
- WORD count /* Byte count (bit15:destination) */\r
-)\r
-{\r
- DRESULT ErrorCode = RES_OK;\r
- uint8_t BlockTemp[512];\r
-\r
- if (USB_CurrentMode == USB_MODE_HOST)\r
- {\r
- #if defined(USB_CAN_BE_HOST)\r
- if (USB_HostState != HOST_STATE_Configured)\r
- ErrorCode = RES_NOTRDY;\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
- #endif\r
- }\r
- else\r
- {\r
- #if defined(USB_CAN_BE_DEVICE)\r
- DataflashManager_ReadBlocks_RAM(sector, 1, BlockTemp);\r
- #endif\r
- }\r
-\r
- memcpy(dest, &BlockTemp[sofs], count);\r
-\r
- return ErrorCode;\r
-}\r
-\r
+/*-----------------------------------------------------------------------*/
+/* Low level disk I/O module skeleton for Petit FatFs (C)ChaN, 2010 */
+/*-----------------------------------------------------------------------*/
+
+#include "diskio.h"
+
+#include <string.h>
+#include <LUFA/Drivers/USB/Class/MassStorage.h>
+#include "../DataflashManager.h"
+#include "../../DiskHost.h"
+
+/*-----------------------------------------------------------------------*/
+/* Initialize Disk Drive */
+/*-----------------------------------------------------------------------*/
+
+DSTATUS disk_initialize (void)
+{
+ return RES_OK;
+}
+
+
+
+/*-----------------------------------------------------------------------*/
+/* Read Partial Sector */
+/*-----------------------------------------------------------------------*/
+
+DRESULT disk_readp (
+ void* dest, /* Pointer to the destination object */
+ DWORD sector, /* Sector number (LBA) */
+ WORD sofs, /* Offset in the sector */
+ WORD count /* Byte count (bit15:destination) */
+)
+{
+ DRESULT ErrorCode = RES_OK;
+ uint8_t BlockTemp[512];
+
+ if (USB_CurrentMode == USB_MODE_Host)
+ {
+ #if defined(USB_CAN_BE_HOST)
+ if (USB_HostState != HOST_STATE_Configured)
+ ErrorCode = RES_NOTRDY;
+ else if (MS_Host_ReadDeviceBlocks(&DiskHost_MS_Interface, 0, sector, 1, 512, BlockTemp))
+ ErrorCode = RES_ERROR;
+ #endif
+ }
+ else
+ {
+ #if defined(USB_CAN_BE_DEVICE)
+ DataflashManager_ReadBlocks_RAM(sector, 1, BlockTemp);
+ #endif
+ }
+
+ memcpy(dest, &BlockTemp[sofs], count);
+
+ return ErrorCode;
+}
+