Skip to content

Commit 60f7694

Browse files
authored
Merge pull request #1649 from dhalbert/reload-flush-filesystem
flush filesystem before resetting heap
2 parents 0cdb5fc + a10e4fe commit 60f7694

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,11 @@ bool run_code_py(safe_mode_t safe_mode) {
213213
serial_write_compressed(translate("WARNING: Your code filename has two extensions\n"));
214214
}
215215
}
216-
// Turn off the display before the heap disappears.
216+
// Turn off the display and flush the fileystem before the heap disappears.
217217
#if CIRCUITPY_DISPLAYIO
218218
reset_displays();
219219
#endif
220+
filesystem_flush();
220221
stop_mp();
221222
free_memory(heap);
222223
supervisor_move_memory();
@@ -375,6 +376,7 @@ int run_repl(void) {
375376
} else {
376377
exit_code = pyexec_friendly_repl();
377378
}
379+
filesystem_flush();
378380
reset_port();
379381
reset_board();
380382
stop_mp();

shared-module/displayio/__init__.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@ void displayio_refresh_displays(void) {
2929
if (mp_hal_is_interrupted()) {
3030
return;
3131
}
32-
// Somehow reloads from the sdcard are being lost. So, cheat and reraise.
33-
// But don't re-raise if already pending.
34-
if (reload_requested && MP_STATE_VM(mp_pending_exception) == MP_OBJ_NULL) {
35-
mp_raise_reload_exception();
32+
if (reload_requested) {
33+
// Reload is about to happen, so don't redisplay.
3634
return;
3735
}
3836

0 commit comments

Comments
 (0)