From c4e404a01ea9460443155b5071e38e31129a134a Mon Sep 17 00:00:00 2001 From: ConfuSomu Date: Thu, 1 Apr 2021 22:01:13 -0400 Subject: Add fixme in pico-watch.c --- pico-watch.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'pico-watch.cpp') diff --git a/pico-watch.cpp b/pico-watch.cpp index 87d0965..88df2f2 100644 --- a/pico-watch.cpp +++ b/pico-watch.cpp @@ -78,6 +78,8 @@ bool repeating_callback(struct repeating_timer *t) { void app_switch(int old_appid, int new_appid) { app_ready = false; + // FIXME: race condition when pressing on HOME while app is rendering! + // The system is blocked waiting for the app to finish rendering, which will never happen. To fix the problem, app switching has to be a flag (c.f struct) that is set, and checked before rendering app. "if (app_switching.requested) app_switch(...);" We will not need anymore the app_rendering flag, as the check is done while the app is not rendering. while (app_rendering); // Wait for the app to finish rendering cycle if (APPS_DESTROY_ON_EXIT[old_appid]) { app_destroy(old_appid); -- cgit v1.2.3-54-g00ecf