diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2010-05-08 03:12:14 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2010-05-08 03:12:14 +0000 |
commit | 071e02c6b6b4837fa9cf0b6d4c749994e02638d7 (patch) | |
tree | 960446788703b69f0bb285450be80c5b3d8cc22c /Projects/Incomplete/StandaloneProgrammer/Lib/PetiteFATFs/diskio.c | |
parent | e331b531c6e6d93eb0eee42b9002074e8090ad18 (diff) | |
download | lufa-071e02c6b6b4837fa9cf0b6d4c749994e02638d7.tar.gz lufa-071e02c6b6b4837fa9cf0b6d4c749994e02638d7.tar.bz2 lufa-071e02c6b6b4837fa9cf0b6d4c749994e02638d7.zip |
Add svn:eol-style property to source files, so that the line endings are correctly converted to the target system's native end of line style.
Diffstat (limited to 'Projects/Incomplete/StandaloneProgrammer/Lib/PetiteFATFs/diskio.c')
-rw-r--r-- | Projects/Incomplete/StandaloneProgrammer/Lib/PetiteFATFs/diskio.c | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/Projects/Incomplete/StandaloneProgrammer/Lib/PetiteFATFs/diskio.c b/Projects/Incomplete/StandaloneProgrammer/Lib/PetiteFATFs/diskio.c index c0393dd84..47e73159f 100644 --- a/Projects/Incomplete/StandaloneProgrammer/Lib/PetiteFATFs/diskio.c +++ b/Projects/Incomplete/StandaloneProgrammer/Lib/PetiteFATFs/diskio.c @@ -1,57 +1,57 @@ -/*-----------------------------------------------------------------------*/
-/* 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;
-}
-
+/*-----------------------------------------------------------------------*/ +/* 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; +} + |