From 5630b9308323c3f3aaa09be8fe0f3aecaa826473 Mon Sep 17 00:00:00 2001 From: Leo C. Date: Sun, 30 Jun 2024 09:37:28 +0200 Subject: Import fatfs R0.15 --- fatfs/source/diskio.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'fatfs/source/diskio.c') diff --git a/fatfs/source/diskio.c b/fatfs/source/diskio.c index 25f5e53..81aaf59 100644 --- a/fatfs/source/diskio.c +++ b/fatfs/source/diskio.c @@ -1,5 +1,5 @@ /*-----------------------------------------------------------------------*/ -/* Low level disk I/O module skeleton for FatFs (C)ChaN, 2016 */ +/* Low level disk I/O module SKELETON for FatFs (C)ChaN, 2019 */ /*-----------------------------------------------------------------------*/ /* If a working storage control module is available, it should be */ /* attached to the FatFs via a glue function rather than modifying it. */ @@ -7,7 +7,8 @@ /* storage control modules to the FatFs module with a defined API. */ /*-----------------------------------------------------------------------*/ -#include "diskio.h" /* FatFs lower layer API */ +#include "ff.h" /* Obtains integer types */ +#include "diskio.h" /* Declarations of disk functions */ /* Definitions of physical drive number for each drive */ #define DEV_RAM 0 /* Example: Map Ramdisk to physical drive 0 */ @@ -98,7 +99,7 @@ DSTATUS disk_initialize ( DRESULT disk_read ( BYTE pdrv, /* Physical drive nmuber to identify the drive */ BYTE *buff, /* Data buffer to store read data */ - DWORD sector, /* Start sector in LBA */ + LBA_t sector, /* Start sector in LBA */ UINT count /* Number of sectors to read */ ) { @@ -143,10 +144,12 @@ DRESULT disk_read ( /* Write Sector(s) */ /*-----------------------------------------------------------------------*/ +#if FF_FS_READONLY == 0 + DRESULT disk_write ( BYTE pdrv, /* Physical drive nmuber to identify the drive */ const BYTE *buff, /* Data to be written */ - DWORD sector, /* Start sector in LBA */ + LBA_t sector, /* Start sector in LBA */ UINT count /* Number of sectors to write */ ) { @@ -185,6 +188,7 @@ DRESULT disk_write ( return RES_PARERR; } +#endif /*-----------------------------------------------------------------------*/ -- cgit v1.2.3