aboutsummaryrefslogtreecommitdiffstats
path: root/apps/main_clock/main.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'apps/main_clock/main.hpp')
-rw-r--r--apps/main_clock/main.hpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/apps/main_clock/main.hpp b/apps/main_clock/main.hpp
new file mode 100644
index 0000000..37c9075
--- /dev/null
+++ b/apps/main_clock/main.hpp
@@ -0,0 +1,36 @@
+#pragma once
+
+#include "pico/util/datetime.h"
+
+// Includes also buttons, API and ss_oled
+#include "../../base_app.hpp"
+
+class app_main_clock : public BaseApp {
+ private:
+ bool *ask_user_choice;
+ int *user_choice;
+ const char *choices[26] = {"One", "Two", "Three!", "This is looong!", "make sure to choose me!:p"};
+
+ void time_as_str(char *buf, uint buf_size, const datetime_t *t);
+ void date_as_str(char *buf, uint buf_size, const datetime_t *t);
+ void show_datetime(Api *app_api);
+
+ public:
+ uint app_id = 1;
+ bool app_destroy_on_exit = true;
+
+ app_main_clock(Api *app_api);
+ int render(Api *app_api);
+ int btnpressed(Api *app_api, uint gpio, unsigned long delta);
+ int bgrefresh(Api *app_api, bool in_foreground);
+ ~app_main_clock();
+};
+
+
+/* namespace app_main_clock {
+ int init(Api *app_api);
+ int render(Api *app_api);
+ int btnpressed(Api *app_api, uint gpio, unsigned long delta);
+ int bgrefresh(Api *app_api, bool in_foreground);
+ int destroy(Api *app_api);
+} */