summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2017-10-12 20:10:31 -0400
committerDan Halbert <halbert@halwitz.org>2017-10-12 20:10:31 -0400
commitfabaa2ec3045c4709de05c238a6525d0fe2e3cb2 (patch)
tree7df563824134ca60ba95eb6f376220eb7b49f7ae /main.c
parentb7591cfd19d308091dc67ae698c112cdb52a044f (diff)
parent922006dd59323e6019e8fbfe1938e0c30121999c (diff)
merge 2.x changes into master; touch up Makefile CFLAGS logic
Diffstat (limited to 'main.c')
-rw-r--r--main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.c b/main.c
index dd9b1bd6e..ba1e0e401 100644
--- a/main.c
+++ b/main.c
@@ -219,7 +219,10 @@ int __attribute__((used)) main(void) {
mp_stack_fill_with_sentinel();
#endif
- filesystem_init();
+ // Create a new filesystem only if we're not in a safe mode.
+ // A power brownout here could make it appear as if there's
+ // no SPI flash filesystem, and we might erase the existing one.
+ filesystem_init(safe_mode == NO_SAFE_MODE);
// Reset everything and prep MicroPython to run boot.py.
reset_port();