diff options
author | Damien George <damien.p.george@gmail.com> | 2015-03-04 20:38:28 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-03-04 20:38:28 +0000 |
commit | 48ef64a72915c6ded71002f95ef97c13e506e5c2 (patch) | |
tree | 801d609be32acfe0f25ac994bba1cbc79cdb1463 /stmhal/moduos.c | |
parent | 4f94d90d4dba522a2fcf451da9c78e810782e2c0 (diff) | |
download | micropython-48ef64a72915c6ded71002f95ef97c13e506e5c2.tar.gz micropython-48ef64a72915c6ded71002f95ef97c13e506e5c2.zip |
stmhal: Make os.sync use disk_ioctl exclusively; reuse os.sync in pyb.
Diffstat (limited to 'stmhal/moduos.c')
-rw-r--r-- | stmhal/moduos.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/stmhal/moduos.c b/stmhal/moduos.c index 7c73d60510..296440ad90 100644 --- a/stmhal/moduos.c +++ b/stmhal/moduos.c @@ -33,7 +33,6 @@ #include "lib/fatfs/ff.h" #include "lib/fatfs/diskio.h" #include "rng.h" -#include "storage.h" #include "file.h" #include "sdcard.h" #include "fsusermount.h" @@ -309,11 +308,12 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(os_stat_obj, os_stat); /// \function sync() /// Sync all filesystems. STATIC mp_obj_t os_sync(void) { - storage_flush(); + disk_ioctl(0, CTRL_SYNC, NULL); + disk_ioctl(1, CTRL_SYNC, NULL); disk_ioctl(2, CTRL_SYNC, NULL); return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_0(os_sync_obj, os_sync); +MP_DEFINE_CONST_FUN_OBJ_0(mod_os_sync_obj, os_sync); #if MICROPY_HW_ENABLE_RNG /// \function urandom(n) @@ -343,7 +343,7 @@ STATIC const mp_map_elem_t os_module_globals_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_stat), (mp_obj_t)&os_stat_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_unlink), (mp_obj_t)&os_remove_obj }, // unlink aliases to remove - { MP_OBJ_NEW_QSTR(MP_QSTR_sync), (mp_obj_t)&os_sync_obj }, + { MP_OBJ_NEW_QSTR(MP_QSTR_sync), (mp_obj_t)&mod_os_sync_obj }, /// \constant sep - separation character used in paths { MP_OBJ_NEW_QSTR(MP_QSTR_sep), MP_OBJ_NEW_QSTR(MP_QSTR__slash_) }, |