aboutsummaryrefslogtreecommitdiff
path: root/extmod/fsusermount.h
diff options
context:
space:
mode:
authorDamien George2016-02-10 16:32:57 +0000
committerDamien George2016-02-10 23:40:10 +0000
commitb33a7705966a743c5e4c0c3c3bb83e6d97b5e84d (patch)
tree2c62a5389a7f0189119b5fcbbb9b30f0ff5b9db5 /extmod/fsusermount.h
parent34023eb673d5356bb4eb6fc635d6d48eefb35135 (diff)
extmod/fsusermount: Support mounting of multiple block devices.
This patch adds support to fsusermount for multiple block devices (instead of just one). The maximum allowed is fixed at compile time by the size of the fs_user_mount array accessed via MP_STATE_PORT, which in turn is set by MICROPY_FATFS_VOLUMES. With this patch, stmhal (which is still tightly coupled to fsusermount) is also modified to support mounting multiple devices And the flash and SD card are now just two block devices that are mounted at start up if they exist (and they have special native code to make them more efficient).
Diffstat (limited to 'extmod/fsusermount.h')
-rw-r--r--extmod/fsusermount.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/extmod/fsusermount.h b/extmod/fsusermount.h
index 0fa353b7e..3dcd03591 100644
--- a/extmod/fsusermount.h
+++ b/extmod/fsusermount.h
@@ -24,13 +24,18 @@
* THE SOFTWARE.
*/
+// 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 {
const char *str;
- mp_uint_t len;
+ 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
- // if ioctl[3]=count[1]=MP_OBJ_SENTINEL then we have the new protocol, else old
union {
mp_obj_t ioctl[4];
struct {