Skip to content

Commit 3aad4c7

Browse files
committed
surround faces init and update with enable pragmas
1 parent 79b6823 commit 3aad4c7

File tree

2 files changed

+82
-24
lines changed

2 files changed

+82
-24
lines changed

src/ui/ui.c

Lines changed: 82 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include "ui.h"
77
#include "ui_helpers.h"
8+
#include "app_hal.h"
89

910
#include "./faces/34_2_dial/34_2_dial.h"
1011
#include "./faces/75_2_dial/75_2_dial.h"
@@ -2799,56 +2800,134 @@ void ui_watchfaces_init(void)
27992800
numFaces = 0;
28002801
registerWatchface_cb("Default", &digital_preview, &ui_clockScreen); // register the default watchface
28012802

2802-
// register other watchfaces by initializing them and passing the register callback
2803+
// Register other watchfaces by initializing them and passing the register callback
2804+
#ifdef ENABLE_FACE_34_2_DIAL
28032805
init_face_34_2_dial(registerWatchface_cb);
2806+
#endif
2807+
#ifdef ENABLE_FACE_75_2_DIAL
28042808
init_face_75_2_dial(registerWatchface_cb);
2809+
#endif
2810+
#ifdef ENABLE_FACE_79_2_DIAL
28052811
init_face_79_2_dial(registerWatchface_cb);
2812+
#endif
2813+
#ifdef ENABLE_FACE_116_2_DIAL
28062814
init_face_116_2_dial(registerWatchface_cb);
2815+
#endif
2816+
#ifdef ENABLE_FACE_756_2_DIAL
28072817
init_face_756_2_dial(registerWatchface_cb);
2818+
#endif
2819+
#ifdef ENABLE_FACE_B_W_RESIZED
28082820
init_face_b_w_resized(registerWatchface_cb);
2821+
#endif
2822+
#ifdef ENABLE_FACE_KENYA
28092823
init_face_kenya(registerWatchface_cb);
2824+
#endif
2825+
#ifdef ENABLE_FACE_PIXEL_RESIZED
28102826
init_face_pixel_resized(registerWatchface_cb);
2827+
#endif
2828+
#ifdef ENABLE_FACE_RADAR
28112829
init_face_radar(registerWatchface_cb);
2830+
#endif
2831+
#ifdef ENABLE_FACE_SMART_RESIZED
28122832
init_face_smart_resized(registerWatchface_cb);
2833+
#endif
2834+
#ifdef ENABLE_FACE_TIX_RESIZED
28132835
init_face_tix_resized(registerWatchface_cb);
2836+
#endif
2837+
#ifdef ENABLE_FACE_WFB_RESIZED
28142838
init_face_wfb_resized(registerWatchface_cb);
2839+
#endif
28152840

2841+
#ifdef ENABLE_FACE_174
28162842
init_face_174(registerWatchface_cb);
2843+
#endif
2844+
#ifdef ENABLE_FACE_228
28172845
init_face_228(registerWatchface_cb);
2846+
#endif
2847+
#ifdef ENABLE_FACE_1041
28182848
init_face_1041(registerWatchface_cb);
2849+
#endif
2850+
#ifdef ENABLE_FACE_1167
28192851
init_face_1167(registerWatchface_cb);
2852+
#endif
2853+
#ifdef ENABLE_FACE_1169
28202854
init_face_1169(registerWatchface_cb);
2855+
#endif
2856+
#ifdef ENABLE_FACE_2051
28212857
init_face_2051(registerWatchface_cb);
2858+
#endif
2859+
#ifdef ENABLE_FACE_2151
28222860
init_face_2151(registerWatchface_cb);
2861+
#endif
2862+
#ifdef ENABLE_FACE_3589
28232863
init_face_3589(registerWatchface_cb);
2824-
2864+
#endif
28252865
}
28262866

28272867
void ui_update_watchfaces(int second, int minute, int hour, bool mode, bool am, int day, int month, int year, int weekday,
28282868
int temp, int icon, int battery, bool connection, int steps, int distance, int kcal, int bpm, int oxygen)
28292869
{
2830-
2870+
#ifdef ENABLE_FACE_34_2_DIAL
28312871
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);
2872+
#endif
2873+
#ifdef ENABLE_FACE_75_2_DIAL
28322874
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);
2875+
#endif
2876+
#ifdef ENABLE_FACE_79_2_DIAL
28332877
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);
2878+
#endif
2879+
#ifdef ENABLE_FACE_116_2_DIAL
28342880
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);
2881+
#endif
2882+
#ifdef ENABLE_FACE_756_2_DIAL
28352883
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);
2884+
#endif
2885+
#ifdef ENABLE_FACE_B_W_RESIZED
28362886
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);
2887+
#endif
2888+
#ifdef ENABLE_FACE_KENYA
28372889
update_check_kenya(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen);
2890+
#endif
2891+
#ifdef ENABLE_FACE_PIXEL_RESIZED
28382892
update_check_pixel_resized(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen);
2893+
#endif
2894+
#ifdef ENABLE_FACE_RADAR
28392895
update_check_radar(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen);
2896+
#endif
2897+
#ifdef ENABLE_FACE_SMART_RESIZED
28402898
update_check_smart_resized(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen);
2899+
#endif
2900+
#ifdef ENABLE_FACE_TIX_RESIZED
28412901
update_check_tix_resized(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen);
2902+
#endif
2903+
#ifdef ENABLE_FACE_WFB_RESIZED
28422904
update_check_wfb_resized(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen);
2905+
#endif
28432906

2907+
#ifdef ENABLE_FACE_174
28442908
update_check_174(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen);
2909+
#endif
2910+
#ifdef ENABLE_FACE_228
28452911
update_check_228(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen);
2912+
#endif
2913+
#ifdef ENABLE_FACE_1041
28462914
update_check_1041(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen);
2915+
#endif
2916+
#ifdef ENABLE_FACE_1167
28472917
update_check_1167(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen);
2918+
#endif
2919+
#ifdef ENABLE_FACE_1169
28482920
update_check_1169(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen);
2921+
#endif
2922+
#ifdef ENABLE_FACE_2051
28492923
update_check_2051(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen);
2924+
#endif
2925+
#ifdef ENABLE_FACE_2151
28502926
update_check_2151(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen);
2927+
#endif
2928+
#ifdef ENABLE_FACE_3589
28512929
update_check_3589(ui_home, second, minute, hour, mode, am, day, month, year, weekday, temp, icon, battery, connection, steps, distance, kcal, bpm, oxygen);
2930+
#endif
28522931
}
28532932

28542933
void ui_games_init(void)

src/ui/ui.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -213,27 +213,6 @@ extern "C"
213213
void ui_games_update(void);
214214
void showError(const char *title, const char *message);
215215

216-
// Required Watch face declarations.
217-
218-
void init_face_174(void (*registerWatchface_cb)());
219-
void init_face_228(void (*registerWatchface_cb)());
220-
void init_face_1041(void (*registerWatchface_cb)());
221-
void init_face_1167(void (*registerWatchface_cb)());
222-
void init_face_1169(void (*registerWatchface_cb)());
223-
void init_face_2051(void (*registerWatchface_cb)());
224-
void init_face_2151(void (*registerWatchface_cb)());
225-
void init_face_3589(void (*registerWatchface_cb)());
226-
227-
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);
228-
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);
229-
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);
230-
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);
231-
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);
232-
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);
233-
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);
234-
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);
235-
236-
237216
// LV_IMG_DECLARE(ui_img_753022056); // assets\night-sky.png
238217
LV_IMG_DECLARE(ui_img_602195540); // assets\dy-6.png
239218
LV_IMG_DECLARE(ui_img_wechat_png); // assets\wechat.png

0 commit comments

Comments
 (0)