diff options
| author | Dan Halbert <halbert@halwitz.org> | 2019-03-16 16:49:32 -0400 |
|---|---|---|
| committer | Dan Halbert <halbert@halwitz.org> | 2019-03-16 16:49:32 -0400 |
| commit | 43915133a1e7c682cdae313273060379f1f029b2 (patch) | |
| tree | 515eb176553e6d2dc96478f88b694b82de198793 | |
| parent | 0cdb5fcfd9bb178a880bbbb1a043aa2452243e0f (diff) | |
after code.py runs, flush filesystem before resetting heap
| -rwxr-xr-x | main.c | 3 | ||||
| -rw-r--r-- | shared-module/displayio/__init__.c | 6 |
2 files changed, 4 insertions, 5 deletions
@@ -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(); diff --git a/shared-module/displayio/__init__.c b/shared-module/displayio/__init__.c index 546a46b1e..ced5b0fef 100644 --- a/shared-module/displayio/__init__.c +++ b/shared-module/displayio/__init__.c @@ -29,10 +29,8 @@ void displayio_refresh_displays(void) { if (mp_hal_is_interrupted()) { return; } - // Somehow reloads from the sdcard are being lost. So, cheat and reraise. - // But don't re-raise if already pending. - if (reload_requested && MP_STATE_VM(mp_pending_exception) == MP_OBJ_NULL) { - mp_raise_reload_exception(); + if (reload_requested) { + // Reload is about to happen, so don't redisplay. return; } |
