summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoey Castillo <joeycastillo@utexas.edu>2022-04-21 15:37:12 -0400
committerJoey Castillo <joeycastillo@utexas.edu>2022-04-21 15:37:12 -0400
commite36af0e5a368290848cec413c799d499e266a0c4 (patch)
tree79bd91f0df40ff2e5a397ad322dd397686a67fa9
parentc78b8d4570436fbbad3be66ec5801736dc462895 (diff)
downloadSensor-Watch-e36af0e5a368290848cec413c799d499e266a0c4.tar.gz
Sensor-Watch-e36af0e5a368290848cec413c799d499e266a0c4.tar.bz2
Sensor-Watch-e36af0e5a368290848cec413c799d499e266a0c4.zip
movement: only run custom commands at first launch
-rw-r--r--movement/alt_fw/the_stargazer.h1
-rw-r--r--movement/movement.c8
2 files changed, 5 insertions, 4 deletions
diff --git a/movement/alt_fw/the_stargazer.h b/movement/alt_fw/the_stargazer.h
index edf49ffa..50a89aad 100644
--- a/movement/alt_fw/the_stargazer.h
+++ b/movement/alt_fw/the_stargazer.h
@@ -30,6 +30,7 @@
#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);\
}
const watch_face_t watch_faces[] = {
diff --git a/movement/movement.c b/movement/movement.c
index c3beec87..4a5bc04e 100644
--- a/movement/movement.c
+++ b/movement/movement.c
@@ -268,15 +268,15 @@ void app_wake_from_backup(void) {
}
void app_setup(void) {
- #ifdef MOVEMENT_CUSTOM_BOOT_COMMANDS
- MOVEMENT_CUSTOM_BOOT_COMMANDS()
- #endif
-
watch_store_backup_data(movement_state.settings.reg, 0);
static bool is_first_launch = true;
if (is_first_launch) {
+ #ifdef MOVEMENT_CUSTOM_BOOT_COMMANDS
+ MOVEMENT_CUSTOM_BOOT_COMMANDS()
+ #endif
+
for(uint8_t i = 0; i < MOVEMENT_NUM_FACES; i++) {
watch_face_contexts[i] = NULL;
scheduled_tasks[i].reg = 0;