From 002f5bc242a7d8a4a2aa371b685994ecb86aa2b7 Mon Sep 17 00:00:00 2001 From: David Volovskiy Date: Tue, 6 Aug 2024 07:05:19 -0400 Subject: [PATCH 1/9] Updated the tally couter face to allow for presets, negative numbers, fast scrolling, and toggling sound --- .../watch_faces/complication/tally_face.c | 145 ++++++++++++++++-- .../watch_faces/complication/tally_face.h | 21 ++- 2 files changed, 145 insertions(+), 21 deletions(-) diff --git a/movement/watch_faces/complication/tally_face.c b/movement/watch_faces/complication/tally_face.c index 896a54f..ca3ed32 100644 --- a/movement/watch_faces/complication/tally_face.c +++ b/movement/watch_faces/complication/tally_face.c @@ -27,44 +27,148 @@ #include "tally_face.h" #include "watch.h" +#define TALLY_FACE_MAX 9999 +#define TALLY_FACE_MIN -99 + +static bool _init_val; +static bool _quick_ticks_running; +static const int16_t _tally_default[] = {0, 40, 20}; +static const uint8_t _tally_default_size = sizeof(_tally_default) / sizeof(int16_t); + void tally_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { (void) settings; (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(tally_state_t)); memset(*context_ptr, 0, sizeof(tally_state_t)); + tally_state_t *state = (tally_state_t *)*context_ptr; + state->tally_default_idx = 0; + state->soundOff = true; + state->tally_idx = _tally_default[state->tally_default_idx]; + _init_val = true; } } void tally_face_activate(movement_settings_t *settings, void *context) { (void) settings; (void) context; + _quick_ticks_running = false; +} + +static void start_quick_cyc(void){ + _quick_ticks_running = true; + movement_request_tick_frequency(8); +} + +static void stop_quick_cyc(void){ + _quick_ticks_running = false; + movement_request_tick_frequency(1); +} + +static void tally_face_increment(tally_state_t *state) { + bool soundOn = !_quick_ticks_running && !state->soundOff; + _init_val = false; + if (state->tally_idx >= TALLY_FACE_MAX){ + if (soundOn) watch_buzzer_play_note(BUZZER_NOTE_E7, 30); + } + else { + state->tally_idx++; + print_tally(state); + if (soundOn) watch_buzzer_play_note(BUZZER_NOTE_E6, 30); + } +} + +static void tally_face_decrement(tally_state_t *state) { + bool soundOn = !_quick_ticks_running && !state->soundOff; + _init_val = false; + if (state->tally_idx <= TALLY_FACE_MIN){ + if (soundOn) watch_buzzer_play_note(BUZZER_NOTE_C5SHARP_D5FLAT, 30); + } + else { + state->tally_idx--; + print_tally(state); + if (soundOn) watch_buzzer_play_note(BUZZER_NOTE_C6SHARP_D6FLAT, 30); + } } bool tally_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { (void) settings; tally_state_t *state = (tally_state_t *)context; + static bool using_led = false; + + if (using_led) { + if(!watch_get_pin_level(BTN_MODE) && !watch_get_pin_level(BTN_LIGHT) && !watch_get_pin_level(BTN_ALARM)) + using_led = false; + else { + if (event.event_type == EVENT_LIGHT_BUTTON_DOWN || event.event_type == EVENT_ALARM_BUTTON_DOWN) + movement_illuminate_led(); + return true; + } + } switch (event.event_type) { - case EVENT_ALARM_BUTTON_UP: - // increment tally index - state->tally_idx++; - if (state->tally_idx > 999999) { //0-999,999 - //reset tally index and play a reset tune - state->tally_idx = 0; - watch_buzzer_play_note(BUZZER_NOTE_G6, 30); - watch_buzzer_play_note(BUZZER_NOTE_REST, 30); + case EVENT_TICK: + if (_quick_ticks_running) { + bool light_pressed = watch_get_pin_level(BTN_LIGHT); + bool alarm_pressed = watch_get_pin_level(BTN_ALARM); + if (light_pressed && alarm_pressed) stop_quick_cyc(); + else if (light_pressed) tally_face_increment(state); + else if (alarm_pressed) tally_face_decrement(state); + else stop_quick_cyc(); } - print_tally(state); - watch_buzzer_play_note(BUZZER_NOTE_E6, 30); + break; + case EVENT_ALARM_BUTTON_UP: + tally_face_decrement(state); break; case EVENT_ALARM_LONG_PRESS: - state->tally_idx = 0; // reset tally index - //play a reset tune - watch_buzzer_play_note(BUZZER_NOTE_G6, 30); - watch_buzzer_play_note(BUZZER_NOTE_REST, 30); - watch_buzzer_play_note(BUZZER_NOTE_E6, 30); - print_tally(state); + if (_init_val) { + state->soundOff = !state->soundOff; + if (!state->soundOff) watch_buzzer_play_note(BUZZER_NOTE_E6, 30); + print_tally(state); + } + else{ + tally_face_decrement(state); + start_quick_cyc(); + } + break; + case EVENT_MODE_LONG_PRESS: + if (state->tally_idx == _tally_default[state->tally_default_idx]) { + _init_val = true; + movement_move_to_face(0); + } + else { + state->tally_idx = _tally_default[state->tally_default_idx]; // reset tally index + _init_val = true; + //play a reset tune + if (!state->soundOff) watch_buzzer_play_note(BUZZER_NOTE_G6, 30); + if (!state->soundOff) watch_buzzer_play_note(BUZZER_NOTE_REST, 30); + if (!state->soundOff) watch_buzzer_play_note(BUZZER_NOTE_E6, 30); + print_tally(state); + } + break; + case EVENT_LIGHT_BUTTON_UP: + tally_face_increment(state); + break; + case EVENT_LIGHT_BUTTON_DOWN: + case EVENT_ALARM_BUTTON_DOWN: + if (watch_get_pin_level(BTN_MODE)) { + movement_illuminate_led(); + using_led = true; + } + break; + case EVENT_LIGHT_LONG_PRESS: + if (_init_val){ + state->tally_default_idx = (state->tally_default_idx + 1) % _tally_default_size; + state->tally_idx = _tally_default[state->tally_default_idx]; + if (!state->soundOff) watch_buzzer_play_note(BUZZER_NOTE_E6, 30); + if (!state->soundOff) watch_buzzer_play_note(BUZZER_NOTE_REST, 30); + if (!state->soundOff) watch_buzzer_play_note(BUZZER_NOTE_G6, 30); + print_tally(state); + } + else{ + tally_face_increment(state); + start_quick_cyc(); + } break; case EVENT_ACTIVATE: print_tally(state); @@ -83,7 +187,14 @@ bool tally_face_loop(movement_event_t event, movement_settings_t *settings, void // print tally index at the center of display. void print_tally(tally_state_t *state) { char buf[14]; - sprintf(buf, "TA %06d", (int)(state->tally_idx)); // center of LCD display + if (!state->soundOff) + watch_set_indicator(WATCH_INDICATOR_BELL); + else + watch_clear_indicator(WATCH_INDICATOR_BELL); + if (state->tally_idx >= 0) + sprintf(buf, "TA %4d ", (int)(state->tally_idx)); // center of LCD display + else + sprintf(buf, "TA %-3d", (int)(state->tally_idx)); // center of LCD display watch_display_string(buf, 0); } diff --git a/movement/watch_faces/complication/tally_face.h b/movement/watch_faces/complication/tally_face.h index 8096592..727d218 100644 --- a/movement/watch_faces/complication/tally_face.h +++ b/movement/watch_faces/complication/tally_face.h @@ -29,16 +29,29 @@ * TALLY face * * Tally face is designed to act as a tally counter. - * Based on the counter_face watch face by Shogo Okamoto. * - * To advance the counter, press the ALARM button. - * To reset, long press the ALARM button. + * Alarm + * Press: Decrement + * Hold : On initial value: Toggle Sound + * Else: Fast Decrement + * + * Light + * Press: Increment + * Hold : On initial value: Cycles through other initial values. + * Else: Fast Increment + * + * Mode + * Press: Next face + * Hold : On initial value: Go to first face. + * Else: Resets counter */ #include "movement.h" typedef struct { - uint32_t tally_idx; + int16_t tally_idx; + uint8_t tally_default_idx : 7; + bool soundOff; } tally_state_t; From c02ec307ff945e525bac73c19a1c5b8943a881fd Mon Sep 17 00:00:00 2001 From: David Volovskiy Date: Sun, 8 Sep 2024 11:44:01 -0400 Subject: [PATCH 2/9] Tally face sound now uses the preference's beep so decrementing fast can happen immedietly --- .../watch_faces/complication/tally_face.c | 57 ++++++++----------- .../watch_faces/complication/tally_face.h | 10 ++-- 2 files changed, 29 insertions(+), 38 deletions(-) diff --git a/movement/watch_faces/complication/tally_face.c b/movement/watch_faces/complication/tally_face.c index ca3ed32..32e3c52 100644 --- a/movement/watch_faces/complication/tally_face.c +++ b/movement/watch_faces/complication/tally_face.c @@ -43,7 +43,6 @@ void tally_face_setup(movement_settings_t *settings, uint8_t watch_face_index, v memset(*context_ptr, 0, sizeof(tally_state_t)); tally_state_t *state = (tally_state_t *)*context_ptr; state->tally_default_idx = 0; - state->soundOff = true; state->tally_idx = _tally_default[state->tally_default_idx]; _init_val = true; } @@ -65,34 +64,33 @@ static void stop_quick_cyc(void){ movement_request_tick_frequency(1); } -static void tally_face_increment(tally_state_t *state) { - bool soundOn = !_quick_ticks_running && !state->soundOff; +static void tally_face_increment(tally_state_t *state, bool sound_on) { + bool soundOn = !_quick_ticks_running && sound_on; _init_val = false; if (state->tally_idx >= TALLY_FACE_MAX){ if (soundOn) watch_buzzer_play_note(BUZZER_NOTE_E7, 30); } else { state->tally_idx++; - print_tally(state); + print_tally(state, sound_on); if (soundOn) watch_buzzer_play_note(BUZZER_NOTE_E6, 30); } } -static void tally_face_decrement(tally_state_t *state) { - bool soundOn = !_quick_ticks_running && !state->soundOff; +static void tally_face_decrement(tally_state_t *state, bool sound_on) { + bool soundOn = !_quick_ticks_running && sound_on; _init_val = false; if (state->tally_idx <= TALLY_FACE_MIN){ if (soundOn) watch_buzzer_play_note(BUZZER_NOTE_C5SHARP_D5FLAT, 30); } else { state->tally_idx--; - print_tally(state); + print_tally(state, sound_on); if (soundOn) watch_buzzer_play_note(BUZZER_NOTE_C6SHARP_D6FLAT, 30); } } bool tally_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; tally_state_t *state = (tally_state_t *)context; static bool using_led = false; @@ -112,24 +110,17 @@ bool tally_face_loop(movement_event_t event, movement_settings_t *settings, void bool light_pressed = watch_get_pin_level(BTN_LIGHT); bool alarm_pressed = watch_get_pin_level(BTN_ALARM); if (light_pressed && alarm_pressed) stop_quick_cyc(); - else if (light_pressed) tally_face_increment(state); - else if (alarm_pressed) tally_face_decrement(state); + else if (light_pressed) tally_face_increment(state, settings->bit.button_should_sound); + else if (alarm_pressed) tally_face_decrement(state, settings->bit.button_should_sound); else stop_quick_cyc(); } break; case EVENT_ALARM_BUTTON_UP: - tally_face_decrement(state); + tally_face_decrement(state, settings->bit.button_should_sound); break; case EVENT_ALARM_LONG_PRESS: - if (_init_val) { - state->soundOff = !state->soundOff; - if (!state->soundOff) watch_buzzer_play_note(BUZZER_NOTE_E6, 30); - print_tally(state); - } - else{ - tally_face_decrement(state); - start_quick_cyc(); - } + tally_face_decrement(state, settings->bit.button_should_sound); + start_quick_cyc(); break; case EVENT_MODE_LONG_PRESS: if (state->tally_idx == _tally_default[state->tally_default_idx]) { @@ -140,14 +131,14 @@ bool tally_face_loop(movement_event_t event, movement_settings_t *settings, void state->tally_idx = _tally_default[state->tally_default_idx]; // reset tally index _init_val = true; //play a reset tune - if (!state->soundOff) watch_buzzer_play_note(BUZZER_NOTE_G6, 30); - if (!state->soundOff) watch_buzzer_play_note(BUZZER_NOTE_REST, 30); - if (!state->soundOff) watch_buzzer_play_note(BUZZER_NOTE_E6, 30); - print_tally(state); + if (settings->bit.button_should_sound) watch_buzzer_play_note(BUZZER_NOTE_G6, 30); + if (settings->bit.button_should_sound) watch_buzzer_play_note(BUZZER_NOTE_REST, 30); + if (settings->bit.button_should_sound) watch_buzzer_play_note(BUZZER_NOTE_E6, 30); + print_tally(state, settings->bit.button_should_sound); } break; case EVENT_LIGHT_BUTTON_UP: - tally_face_increment(state); + tally_face_increment(state, settings->bit.button_should_sound); break; case EVENT_LIGHT_BUTTON_DOWN: case EVENT_ALARM_BUTTON_DOWN: @@ -160,18 +151,18 @@ bool tally_face_loop(movement_event_t event, movement_settings_t *settings, void if (_init_val){ state->tally_default_idx = (state->tally_default_idx + 1) % _tally_default_size; state->tally_idx = _tally_default[state->tally_default_idx]; - if (!state->soundOff) watch_buzzer_play_note(BUZZER_NOTE_E6, 30); - if (!state->soundOff) watch_buzzer_play_note(BUZZER_NOTE_REST, 30); - if (!state->soundOff) watch_buzzer_play_note(BUZZER_NOTE_G6, 30); - print_tally(state); + if (settings->bit.button_should_sound) watch_buzzer_play_note(BUZZER_NOTE_E6, 30); + if (settings->bit.button_should_sound) watch_buzzer_play_note(BUZZER_NOTE_REST, 30); + if (settings->bit.button_should_sound) watch_buzzer_play_note(BUZZER_NOTE_G6, 30); + print_tally(state, settings->bit.button_should_sound); } else{ - tally_face_increment(state); + tally_face_increment(state, settings->bit.button_should_sound); start_quick_cyc(); } break; case EVENT_ACTIVATE: - print_tally(state); + print_tally(state, settings->bit.button_should_sound); break; case EVENT_TIMEOUT: // ignore timeout @@ -185,9 +176,9 @@ bool tally_face_loop(movement_event_t event, movement_settings_t *settings, void } // print tally index at the center of display. -void print_tally(tally_state_t *state) { +void print_tally(tally_state_t *state, bool sound_on) { char buf[14]; - if (!state->soundOff) + if (sound_on) watch_set_indicator(WATCH_INDICATOR_BELL); else watch_clear_indicator(WATCH_INDICATOR_BELL); diff --git a/movement/watch_faces/complication/tally_face.h b/movement/watch_faces/complication/tally_face.h index 727d218..286f1c0 100644 --- a/movement/watch_faces/complication/tally_face.h +++ b/movement/watch_faces/complication/tally_face.h @@ -32,8 +32,7 @@ * * Alarm * Press: Decrement - * Hold : On initial value: Toggle Sound - * Else: Fast Decrement + * Hold : Fast Decrement * * Light * Press: Increment @@ -44,14 +43,15 @@ * Press: Next face * Hold : On initial value: Go to first face. * Else: Resets counter + * + * Incrementing or Decrementing the tally will beep if Beeping is set in the global Preferences */ #include "movement.h" typedef struct { int16_t tally_idx; - uint8_t tally_default_idx : 7; - bool soundOff; + uint8_t tally_default_idx; } tally_state_t; @@ -60,7 +60,7 @@ void tally_face_activate(movement_settings_t *settings, void *context); bool tally_face_loop(movement_event_t event, movement_settings_t *settings, void *context); void tally_face_resign(movement_settings_t *settings, void *context); -void print_tally(tally_state_t *state); +void print_tally(tally_state_t *state, bool sound_on); #define tally_face ((const watch_face_t){ \ tally_face_setup, \ From 137906e14ac1f37c6d6399db5a30a77a814a6725 Mon Sep 17 00:00:00 2001 From: David Volovskiy Date: Sun, 8 Sep 2024 17:23:53 -0400 Subject: [PATCH 3/9] Added more presets to the tally face --- movement/watch_faces/complication/tally_face.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/movement/watch_faces/complication/tally_face.c b/movement/watch_faces/complication/tally_face.c index 32e3c52..3893fc7 100644 --- a/movement/watch_faces/complication/tally_face.c +++ b/movement/watch_faces/complication/tally_face.c @@ -32,7 +32,7 @@ static bool _init_val; static bool _quick_ticks_running; -static const int16_t _tally_default[] = {0, 40, 20}; +static const int16_t _tally_default[] = {0, 100, 40, 20, 10}; static const uint8_t _tally_default_size = sizeof(_tally_default) / sizeof(int16_t); void tally_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { From 531bcfd28593f15476f129056986bccaeea2879b Mon Sep 17 00:00:00 2001 From: Matheus Afonso Martins Moreira Date: Sun, 8 Sep 2024 18:38:53 -0300 Subject: [PATCH 4/9] faces/tally: make mtg presets optin via macros Use preprocessor macros to conditionally compile in Magic the Gathering initial value presets for the tally mark, thereby making them opt in. --- movement/watch_faces/complication/tally_face.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/movement/watch_faces/complication/tally_face.c b/movement/watch_faces/complication/tally_face.c index 3893fc7..fb44df2 100644 --- a/movement/watch_faces/complication/tally_face.c +++ b/movement/watch_faces/complication/tally_face.c @@ -32,7 +32,17 @@ static bool _init_val; static bool _quick_ticks_running; -static const int16_t _tally_default[] = {0, 100, 40, 20, 10}; + +static const int16_t _tally_default[] = { + 0, + +#ifdef TALLY_FACE_PRESETS_MTG + 20, + 40, +#endif /* TALLY_FACE_PRESETS_MTG */ + +}; + static const uint8_t _tally_default_size = sizeof(_tally_default) / sizeof(int16_t); void tally_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { From 6b7ea8bbaa44c7b553cbcc06f65dfcefdd425330 Mon Sep 17 00:00:00 2001 From: Matheus Afonso Martins Moreira Date: Sun, 8 Sep 2024 18:39:55 -0300 Subject: [PATCH 5/9] faces/tally: add yugioh life point presets Add common Yu-Gi-Oh card game life point preset values for the tally face, opt in by defining a preprocessor macro. --- movement/watch_faces/complication/tally_face.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/movement/watch_faces/complication/tally_face.c b/movement/watch_faces/complication/tally_face.c index fb44df2..4da36cb 100644 --- a/movement/watch_faces/complication/tally_face.c +++ b/movement/watch_faces/complication/tally_face.c @@ -41,6 +41,11 @@ static const int16_t _tally_default[] = { 40, #endif /* TALLY_FACE_PRESETS_MTG */ +#ifdef TALLY_FACE_PRESETS_YUGIOH + 4000, + 8000, +#endif /* TALLY_FACE_PRESETS_YUGIOH */ + }; static const uint8_t _tally_default_size = sizeof(_tally_default) / sizeof(int16_t); From e4e0b611f33fc99d410fb5049302aafce9ff7a6c Mon Sep 17 00:00:00 2001 From: Matheus Afonso Martins Moreira Date: Sun, 8 Sep 2024 18:49:09 -0300 Subject: [PATCH 6/9] faces/tally: avoid resetting counters Don't reset the counters unless there are multiple presets. Move back to the first face directly if there are no presets to cycle through. --- movement/watch_faces/complication/tally_face.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/movement/watch_faces/complication/tally_face.c b/movement/watch_faces/complication/tally_face.c index 4da36cb..b2c553f 100644 --- a/movement/watch_faces/complication/tally_face.c +++ b/movement/watch_faces/complication/tally_face.c @@ -105,10 +105,15 @@ static void tally_face_decrement(tally_state_t *state, bool sound_on) { } } +static bool tally_face_should_move_back(tally_state_t *state) { + if (_tally_default_size <= 1) { return false; } + return state->tally_idx == _tally_default[state->tally_default_idx]; +} + bool tally_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { tally_state_t *state = (tally_state_t *)context; static bool using_led = false; - + if (using_led) { if(!watch_get_pin_level(BTN_MODE) && !watch_get_pin_level(BTN_LIGHT) && !watch_get_pin_level(BTN_ALARM)) using_led = false; @@ -118,7 +123,7 @@ bool tally_face_loop(movement_event_t event, movement_settings_t *settings, void return true; } } - + switch (event.event_type) { case EVENT_TICK: if (_quick_ticks_running) { @@ -138,7 +143,7 @@ bool tally_face_loop(movement_event_t event, movement_settings_t *settings, void start_quick_cyc(); break; case EVENT_MODE_LONG_PRESS: - if (state->tally_idx == _tally_default[state->tally_default_idx]) { + if (tally_face_should_move_back(state)) { _init_val = true; movement_move_to_face(0); } From 7a4424b2d4ae477b5bfb74ddc35a4708d03c9997 Mon Sep 17 00:00:00 2001 From: Matheus Afonso Martins Moreira Date: Sun, 8 Sep 2024 18:53:42 -0300 Subject: [PATCH 7/9] faces/tally: convert size into compile time const Creates a macro that returns the size of the presets array, converting it into a compile time constant value that occupies no memory and that compilers can constant fold into other expressions potentially leading to dead code elimination. --- movement/watch_faces/complication/tally_face.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/movement/watch_faces/complication/tally_face.c b/movement/watch_faces/complication/tally_face.c index b2c553f..7267b16 100644 --- a/movement/watch_faces/complication/tally_face.c +++ b/movement/watch_faces/complication/tally_face.c @@ -48,7 +48,7 @@ static const int16_t _tally_default[] = { }; -static const uint8_t _tally_default_size = sizeof(_tally_default) / sizeof(int16_t); +#define TALLY_FACE_PRESETS_SIZE() (sizeof(_tally_default) / sizeof(int16_t)) void tally_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { (void) settings; @@ -106,7 +106,7 @@ static void tally_face_decrement(tally_state_t *state, bool sound_on) { } static bool tally_face_should_move_back(tally_state_t *state) { - if (_tally_default_size <= 1) { return false; } + if (TALLY_FACE_PRESETS_SIZE() <= 1) { return false; } return state->tally_idx == _tally_default[state->tally_default_idx]; } @@ -169,7 +169,7 @@ bool tally_face_loop(movement_event_t event, movement_settings_t *settings, void break; case EVENT_LIGHT_LONG_PRESS: if (_init_val){ - state->tally_default_idx = (state->tally_default_idx + 1) % _tally_default_size; + state->tally_default_idx = (state->tally_default_idx + 1) % TALLY_FACE_PRESETS_SIZE(); state->tally_idx = _tally_default[state->tally_default_idx]; if (settings->bit.button_should_sound) watch_buzzer_play_note(BUZZER_NOTE_E6, 30); if (settings->bit.button_should_sound) watch_buzzer_play_note(BUZZER_NOTE_REST, 30); From a539bd7da77d036d4f31f0d009f86bd653187ab6 Mon Sep 17 00:00:00 2001 From: David Volovskiy Date: Sun, 8 Sep 2024 18:03:16 -0400 Subject: [PATCH 8/9] Don't try to cycle through presets if the preset count is one --- movement/watch_faces/complication/tally_face.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/movement/watch_faces/complication/tally_face.c b/movement/watch_faces/complication/tally_face.c index 7267b16..3ea5503 100644 --- a/movement/watch_faces/complication/tally_face.c +++ b/movement/watch_faces/complication/tally_face.c @@ -168,7 +168,7 @@ bool tally_face_loop(movement_event_t event, movement_settings_t *settings, void } break; case EVENT_LIGHT_LONG_PRESS: - if (_init_val){ + if (TALLY_FACE_PRESETS_SIZE() > 1 && _init_val){ state->tally_default_idx = (state->tally_default_idx + 1) % TALLY_FACE_PRESETS_SIZE(); state->tally_idx = _tally_default[state->tally_default_idx]; if (settings->bit.button_should_sound) watch_buzzer_play_note(BUZZER_NOTE_E6, 30); From 22c25f5c239e982507a6ed1e3c527164b7b1d1c6 Mon Sep 17 00:00:00 2001 From: David Volovskiy Date: Sun, 8 Sep 2024 18:09:38 -0400 Subject: [PATCH 9/9] Added commented-out defines for MTG and Yugioh --- movement/watch_faces/complication/tally_face.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/movement/watch_faces/complication/tally_face.h b/movement/watch_faces/complication/tally_face.h index 286f1c0..80623f4 100644 --- a/movement/watch_faces/complication/tally_face.h +++ b/movement/watch_faces/complication/tally_face.h @@ -54,6 +54,9 @@ typedef struct { uint8_t tally_default_idx; } tally_state_t; +//#define TALLY_FACE_PRESETS_MTG +//#define TALLY_FACE_PRESETS_YUGIOH + void tally_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); void tally_face_activate(movement_settings_t *settings, void *context);