summaryrefslogtreecommitdiff
path: root/stmhal/main.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-03-22 14:56:32 +0000
committerDamien George <damien.p.george@gmail.com>2014-03-22 14:56:32 +0000
commitad7b84a7b9a1beb960d216995dd608b794440183 (patch)
tree42cd9a64d5a84343da64f57e3858466a820ac573 /stmhal/main.c
parent684164a8cf8c2b989049d964ca7fc0419ada31ab (diff)
stmhal: Add os module with a few basic functions.
Diffstat (limited to 'stmhal/main.c')
-rw-r--r--stmhal/main.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/stmhal/main.c b/stmhal/main.c
index 2fd5bf736..22f7be23e 100644
--- a/stmhal/main.c
+++ b/stmhal/main.c
@@ -10,7 +10,6 @@
#include "pendsv.h"
#include "mpconfig.h"
#include "qstr.h"
-#include "nlr.h"
#include "misc.h"
#include "lexer.h"
#include "parse.h"
@@ -23,6 +22,7 @@
#include "gccollect.h"
#include "pyexec.h"
#include "pybmodule.h"
+#include "osmodule.h"
#include "usart.h"
#include "led.h"
#include "exti.h"
@@ -276,6 +276,10 @@ soft_reset:
// probably shouldn't do this, so we are compatible with CPython
rt_store_name(MP_QSTR_pyb, (mp_obj_t)&pyb_module);
+ // pre-import the os module
+ // TODO don't do this! (need a way of registering builtin modules...)
+ rt_store_name(MP_QSTR_os, (mp_obj_t)&os_module);
+
// check if user switch held (initiates reset of filesystem)
bool reset_filesystem = false;
#if MICROPY_HW_HAS_SWITCH
@@ -475,10 +479,8 @@ soft_reset:
pyexec_repl();
-#if 0
printf("PYB: sync filesystems\n");
storage_flush();
-#endif
printf("PYB: soft reboot\n");