summaryrefslogtreecommitdiffstats
path: root/pico-watch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pico-watch.cpp')
-rw-r--r--pico-watch.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/pico-watch.cpp b/pico-watch.cpp
index 9bf45e0..4bca42c 100644
--- a/pico-watch.cpp
+++ b/pico-watch.cpp
@@ -45,18 +45,18 @@ int main() {
g_s.foreground_app = app_mgr::app_init(0);
while (1) {
- if (g_s.app_switch_requested) {
- app_mgr::app_switch(g_s.foreground_app, g_s.app_switch_to_app);
- g_s.app_switch_requested = false;
- }
-
if (g_s.app_ready && !g_s.is_sleeping) {
app_mgr::app_render(g_s.foreground_app);
app_api.display_write_backbuffer();
}
- if (g_s.is_sleeping) __wfi();
- else sleep_ms(g_s.foreground_app->app_get_attributes().render_interval);
+ if (g_s.is_sleeping)
+ __wfi();
+ else if (g_s.app_switch_requested) {
+ app_mgr::app_switch(g_s.foreground_app, g_s.app_switch_to_app);
+ g_s.app_switch_requested = false;
+ } else
+ sleep_ms(g_s.foreground_app->app_get_attributes().render_interval);
}
return 0;
}