From eef742bf45f504cf23523fea4f20e61774407646 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 28 Feb 2020 10:04:06 -0600 Subject: [PATCH] oofatfs: Remove _FS_DISK_READ_ALIGNED This workaround is no longer needed, so it can be removed. Closes: #2332 --- lib/oofatfs/ff.c | 6 +----- lib/oofatfs/ffconf.h | 6 ------ ports/nrf/Makefile | 1 - 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/lib/oofatfs/ff.c b/lib/oofatfs/ff.c index 71bd19702a..e961c789d8 100644 --- a/lib/oofatfs/ff.c +++ b/lib/oofatfs/ff.c @@ -3382,11 +3382,7 @@ FRESULT f_read ( if (!sect) ABORT(fs, FR_INT_ERR); sect += csect; cc = btr / SS(fs); /* When remaining bytes >= sector size, */ - if (cc -#if _FS_DISK_READ_ALIGNED - && (((int)rbuff & 3) == 0) -#endif - ) {/* Read maximum contiguous sectors directly */ + if (cc) {/* Read maximum contiguous sectors directly */ if (csect + cc > fs->csize) { /* Clip at cluster boundary */ cc = fs->csize - csect; } diff --git a/lib/oofatfs/ffconf.h b/lib/oofatfs/ffconf.h index a3795fa3fe..214311b4c2 100644 --- a/lib/oofatfs/ffconf.h +++ b/lib/oofatfs/ffconf.h @@ -343,12 +343,6 @@ / SemaphoreHandle_t and etc.. A header file for O/S definitions needs to be / included somewhere in the scope of ff.h. */ -// Set to nonzero if buffers passed to disk_read have a word alignment -// restriction -#ifndef _FS_DISK_READ_ALIGNED -#define _FS_DISK_READ_ALIGNED 0 -#endif - /* #include // O/S definitions */ diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index 47a5b86534..89d88ce366 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -102,7 +102,6 @@ CFLAGS += -Wno-undef CFLAGS += -Wno-cast-align NRF_DEFINES += -DCONFIG_GPIO_AS_PINRESET -NRF_DEFINES += -D_FS_DISK_READ_ALIGNED=1 CFLAGS += $(NRF_DEFINES) CFLAGS += \