diff options
author | joeycastillo <joeycastillo@utexas.edu> | 2022-11-28 11:43:51 -0600 |
---|---|---|
committer | joeycastillo <joeycastillo@utexas.edu> | 2022-11-28 11:43:51 -0600 |
commit | 59260c25de8a68e6cfe77e554d23c29fcbae761d (patch) | |
tree | ad663abfd06aae042cb3e252e69aaf91f9c1c282 /movement | |
parent | 34d72e3296242a8dbbd82a21943cdd555c590a80 (diff) | |
download | Sensor-Watch-59260c25de8a68e6cfe77e554d23c29fcbae761d.tar.gz Sensor-Watch-59260c25de8a68e6cfe77e554d23c29fcbae761d.tar.bz2 Sensor-Watch-59260c25de8a68e6cfe77e554d23c29fcbae761d.zip |
allow setting default LED colors in movement_config
Diffstat (limited to 'movement')
-rw-r--r-- | movement/alt_fw/the_stargazer.h | 7 | ||||
-rw-r--r-- | movement/movement.c | 11 |
2 files changed, 12 insertions, 6 deletions
diff --git a/movement/alt_fw/the_stargazer.h b/movement/alt_fw/the_stargazer.h index 50a89aad..a13dc3ac 100644 --- a/movement/alt_fw/the_stargazer.h +++ b/movement/alt_fw/the_stargazer.h @@ -27,11 +27,8 @@ #include "movement_faces.h" -#define MOVEMENT_CUSTOM_BOOT_COMMANDS() { \ - movement_state.settings.bit.led_green_color = 0x0;\ - movement_state.settings.bit.led_red_color = 0xF;\ - watch_store_backup_data(movement_state.settings.reg, 0);\ -} +#define MOVEMENT_DEFAULT_RED_COLOR 0xF +#define MOVEMENT_DEFAULT_GREEN_COLOR 0x0 const watch_face_t watch_faces[] = { simple_clock_face, diff --git a/movement/movement.c b/movement/movement.c index 0ded11e3..25fa2c5c 100644 --- a/movement/movement.c +++ b/movement/movement.c @@ -57,6 +57,14 @@ #define MOVEMENT_SECONDARY_FACE_INDEX 0 #endif +// Set default LED colors if not set +#ifndef MOVEMENT_DEFAULT_RED_COLOR +#define MOVEMENT_DEFAULT_RED_COLOR 0x0 +#endif +#ifndef MOVEMENT_DEFAULT_GREEN_COLOR +#define MOVEMENT_DEFAULT_GREEN_COLOR 0xF +#endif + #if __EMSCRIPTEN__ #include <emscripten.h> #endif @@ -284,7 +292,8 @@ uint8_t movement_claim_backup_register(void) { void app_init(void) { memset(&movement_state, 0, sizeof(movement_state)); - movement_state.settings.bit.led_green_color = 0xF; + movement_state.settings.bit.led_red_color = MOVEMENT_DEFAULT_RED_COLOR; + movement_state.settings.bit.led_green_color = MOVEMENT_DEFAULT_GREEN_COLOR; movement_state.settings.bit.button_should_sound = true; movement_state.settings.bit.le_interval = 1; movement_state.settings.bit.led_duration = 1; |