extmod/vfs_fat: Make fat_vfs_open_obj wrapper public, not its function.

This patch just moves the definition of the wrapper object fat_vfs_open_obj
to the location of the definition of its function, which matches how it's
done in most other places in the code base.
pull/3633/head
Damien George 2018-02-23 17:33:26 +11:00
rodzic 638b860066
commit eb570f47a2
3 zmienionych plików z 3 dodań i 4 usunięć

Wyświetl plik

@ -121,8 +121,6 @@ STATIC mp_obj_t fat_vfs_mkfs(mp_obj_t bdev_in) {
STATIC MP_DEFINE_CONST_FUN_OBJ_1(fat_vfs_mkfs_fun_obj, fat_vfs_mkfs);
STATIC MP_DEFINE_CONST_STATICMETHOD_OBJ(fat_vfs_mkfs_obj, MP_ROM_PTR(&fat_vfs_mkfs_fun_obj));
STATIC MP_DEFINE_CONST_FUN_OBJ_3(fat_vfs_open_obj, fatfs_builtin_open_self);
typedef struct _mp_vfs_fat_ilistdir_it_t {
mp_obj_base_t base;
mp_fun_1_t iternext;

Wyświetl plik

@ -57,7 +57,7 @@ extern const byte fresult_to_errno_table[20];
extern const mp_obj_type_t mp_fat_vfs_type;
mp_import_stat_t fat_vfs_import_stat(struct _fs_user_mount_t *vfs, const char *path);
mp_obj_t fatfs_builtin_open_self(mp_obj_t self_in, mp_obj_t path, mp_obj_t mode);
MP_DECLARE_CONST_FUN_OBJ_3(fat_vfs_open_obj);
MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_open_obj);
#endif // MICROPY_INCLUDED_EXTMOD_VFS_FAT_H

Wyświetl plik

@ -282,7 +282,7 @@ const mp_obj_type_t mp_type_textio = {
};
// Factory function for I/O stream classes
mp_obj_t fatfs_builtin_open_self(mp_obj_t self_in, mp_obj_t path, mp_obj_t mode) {
STATIC mp_obj_t fatfs_builtin_open_self(mp_obj_t self_in, mp_obj_t path, mp_obj_t mode) {
// TODO: analyze buffering args and instantiate appropriate type
fs_user_mount_t *self = MP_OBJ_TO_PTR(self_in);
mp_arg_val_t arg_vals[FILE_OPEN_NUM_ARGS];
@ -291,5 +291,6 @@ mp_obj_t fatfs_builtin_open_self(mp_obj_t self_in, mp_obj_t path, mp_obj_t mode)
arg_vals[2].u_obj = mp_const_none;
return file_open(self, &mp_type_textio, arg_vals);
}
MP_DEFINE_CONST_FUN_OBJ_3(fat_vfs_open_obj, fatfs_builtin_open_self);
#endif // MICROPY_VFS && MICROPY_VFS_FAT