summaryrefslogtreecommitdiffstats
path: root/buttons.cpp
diff options
context:
space:
mode:
authorConfuSomu2021-07-25 15:30:20 -0400
committerConfuSomu2021-07-25 15:30:20 -0400
commit5d896b77910431cdaac2ee4bfbfa8bbc91ab39ef (patch)
tree0ba254b91d209db1f20ac30bd90a5b646c4b433a /buttons.cpp
parent0490fe7cbe0d55815723b942fa7ce4a86e540565 (diff)
downloadpico-watch-5d896b77910431cdaac2ee4bfbfa8bbc91ab39ef.tar
pico-watch-5d896b77910431cdaac2ee4bfbfa8bbc91ab39ef.tar.gz
pico-watch-5d896b77910431cdaac2ee4bfbfa8bbc91ab39ef.zip
Implement an app_manager that supports BaseApp
and create classes for home_menu and main_clock apps. This commit has a lot of changes as multiple parts of the project had to be changed to support running apps that are based on the BaseApp class. It could not have been done in multiple commits as the progam would not be able to build and thus I would not be able to test the changes.
Diffstat (limited to 'buttons.cpp')
-rw-r--r--buttons.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/buttons.cpp b/buttons.cpp
index df2beef..23c5ab1 100644
--- a/buttons.cpp
+++ b/buttons.cpp
@@ -2,6 +2,7 @@
#include "pico/stdlib.h"
#include "buttons.hpp"
+#include "globals.hpp"
#include "api.hpp"
#include "app_manager.hpp"
// From pico-watch.c:
@@ -15,7 +16,7 @@ void gpio_interrupt_cb(uint gpio, uint32_t events) {
if (delta_since_press > g_s.button_delay_time) {
if (app_api.m_interpret_button_press) {
- if (gpio == BUTTON_HOME && (g_s.current_app != 0)) // Home app
+ if (gpio == BUTTON_HOME && (g_s.current_app->app_id != 0)) // Home app
app_switch_request(0);
else
app_btnpressed(g_s.current_app, gpio, delta_since_press);