extmod: Merge old fsusermount.h header into vfs.h and vfs_fat.h.

vfs.h is for generic VFS declarations, and vfs_fat.h is for VfsFat
specific things.
This commit is contained in:
Damien George
2017-01-29 19:20:27 +11:00
parent 9425bf5b2b
commit b697c89009
16 changed files with 42 additions and 76 deletions

View File

@@ -25,8 +25,32 @@
*/
#include "py/lexer.h"
#include "py/obj.h"
#include "lib/oofatfs/ff.h"
#include "extmod/vfs.h"
struct _fs_user_mount_t;
// these are the values for fs_user_mount_t.flags
#define FSUSER_NATIVE (0x0001) // readblocks[2]/writeblocks[2] contain native func
#define FSUSER_FREE_OBJ (0x0002) // fs_user_mount_t obj should be freed on umount
#define FSUSER_HAVE_IOCTL (0x0004) // new protocol with ioctl
typedef struct _fs_user_mount_t {
mp_obj_base_t base;
const char *str;
uint16_t len; // length of str
uint16_t flags;
mp_obj_t readblocks[4];
mp_obj_t writeblocks[4];
// new protocol uses just ioctl, old uses sync (optional) and count
union {
mp_obj_t ioctl[4];
struct {
mp_obj_t sync[2];
mp_obj_t count[2];
} old;
} u;
FATFS fatfs;
} fs_user_mount_t;
extern const byte fresult_to_errno_table[20];
extern const mp_obj_type_t mp_fat_vfs_type;