diff options
-rw-r--r-- | app_manager.cpp | 7 | ||||
-rw-r--r-- | app_manager.hpp | 1 | ||||
-rw-r--r-- | pico-watch.cpp | 6 |
3 files changed, 10 insertions, 4 deletions
diff --git a/app_manager.cpp b/app_manager.cpp index 5bf10a6..313cf8d 100644 --- a/app_manager.cpp +++ b/app_manager.cpp @@ -78,6 +78,13 @@ int app_destroy(BaseApp* to_erase) { return 0; } +// Refresh each app +void app_all_bgrefresh() { + for (auto app : open_apps) { + app->bgrefresh(&app_api, app->app_get_attributes().id == g_s.current_app->app_get_attributes().id); + } +} + // Requests the current app to be replaced by an other one. The replacement will be done at the right moment. void app_switch_request(int to_appid) { if (!g_s.app_switch_requested) diff --git a/app_manager.hpp b/app_manager.hpp index b1d7a9c..08d2384 100644 --- a/app_manager.hpp +++ b/app_manager.hpp @@ -9,3 +9,4 @@ int app_render(BaseApp* app); int app_btnpressed(BaseApp* app, uint gpio, unsigned long delta); void app_switch(BaseApp* app, int new_appid); void app_switch_request(int to_appid); +void app_all_bgrefresh(); diff --git a/pico-watch.cpp b/pico-watch.cpp index 1166716..1a8738a 100644 --- a/pico-watch.cpp +++ b/pico-watch.cpp @@ -28,11 +28,9 @@ bool repeating_callback(struct repeating_timer *t) { app_api.display_power(true); } - // Refresh each app // should it be done when sleeping? - for (auto app : open_apps) { - app->bgrefresh(&app_api, true); // FIXME: second arg - } + app_all_bgrefresh(); + return true; } |