Skip to content

Commit e959f21

Browse files
committed
extmod/vfs_fat: Update for new oofatfs version.
1 parent 7eadcaa commit e959f21

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

extmod/vfs_fat.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
#include "extmod/vfs_fat.h"
4040
#include "lib/timeutils/timeutils.h"
4141

42-
#if _MAX_SS == _MIN_SS
43-
#define SECSIZE(fs) (_MIN_SS)
42+
#if FF_MAX_SS == FF_MIN_SS
43+
#define SECSIZE(fs) (FF_MIN_SS)
4444
#else
4545
#define SECSIZE(fs) ((fs)->ssize)
4646
#endif
@@ -111,7 +111,7 @@ STATIC mp_obj_t fat_vfs_mkfs(mp_obj_t bdev_in) {
111111
fs_user_mount_t *vfs = MP_OBJ_TO_PTR(fat_vfs_make_new(&mp_fat_vfs_type, 1, 0, &bdev_in));
112112

113113
// make the filesystem
114-
uint8_t working_buf[_MAX_SS];
114+
uint8_t working_buf[FF_MAX_SS];
115115
FRESULT res = f_mkfs(&vfs->fatfs, FM_FAT | FM_SFD, 0, working_buf, sizeof(working_buf));
116116
if (res != FR_OK) {
117117
mp_raise_OSError(fresult_to_errno_table[res]);
@@ -363,7 +363,7 @@ STATIC mp_obj_t fat_vfs_statvfs(mp_obj_t vfs_in, mp_obj_t path_in) {
363363
t->items[6] = MP_OBJ_NEW_SMALL_INT(0); // f_ffree
364364
t->items[7] = MP_OBJ_NEW_SMALL_INT(0); // f_favail
365365
t->items[8] = MP_OBJ_NEW_SMALL_INT(0); // f_flags
366-
t->items[9] = MP_OBJ_NEW_SMALL_INT(_MAX_LFN); // f_namemax
366+
t->items[9] = MP_OBJ_NEW_SMALL_INT(FF_MAX_LFN); // f_namemax
367367

368368
return MP_OBJ_FROM_PTR(t);
369369
}
@@ -383,7 +383,7 @@ STATIC mp_obj_t vfs_fat_mount(mp_obj_t self_in, mp_obj_t readonly, mp_obj_t mkfs
383383
// check if we need to make the filesystem
384384
FRESULT res = (self->flags & FSUSER_NO_FILESYSTEM) ? FR_NO_FILESYSTEM : FR_OK;
385385
if (res == FR_NO_FILESYSTEM && mp_obj_is_true(mkfs)) {
386-
uint8_t working_buf[_MAX_SS];
386+
uint8_t working_buf[FF_MAX_SS];
387387
res = f_mkfs(&self->fatfs, FM_FAT | FM_SFD, 0, working_buf, sizeof(working_buf));
388388
}
389389
if (res != FR_OK) {

extmod/vfs_fat_diskio.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
#include "lib/oofatfs/diskio.h"
4343
#include "extmod/vfs_fat.h"
4444

45-
#if _MAX_SS == _MIN_SS
46-
#define SECSIZE(fs) (_MIN_SS)
45+
#if FF_MAX_SS == FF_MIN_SS
46+
#define SECSIZE(fs) (FF_MIN_SS)
4747
#else
4848
#define SECSIZE(fs) ((fs)->ssize)
4949
#endif
@@ -194,7 +194,7 @@ DRESULT disk_ioctl (
194194
} else {
195195
*((WORD*)buff) = mp_obj_get_int(ret);
196196
}
197-
#if _MAX_SS != _MIN_SS
197+
#if FF_MAX_SS != FF_MIN_SS
198198
// need to store ssize because we use it in disk_read/disk_write
199199
vfs->fatfs.ssize = *((WORD*)buff);
200200
#endif

0 commit comments

Comments
 (0)