Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew J. Kroll committed Aug 10, 2013
1 parent e717f2d commit 460e71c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
20 changes: 10 additions & 10 deletions FAT/FatFS/src/ff.c
Expand Up @@ -2980,19 +2980,19 @@ FRESULT f_lseek(

#if _USE_FASTSEEK
if(fp->cltbl) { /* Fast seek */
DWORD cl, pcl, ncl, tcl, dsc, tlen, ulen, *tbl;

DWORD tlen = *fp->cltbl;
if(ofs == CREATE_LINKMAP) { /* Create CLMT */
tbl = fp->cltbl;
tlen = *tbl;
DWORD *tbl = fp->cltbl;
//DWORD tlen = *tbl;
tbl++;
ulen = 2; /* Given table size and required table size */
cl = fp->sclust; /* Top of the chain */
DWORD ulen = 2; /* Given table size and required table size */
DWORD cl = fp->sclust; /* Top of the chain */
if(cl) {
do {
/* Get a fragment */
tcl = cl;
ncl = 0;
DWORD tcl = cl;
DWORD ncl = 0;
DWORD pcl;
ulen += 2; /* Top, length and used items */
do {
pcl = cl;
Expand All @@ -3019,7 +3019,7 @@ FRESULT f_lseek(
fp->fptr = ofs; /* Set file pointer */
if(ofs) {
fp->clust = clmt_clust(fp, ofs - 1);
dsc = clust2sect(fs, fp->clust);
DWORD dsc = clust2sect(fs, fp->clust);
if(!dsc) ABORT(fs, FR_INT_ERR);
dsc += (ofs - 1) / SS(fs) & (fs->csize - 1);
if(fp->fptr % SS(fs) && dsc != fp->dsect) { /* Refill sector cache if needed */
Expand Down Expand Up @@ -3051,7 +3051,7 @@ FRESULT f_lseek(
) ofs = fp->fsize;

ifptr = fp->fptr;
fp->fptr = nsect = 0;
fp->fptr = 0; nsect = 0;
if(ofs) {
bcs = (DWORD) fs->csize * SS(fs); /* Cluster size (byte) */
if(ifptr > 0 &&
Expand Down
8 changes: 3 additions & 5 deletions FAT/FatFS/src/ffconf.h
Expand Up @@ -75,10 +75,6 @@
#define _USE_MKFS 1 /* 0:Disable or 1:Enable */
/* To enable f_mkfs function, set _USE_MKFS to 1 and set _FS_READONLY to 0 */

/*
* Trips gcc 4.3.2 bug
* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18251
*/
#define _USE_FASTSEEK 0 /* 0:Disable or 1:Enable */
/* To enable fast seek feature, set _USE_FASTSEEK to 1. */

Expand Down Expand Up @@ -158,12 +154,14 @@
/* Number of volumes (logical drives) to be used. */
#endif

#ifndef _MAX_SS
#define _MAX_SS 512 /* 512, 1024, 2048 or 4096 */
/* Maximum sector size to be handled.
/ Always set 512 for memory card and hard disk but a larger value may be
/ required for on-board flash memory, floppy disk and optical disk.
/ When _MAX_SS is larger than 512, it configures FatFs to variable sector size
/ and GET_SECTOR_SIZE command must be implemented to the disk_ioctl function. */
#endif


#define _MULTI_PARTITION 0 /* 0:Single partition, 1:Enable multiple partition */
Expand All @@ -189,7 +187,7 @@
#define GSTR(X) pgm_read_byte_near(&X)
#define GPROGMEM PROGMEM
#define GPSTR(X) PSTR(X)
#define GCONST
#define GCONST const
#else
#define _TABLES_IN_PGMSPACE 0
#define GSTR
Expand Down

0 comments on commit 460e71c

Please sign in to comment.