]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - fatfs/source/diskio.c
Import fatfs R0.15
[z180-stamp.git] / fatfs / source / diskio.c
index 25f5e53bc032bd3fcdacd3c53582e63e73ae8dcc..81aaf59ad6802d2b19ddf525e015814dc45de406 100644 (file)
@@ -1,5 +1,5 @@
 /*-----------------------------------------------------------------------*/\r
-/* Low level disk I/O module skeleton for FatFs     (C)ChaN, 2016        */\r
+/* Low level disk I/O module SKELETON for FatFs     (C)ChaN, 2019        */\r
 /*-----------------------------------------------------------------------*/\r
 /* If a working storage control module is available, it should be        */\r
 /* attached to the FatFs via a glue function rather than modifying it.   */\r
@@ -7,7 +7,8 @@
 /* storage control modules to the FatFs module with a defined API.       */\r
 /*-----------------------------------------------------------------------*/\r
 \r
-#include "diskio.h"            /* FatFs lower layer API */\r
+#include "ff.h"                        /* Obtains integer types */\r
+#include "diskio.h"            /* Declarations of disk functions */\r
 \r
 /* Definitions of physical drive number for each drive */\r
 #define DEV_RAM                0       /* Example: Map Ramdisk to physical drive 0 */\r
@@ -98,7 +99,7 @@ DSTATUS disk_initialize (
 DRESULT disk_read (\r
        BYTE pdrv,              /* Physical drive nmuber to identify the drive */\r
        BYTE *buff,             /* Data buffer to store read data */\r
-       DWORD sector,   /* Start sector in LBA */\r
+       LBA_t sector,   /* Start sector in LBA */\r
        UINT count              /* Number of sectors to read */\r
 )\r
 {\r
@@ -143,10 +144,12 @@ DRESULT disk_read (
 /* Write Sector(s)                                                       */\r
 /*-----------------------------------------------------------------------*/\r
 \r
+#if FF_FS_READONLY == 0\r
+\r
 DRESULT disk_write (\r
        BYTE pdrv,                      /* Physical drive nmuber to identify the drive */\r
        const BYTE *buff,       /* Data to be written */\r
-       DWORD sector,           /* Start sector in LBA */\r
+       LBA_t sector,           /* Start sector in LBA */\r
        UINT count                      /* Number of sectors to write */\r
 )\r
 {\r
@@ -185,6 +188,7 @@ DRESULT disk_write (
        return RES_PARERR;\r
 }\r
 \r
+#endif\r
 \r
 \r
 /*-----------------------------------------------------------------------*/\r