summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorScott Shawcroft <scott@adafruit.com>2020-03-03 11:27:50 -0800
committerGitHub <noreply@github.com>2020-03-03 11:27:50 -0800
commit17458ad81a2bbdedea9909ab2eaf1a228d778611 (patch)
tree0e8210575fbf3151da1d61448188c8cd108887f9 /lib
parent2e370008c37111b7bf064fbb664a8572061720ff (diff)
parenteef742bf45f504cf23523fea4f20e61774407646 (diff)
Merge pull request #2662 from jepler/issue2332
Fix unaligned disk reads properly
Diffstat (limited to 'lib')
-rw-r--r--lib/oofatfs/ff.c6
-rw-r--r--lib/oofatfs/ffconf.h6
2 files changed, 1 insertions, 11 deletions
diff --git a/lib/oofatfs/ff.c b/lib/oofatfs/ff.c
index 71bd19702..e961c789d 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 a3795fa3f..214311b4c 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 <windows.h> // O/S definitions */