Fixed LowLevel Keyboard demo not saving the issued report only after it has been...
[pub/USBasp.git] / Projects / Incomplete / StandaloneProgrammer / Lib / PetiteFATFs / diskio.c
1 /*-----------------------------------------------------------------------*/
2 /* Low level disk I/O module skeleton for Petit FatFs (C)ChaN, 2009 */
3 /*-----------------------------------------------------------------------*/
4
5 #include "diskio.h"
6
7 #include <string.h>
8 #include "../DataflashManager.h"
9
10 /*-----------------------------------------------------------------------*/
11 /* Initialize Disk Drive */
12 /*-----------------------------------------------------------------------*/
13
14 DSTATUS disk_initialize (void)
15 {
16 DSTATUS stat;
17
18 stat = RES_OK;
19
20 return stat;
21 }
22
23
24
25 /*-----------------------------------------------------------------------*/
26 /* Read Partial Sector */
27 /*-----------------------------------------------------------------------*/
28
29 DRESULT disk_readp (
30 void* dest, /* Pointer to the destination object */
31 DWORD sector, /* Sector number (LBA) */
32 WORD sofs, /* Offset in the sector */
33 WORD count /* Byte count (bit15:destination) */
34 )
35 {
36 DRESULT res;
37
38 uint8_t BlockTemp[512];
39 DataflashManager_ReadBlocks_RAM(sector, 1, BlockTemp);
40 memcpy(dest, &BlockTemp[sofs], count);
41
42 res = RES_OK;
43
44 return res;
45 }
46