Changeset 154 for uKadecot/trunk/pfatfs/diskio.c
- Timestamp:
- Feb 2, 2016, 9:54:35 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uKadecot/trunk/pfatfs/diskio.c
r108 r154 21 21 #define RamDisk ((unsigned char *)0xfff00000) 22 22 #else 23 #include <windows.h>24 #include <tchar.h>25 #include <winioctl.h>26 27 23 unsigned char RamDisk[SZ_RAMDISK * 1024]; 24 extern void win_disk_initialize(void *ramDisk, int size); 28 25 #endif 29 26 … … 34 31 DWORD wip; 35 32 DWORD n_sectors; 36 } STAT;33 } RD_STAT; 37 34 38 35 static volatile 39 STAT Stat[MAX_DRIVES];36 RD_STAT Stat[MAX_DRIVES]; 40 37 41 38 static … … 43 40 44 41 static 45 int get_status(volatile STAT *stat) {42 int get_status(volatile RD_STAT *stat) { 46 43 stat->sz_sector = SS_RAMDISK; 47 44 if(stat->sz_sector < _MIN_SS || stat->sz_sector > _MAX_SS) return 0; … … 54 51 /* Initialize Disk Drive */ 55 52 /*-----------------------------------------------------------------------*/ 56 DSTATUS disk_initialize (void)53 DSTATUS ramdisk_initialize (void) 57 54 { 58 55 DSTATUS sta; 59 56 #ifdef _MSC_VER 60 HANDLE h; 61 DWORD br; 62 63 h = CreateFile(_T("..\\..\\..\\..\\uip\\apps\\webserver\\httpd-fs.bin"), GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0); 64 if (h != INVALID_HANDLE_VALUE) { 65 ReadFile(h, RamDisk, sizeof(RamDisk), &br, 0); 66 CloseHandle(h); 67 } 57 win_disk_initialize(RamDisk, sizeof(RamDisk)); 68 58 #endif 69 59 get_status(&Stat[0]); … … 77 67 /* Get Disk Status */ 78 68 /*-----------------------------------------------------------------------*/ 79 DSTATUS disk_get_status (void)69 DSTATUS ramdisk_get_status (void) 80 70 { 81 71 return Stat[0].status; … … 85 75 /* Read Partial Sector */ 86 76 /*-----------------------------------------------------------------------*/ 87 DRESULT disk_readp (77 DRESULT ramdisk_readp ( 88 78 BYTE* buff, /* Data read buffer */ 89 79 DWORD sector, /* Sector number (LBA) */ … … 118 108 /* Write Partial Sector */ 119 109 /*-----------------------------------------------------------------------*/ 120 DRESULT disk_writep (110 DRESULT ramdisk_writep ( 121 111 const BYTE* buff, /* Pointer to the write data */ 122 112 DWORD sc /* Sector number (LBA), Number of bytes to send */
Note:
See TracChangeset
for help on using the changeset viewer.