extmod/vfs_fat: Remove MICROPY_FATFS_OO config option.
Everyone should now be using the new ooFatFs library. The old one is no longer supported and will be removed.
This commit is contained in:
@@ -34,11 +34,7 @@
|
||||
#include "py/runtime.h"
|
||||
#include "py/stream.h"
|
||||
#include "py/mperrno.h"
|
||||
#if MICROPY_FATFS_OO
|
||||
#include "lib/oofatfs/ff.h"
|
||||
#else
|
||||
#include "lib/fatfs/ff.h"
|
||||
#endif
|
||||
#include "extmod/fsusermount.h"
|
||||
#include "extmod/vfs_fat.h"
|
||||
|
||||
@@ -115,11 +111,7 @@ STATIC mp_uint_t file_obj_write(mp_obj_t self_in, const void *buf, mp_uint_t siz
|
||||
STATIC mp_obj_t file_obj_close(mp_obj_t self_in) {
|
||||
pyb_file_obj_t *self = MP_OBJ_TO_PTR(self_in);
|
||||
// if fs==NULL then the file is closed and in that case this method is a no-op
|
||||
#if MICROPY_FATFS_OO
|
||||
if (self->fp.obj.fs != NULL) {
|
||||
#else
|
||||
if (self->fp.fs != NULL) {
|
||||
#endif
|
||||
FRESULT res = f_close(&self->fp);
|
||||
if (res != FR_OK) {
|
||||
mp_raise_OSError(fresult_to_errno_table[res]);
|
||||
@@ -221,13 +213,8 @@ STATIC mp_obj_t file_open(fs_user_mount_t *vfs, const mp_obj_type_t *type, mp_ar
|
||||
o->base.type = type;
|
||||
|
||||
const char *fname = mp_obj_str_get_str(args[0].u_obj);
|
||||
#if MICROPY_FATFS_OO
|
||||
assert(vfs != NULL);
|
||||
FRESULT res = f_open(&vfs->fatfs, &o->fp, fname, mode);
|
||||
#else
|
||||
(void)vfs;
|
||||
FRESULT res = f_open(&o->fp, fname, mode);
|
||||
#endif
|
||||
if (res != FR_OK) {
|
||||
m_del_obj(pyb_file_obj_t, o);
|
||||
mp_raise_OSError(fresult_to_errno_table[res]);
|
||||
|
||||
Reference in New Issue
Block a user