summaryrefslogtreecommitdiffstatshomepage
path: root/esp8266
diff options
context:
space:
mode:
authorRadomir Dopieralski <openstack@sheep.art.pl>2016-08-22 16:10:34 +0200
committerDamien George <damien.p.george@gmail.com>2016-08-26 12:45:21 +1000
commitd29ca28288581ca788e468528ea1680b99eb49e5 (patch)
tree36fa74e4f03df4be98b7578be4ff0686aee28395 /esp8266
parentb0e2106fb89d108bd0249c85707b800d23d0273f (diff)
downloadmicropython-d29ca28288581ca788e468528ea1680b99eb49e5.tar.gz
micropython-d29ca28288581ca788e468528ea1680b99eb49e5.zip
esp8266/modous: Add os.umount method to unmount a filesystem.
This is an object-oriented approach, where uos is only a proxy for the methods on the vfs object. Some internals had to be exposed (the STATIC keyword removed) for this to work. Fixes #2338.
Diffstat (limited to 'esp8266')
-rw-r--r--esp8266/moduos.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/esp8266/moduos.c b/esp8266/moduos.c
index af149625d6..bbbf2b6b8b 100644
--- a/esp8266/moduos.c
+++ b/esp8266/moduos.c
@@ -123,6 +123,10 @@ STATIC mp_obj_t os_rename(mp_obj_t path_old, mp_obj_t path_new) {
}
STATIC MP_DEFINE_CONST_FUN_OBJ_2(os_rename_obj, os_rename);
+STATIC mp_obj_t os_umount(void) {
+ return vfs_proxy_call(MP_QSTR_umount, 0, NULL);
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_0(os_umount_obj, os_umount);
#endif
STATIC mp_obj_t os_urandom(mp_obj_t num) {
@@ -166,6 +170,7 @@ STATIC const mp_rom_map_elem_t os_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_remove), MP_ROM_PTR(&os_remove_obj) },
{ MP_ROM_QSTR(MP_QSTR_rename), MP_ROM_PTR(&os_rename_obj) },
{ MP_ROM_QSTR(MP_QSTR_stat), MP_ROM_PTR(&os_stat_obj) },
+ { MP_ROM_QSTR(MP_QSTR_umount), MP_ROM_PTR(&os_umount_obj) },
#endif
};