From 79b68237b65d1b27a1e0543bf8d5ae1edd5cdce0 Mon Sep 17 00:00:00 2001 From: David Kerr Date: Thu, 20 Jun 2024 15:14:38 +0100 Subject: [PATCH 1/3] Add missing function declarations --- src/ui/ui.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/ui/ui.h b/src/ui/ui.h index 1c14daf..bbfa4a0 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -213,6 +213,27 @@ extern "C" void ui_games_update(void); void showError(const char *title, const char *message); + // Required Watch face declarations. + + void init_face_174(void (*registerWatchface_cb)()); + void init_face_228(void (*registerWatchface_cb)()); + void init_face_1041(void (*registerWatchface_cb)()); + void init_face_1167(void (*registerWatchface_cb)()); + void init_face_1169(void (*registerWatchface_cb)()); + void init_face_2051(void (*registerWatchface_cb)()); + void init_face_2151(void (*registerWatchface_cb)()); + void init_face_3589(void (*registerWatchface_cb)()); + + void update_check_174(lv_obj_t *ui_home, int second, int minute, int hour, int mode, int am, int day, int month, int year, int weekday, float temp, int icon, int battery, int connection, int steps, float distance, int kcal, int bpm, int oxygen); + void update_check_228(lv_obj_t *ui_home, int second, int minute, int hour, int mode, int am, int day, int month, int year, int weekday, float temp, int icon, int battery, int connection, int steps, float distance, int kcal, int bpm, int oxygen); + void update_check_1041(lv_obj_t *ui_home, int second, int minute, int hour, int mode, int am, int day, int month, int year, int weekday, float temp, int icon, int battery, int connection, int steps, float distance, int kcal, int bpm, int oxygen); + void update_check_1167(lv_obj_t *ui_home, int second, int minute, int hour, int mode, int am, int day, int month, int year, int weekday, float temp, int icon, int battery, int connection, int steps, float distance, int kcal, int bpm, int oxygen); + void update_check_1169(lv_obj_t *ui_home, int second, int minute, int hour, int mode, int am, int day, int month, int year, int weekday, float temp, int icon, int battery, int connection, int steps, float distance, int kcal, int bpm, int oxygen); + void update_check_2051(lv_obj_t *ui_home, int second, int minute, int hour, int mode, int am, int day, int month, int year, int weekday, float temp, int icon, int battery, int connection, int steps, float distance, int kcal, int bpm, int oxygen); + void update_check_2151(lv_obj_t *ui_home, int second, int minute, int hour, int mode, int am, int day, int month, int year, int weekday, float temp, int icon, int battery, int connection, int steps, float distance, int kcal, int bpm, int oxygen); + void update_check_3589(lv_obj_t *ui_home, int second, int minute, int hour, int mode, int am, int day, int month, int year, int weekday, float temp, int icon, int battery, int connection, int steps, float distance, int kcal, int bpm, int oxygen); + + // LV_IMG_DECLARE(ui_img_753022056); // assets\night-sky.png LV_IMG_DECLARE(ui_img_602195540); // assets\dy-6.png LV_IMG_DECLARE(ui_img_wechat_png); // assets\wechat.png From 3aad4c79fd353696875e53c6dcec9fe030630e6f Mon Sep 17 00:00:00 2001 From: David Kerr Date: Fri, 21 Jun 2024 00:34:05 +0100 Subject: [PATCH 2/3] surround faces init and update with enable pragmas --- src/ui/ui.c | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++-- src/ui/ui.h | 21 ------------- 2 files changed, 82 insertions(+), 24 deletions(-) diff --git a/src/ui/ui.c b/src/ui/ui.c index 50b1acc..6d990ca 100644 --- a/src/ui/ui.c +++ b/src/ui/ui.c @@ -5,6 +5,7 @@ #include "ui.h" #include "ui_helpers.h" +#include "app_hal.h" #include "./faces/34_2_dial/34_2_dial.h" #include "./faces/75_2_dial/75_2_dial.h" @@ -2799,56 +2800,134 @@ void ui_watchfaces_init(void) numFaces = 0; registerWatchface_cb("Default", &digital_preview, &ui_clockScreen); // register the default watchface - // register other watchfaces by initializing them and passing the register callback + // Register other watchfaces by initializing them and passing the register callback +#ifdef ENABLE_FACE_34_2_DIAL init_face_34_2_dial(registerWatchface_cb); +#endif +#ifdef ENABLE_FACE_75_2_DIAL init_face_75_2_dial(registerWatchface_cb); +#endif +#ifdef ENABLE_FACE_79_2_DIAL init_face_79_2_dial(registerWatchface_cb); +#endif +#ifdef ENABLE_FACE_116_2_DIAL init_face_116_2_dial(registerWatchface_cb); +#endif +#ifdef ENABLE_FACE_756_2_DIAL init_face_756_2_dial(registerWatchface_cb); +#endif +#ifdef ENABLE_FACE_B_W_RESIZED init_face_b_w_resized(registerWatchface_cb); +#endif +#ifdef ENABLE_FACE_KENYA init_face_kenya(registerWatchface_cb); +#endif +#ifdef ENABLE_FACE_PIXEL_RESIZED init_face_pixel_resized(registerWatchface_cb); +#endif +#ifdef ENABLE_FACE_RADAR init_face_radar(registerWatchface_cb); +#endif +#ifdef ENABLE_FACE_SMART_RESIZED init_face_smart_resized(registerWatchface_cb); +#endif +#ifdef ENABLE_FACE_TIX_RESIZED init_face_tix_resized(registerWatchface_cb); +#endif +#ifdef ENABLE_FACE_WFB_RESIZED init_face_wfb_resized(registerWatchface_cb); +#endif +#ifdef ENABLE_FACE_174 init_face_174(registerWatchface_cb); +#endif +#ifdef ENABLE_FACE_228 init_face_228(registerWatchface_cb); +#endif +#ifdef ENABLE_FACE_1041 init_face_1041(registerWatchface_cb); +#endif +#ifdef ENABLE_FACE_1167 init_face_1167(registerWatchface_cb); +#endif +#ifdef ENABLE_FACE_1169 init_face_1169(registerWatchface_cb); +#endif +#ifdef ENABLE_FACE_2051 init_face_2051(registerWatchface_cb); +#endif +#ifdef ENABLE_FACE_2151 init_face_2151(registerWatchface_cb); +#endif +#ifdef ENABLE_FACE_3589 init_face_3589(registerWatchface_cb); - +#endif } void ui_update_watchfaces(int second, int minute, int hour, bool mode, bool am, int day, int month, int year, int weekday, int temp, int icon, int battery, bool connection, int steps, int distance, int kcal, int bpm, int oxygen) { - +#ifdef ENABLE_FACE_34_2_DIAL update_check_34_2_dial(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); +#endif +#ifdef ENABLE_FACE_75_2_DIAL update_check_75_2_dial(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); +#endif +#ifdef ENABLE_FACE_79_2_DIAL update_check_79_2_dial(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); +#endif +#ifdef ENABLE_FACE_116_2_DIAL update_check_116_2_dial(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); +#endif +#ifdef ENABLE_FACE_756_2_DIAL update_check_756_2_dial(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); +#endif +#ifdef ENABLE_FACE_B_W_RESIZED update_check_b_w_resized(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); +#endif +#ifdef ENABLE_FACE_KENYA update_check_kenya(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); +#endif +#ifdef ENABLE_FACE_PIXEL_RESIZED update_check_pixel_resized(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); +#endif +#ifdef ENABLE_FACE_RADAR update_check_radar(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); +#endif +#ifdef ENABLE_FACE_SMART_RESIZED update_check_smart_resized(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); +#endif +#ifdef ENABLE_FACE_TIX_RESIZED update_check_tix_resized(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); +#endif +#ifdef ENABLE_FACE_WFB_RESIZED update_check_wfb_resized(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); +#endif +#ifdef ENABLE_FACE_174 update_check_174(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); +#endif +#ifdef ENABLE_FACE_228 update_check_228(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); +#endif +#ifdef ENABLE_FACE_1041 update_check_1041(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); +#endif +#ifdef ENABLE_FACE_1167 update_check_1167(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); +#endif +#ifdef ENABLE_FACE_1169 update_check_1169(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); +#endif +#ifdef ENABLE_FACE_2051 update_check_2051(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); +#endif +#ifdef ENABLE_FACE_2151 update_check_2151(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); +#endif +#ifdef ENABLE_FACE_3589 update_check_3589(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); +#endif } void ui_games_init(void) diff --git a/src/ui/ui.h b/src/ui/ui.h index bbfa4a0..1c14daf 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -213,27 +213,6 @@ extern "C" void ui_games_update(void); void showError(const char *title, const char *message); - // Required Watch face declarations. - - void init_face_174(void (*registerWatchface_cb)()); - void init_face_228(void (*registerWatchface_cb)()); - void init_face_1041(void (*registerWatchface_cb)()); - void init_face_1167(void (*registerWatchface_cb)()); - void init_face_1169(void (*registerWatchface_cb)()); - void init_face_2051(void (*registerWatchface_cb)()); - void init_face_2151(void (*registerWatchface_cb)()); - void init_face_3589(void (*registerWatchface_cb)()); - - void update_check_174(lv_obj_t *ui_home, int second, int minute, int hour, int mode, int am, int day, int month, int year, int weekday, float temp, int icon, int battery, int connection, int steps, float distance, int kcal, int bpm, int oxygen); - void update_check_228(lv_obj_t *ui_home, int second, int minute, int hour, int mode, int am, int day, int month, int year, int weekday, float temp, int icon, int battery, int connection, int steps, float distance, int kcal, int bpm, int oxygen); - void update_check_1041(lv_obj_t *ui_home, int second, int minute, int hour, int mode, int am, int day, int month, int year, int weekday, float temp, int icon, int battery, int connection, int steps, float distance, int kcal, int bpm, int oxygen); - void update_check_1167(lv_obj_t *ui_home, int second, int minute, int hour, int mode, int am, int day, int month, int year, int weekday, float temp, int icon, int battery, int connection, int steps, float distance, int kcal, int bpm, int oxygen); - void update_check_1169(lv_obj_t *ui_home, int second, int minute, int hour, int mode, int am, int day, int month, int year, int weekday, float temp, int icon, int battery, int connection, int steps, float distance, int kcal, int bpm, int oxygen); - void update_check_2051(lv_obj_t *ui_home, int second, int minute, int hour, int mode, int am, int day, int month, int year, int weekday, float temp, int icon, int battery, int connection, int steps, float distance, int kcal, int bpm, int oxygen); - void update_check_2151(lv_obj_t *ui_home, int second, int minute, int hour, int mode, int am, int day, int month, int year, int weekday, float temp, int icon, int battery, int connection, int steps, float distance, int kcal, int bpm, int oxygen); - void update_check_3589(lv_obj_t *ui_home, int second, int minute, int hour, int mode, int am, int day, int month, int year, int weekday, float temp, int icon, int battery, int connection, int steps, float distance, int kcal, int bpm, int oxygen); - - // LV_IMG_DECLARE(ui_img_753022056); // assets\night-sky.png LV_IMG_DECLARE(ui_img_602195540); // assets\dy-6.png LV_IMG_DECLARE(ui_img_wechat_png); // assets\wechat.png From d5154b3d1bf865b92ab30352c59db68278cc142b Mon Sep 17 00:00:00 2001 From: David Kerr Date: Fri, 21 Jun 2024 22:00:32 +0100 Subject: [PATCH 3/3] include missing face includes --- src/ui/ui.c | 94 +++++++---------------------------------------------- 1 file changed, 12 insertions(+), 82 deletions(-) diff --git a/src/ui/ui.c b/src/ui/ui.c index 6d990ca..2122cd4 100644 --- a/src/ui/ui.c +++ b/src/ui/ui.c @@ -5,7 +5,6 @@ #include "ui.h" #include "ui_helpers.h" -#include "app_hal.h" #include "./faces/34_2_dial/34_2_dial.h" #include "./faces/75_2_dial/75_2_dial.h" @@ -20,6 +19,15 @@ #include "./faces/tix_resized/tix_resized.h" #include "./faces/wfb_resized/wfb_resized.h" +#include "./faces/174/174.h" +#include "./faces/228/228.h" +#include "./faces/1041/1041.h" +#include "./faces/1167/1167.h" +#include "./faces/1169/1169.h" +#include "./faces/2051/2051.h" +#include "./faces/2151/2151.h" +#include "./faces/3589/3589.h" + ///////////////////// VARIABLES //////////////////// void pulseCall_Animation(lv_obj_t *TargetObject, int delay); void ui_event_clockScreen(lv_event_t *e); @@ -2800,134 +2808,56 @@ void ui_watchfaces_init(void) numFaces = 0; registerWatchface_cb("Default", &digital_preview, &ui_clockScreen); // register the default watchface - // Register other watchfaces by initializing them and passing the register callback -#ifdef ENABLE_FACE_34_2_DIAL + // register other watchfaces by initializing them and passing the register callback init_face_34_2_dial(registerWatchface_cb); -#endif -#ifdef ENABLE_FACE_75_2_DIAL init_face_75_2_dial(registerWatchface_cb); -#endif -#ifdef ENABLE_FACE_79_2_DIAL init_face_79_2_dial(registerWatchface_cb); -#endif -#ifdef ENABLE_FACE_116_2_DIAL init_face_116_2_dial(registerWatchface_cb); -#endif -#ifdef ENABLE_FACE_756_2_DIAL init_face_756_2_dial(registerWatchface_cb); -#endif -#ifdef ENABLE_FACE_B_W_RESIZED init_face_b_w_resized(registerWatchface_cb); -#endif -#ifdef ENABLE_FACE_KENYA init_face_kenya(registerWatchface_cb); -#endif -#ifdef ENABLE_FACE_PIXEL_RESIZED init_face_pixel_resized(registerWatchface_cb); -#endif -#ifdef ENABLE_FACE_RADAR init_face_radar(registerWatchface_cb); -#endif -#ifdef ENABLE_FACE_SMART_RESIZED init_face_smart_resized(registerWatchface_cb); -#endif -#ifdef ENABLE_FACE_TIX_RESIZED init_face_tix_resized(registerWatchface_cb); -#endif -#ifdef ENABLE_FACE_WFB_RESIZED init_face_wfb_resized(registerWatchface_cb); -#endif -#ifdef ENABLE_FACE_174 init_face_174(registerWatchface_cb); -#endif -#ifdef ENABLE_FACE_228 init_face_228(registerWatchface_cb); -#endif -#ifdef ENABLE_FACE_1041 init_face_1041(registerWatchface_cb); -#endif -#ifdef ENABLE_FACE_1167 init_face_1167(registerWatchface_cb); -#endif -#ifdef ENABLE_FACE_1169 init_face_1169(registerWatchface_cb); -#endif -#ifdef ENABLE_FACE_2051 init_face_2051(registerWatchface_cb); -#endif -#ifdef ENABLE_FACE_2151 init_face_2151(registerWatchface_cb); -#endif -#ifdef ENABLE_FACE_3589 init_face_3589(registerWatchface_cb); -#endif + } void ui_update_watchfaces(int second, int minute, int hour, bool mode, bool am, int day, int month, int year, int weekday, int temp, int icon, int battery, bool connection, int steps, int distance, int kcal, int bpm, int oxygen) { -#ifdef ENABLE_FACE_34_2_DIAL + update_check_34_2_dial(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); -#endif -#ifdef ENABLE_FACE_75_2_DIAL update_check_75_2_dial(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); -#endif -#ifdef ENABLE_FACE_79_2_DIAL update_check_79_2_dial(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); -#endif -#ifdef ENABLE_FACE_116_2_DIAL update_check_116_2_dial(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); -#endif -#ifdef ENABLE_FACE_756_2_DIAL update_check_756_2_dial(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); -#endif -#ifdef ENABLE_FACE_B_W_RESIZED update_check_b_w_resized(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); -#endif -#ifdef ENABLE_FACE_KENYA update_check_kenya(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); -#endif -#ifdef ENABLE_FACE_PIXEL_RESIZED update_check_pixel_resized(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); -#endif -#ifdef ENABLE_FACE_RADAR update_check_radar(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); -#endif -#ifdef ENABLE_FACE_SMART_RESIZED update_check_smart_resized(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); -#endif -#ifdef ENABLE_FACE_TIX_RESIZED update_check_tix_resized(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); -#endif -#ifdef ENABLE_FACE_WFB_RESIZED update_check_wfb_resized(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); -#endif -#ifdef ENABLE_FACE_174 update_check_174(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); -#endif -#ifdef ENABLE_FACE_228 update_check_228(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); -#endif -#ifdef ENABLE_FACE_1041 update_check_1041(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); -#endif -#ifdef ENABLE_FACE_1167 update_check_1167(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); -#endif -#ifdef ENABLE_FACE_1169 update_check_1169(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); -#endif -#ifdef ENABLE_FACE_2051 update_check_2051(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); -#endif -#ifdef ENABLE_FACE_2151 update_check_2151(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); -#endif -#ifdef ENABLE_FACE_3589 update_check_3589(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen); -#endif } void ui_games_init(void)