bugfixes for SD card compatibility in DMA mode

This commit is contained in:
ikari
2009-12-24 02:19:18 +01:00
parent 63febb92c6
commit 1b65c4fd88
7 changed files with 56 additions and 44 deletions

View File

@@ -1504,8 +1504,6 @@ FRESULT f_open (
}
fp->dir_sect = FSBUF.sect; /* Pointer to the directory entry */
/* Moved sync from mode & FA_CREATE_ALWAYS because it can reset FSBUF.sect */
sync(fs); /* not sure if this is needed in all cases, but kept */
fp->dir_ptr = dir;
#endif
fp->flag = mode; /* File access mode */
@@ -1516,6 +1514,11 @@ FRESULT f_open (
fp->csect = 1; /* Sector counter */
fp->fs = fs; //fp->id = fs->id; /* Owner file system object of the file */
#if !_FS_READONLY
if (mode & (FA_CREATE_ALWAYS|FA_OPEN_ALWAYS|FA_CREATE_NEW))
sync(fs); /* sync buffer in case the file was just created */
/* can't sync earlier, modifies FSBUF.sect */
#endif
return FR_OK;
}