summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rwxr-xr-xmain.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/main.c b/main.c
index 4b58b778d..77498d7de 100755
--- a/main.c
+++ b/main.c
@@ -213,10 +213,11 @@ bool run_code_py(safe_mode_t safe_mode) {
serial_write_compressed(translate("WARNING: Your code filename has two extensions\n"));
}
}
- // Turn off the display before the heap disappears.
+ // Turn off the display and flush the fileystem before the heap disappears.
#if CIRCUITPY_DISPLAYIO
reset_displays();
#endif
+ filesystem_flush();
stop_mp();
free_memory(heap);
supervisor_move_memory();
@@ -375,6 +376,7 @@ int run_repl(void) {
} else {
exit_code = pyexec_friendly_repl();
}
+ filesystem_flush();
reset_port();
reset_board();
stop_mp();