mirror of
https://github.com/mist-devel/mist-firmware.git
synced 2026-02-02 06:21:16 +00:00
Revert "FatFs: fix ext buffer when buf_size>cluster size"
This reverts commit 5f3d213307.
This commit is contained in:
20
FatFs/ff.c
20
FatFs/ff.c
@@ -4564,11 +4564,9 @@ FRESULT f_lseek (
|
||||
/* Create a Directory Object */
|
||||
/*-----------------------------------------------------------------------*/
|
||||
|
||||
FRESULT f_opendir_buf (
|
||||
FRESULT f_opendir (
|
||||
DIR* dp, /* Pointer to directory object to create */
|
||||
const TCHAR* path, /* Pointer to the directory path */
|
||||
BYTE *buf,
|
||||
WORD buf_size
|
||||
const TCHAR* path /* Pointer to the directory path */
|
||||
)
|
||||
{
|
||||
FRESULT res;
|
||||
@@ -4581,13 +4579,13 @@ FRESULT f_opendir_buf (
|
||||
/* Get logical drive */
|
||||
res = mount_volume(&path, &fs, 0);
|
||||
if (res == FR_OK) {
|
||||
dp->buf = 0;
|
||||
dp->buf_size = 0;
|
||||
dp->buf_sect = (LBA_t)0 - 1;
|
||||
dp->obj.fs = fs;
|
||||
INIT_NAMBUF(fs);
|
||||
res = follow_path(dp, path); /* Follow the path to the directory */
|
||||
if (res == FR_OK) { /* Follow completed */
|
||||
dp->buf = buf;
|
||||
dp->buf_size = buf_size > fs->csize ? fs->csize : buf_size;
|
||||
dp->buf_sect = (LBA_t)0 - 1;
|
||||
if (!(dp->fn[NSFLAG] & NS_NONAME)) { /* It is not the origin directory itself */
|
||||
if (dp->obj.attr & AM_DIR) { /* This object is a sub-directory */
|
||||
#if FF_FS_EXFAT
|
||||
@@ -4628,13 +4626,7 @@ FRESULT f_opendir_buf (
|
||||
LEAVE_FF(fs, res);
|
||||
}
|
||||
|
||||
FRESULT f_opendir (
|
||||
DIR* dp, /* Pointer to directory object to create */
|
||||
const TCHAR* path /* Pointer to the directory path */
|
||||
)
|
||||
{
|
||||
return f_opendir_buf(dp, path, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------*/
|
||||
|
||||
@@ -312,7 +312,6 @@ FRESULT f_write (FIL* fp, const void* buff, UINT btw, UINT* bw); /* Write data t
|
||||
FRESULT f_lseek (FIL* fp, FSIZE_t ofs); /* Move file pointer of the file object */
|
||||
FRESULT f_truncate (FIL* fp); /* Truncate the file */
|
||||
FRESULT f_sync (FIL* fp); /* Flush cached data of the writing file */
|
||||
FRESULT f_opendir_buf (DIR* dp, const TCHAR* path, BYTE* buf, WORD buf_size); /* Open a directory using an external buffer for directory data */
|
||||
FRESULT f_opendir (DIR* dp, const TCHAR* path); /* Open a directory */
|
||||
FRESULT f_closedir (DIR* dp); /* Close an open directory */
|
||||
FRESULT f_readdir (DIR* dp, FILINFO* fno); /* Read a directory item */
|
||||
|
||||
@@ -326,7 +326,9 @@ char ScanDirectory(unsigned long mode, char *extension, unsigned char options) {
|
||||
iSelectedEntry = 0;
|
||||
for (i = 0; i < MAXDIRENTRIES; i++)
|
||||
sort_table[i] = i;
|
||||
if (f_opendir_buf(&dir, ".", sector_buffer, SECTOR_BUFFER_SIZE/512) != FR_OK) return 0;
|
||||
if (f_opendir(&dir, ".") != FR_OK) return 0;
|
||||
dir.buf = sector_buffer;
|
||||
dir.buf_size = SECTOR_BUFFER_SIZE/512;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user