From 32a49a5e11c94f6897d6d0b3cc1884d3f3107125 Mon Sep 17 00:00:00 2001 From: joeycastillo Date: Sun, 29 Sep 2024 13:27:35 -0400 Subject: [PATCH] rename stock_stopwatch -> fast_stopwatch --- movement/movement_faces.h | 2 +- .../complication/dual_timer_face.c | 6 ++-- .../complication/dual_timer_face.h | 2 +- .../watch_faces/complication/stopwatch_face.h | 2 +- movement_config.h | 2 +- movement_faces.h | 2 +- watch-faces.mk | 2 +- ...stopwatch_face.c => fast_stopwatch_face.c} | 18 ++++++------ ...stopwatch_face.h => fast_stopwatch_face.h} | 28 +++++++++---------- 9 files changed, 32 insertions(+), 32 deletions(-) rename watch-faces/complication/{stock_stopwatch_face.c => fast_stopwatch_face.c} (94%) rename watch-faces/complication/{stock_stopwatch_face.h => fast_stopwatch_face.h} (80%) diff --git a/movement/movement_faces.h b/movement/movement_faces.h index 630f264a..d13a34fa 100644 --- a/movement/movement_faces.h +++ b/movement/movement_faces.h @@ -64,7 +64,7 @@ #include "ratemeter_face.h" #include "rpn_calculator_alt_face.h" #include "weeknumber_clock_face.h" -#include "stock_stopwatch_face.h" +#include "fast_stopwatch_face.h" #include "tachymeter_face.h" #include "nanosec_face.h" #include "finetune_face.h" diff --git a/movement/watch_faces/complication/dual_timer_face.c b/movement/watch_faces/complication/dual_timer_face.c index aa91c701..e7bc5b3f 100644 --- a/movement/watch_faces/complication/dual_timer_face.c +++ b/movement/watch_faces/complication/dual_timer_face.c @@ -34,11 +34,11 @@ * IMPORTANT: This watch face uses the same TC2 callback counter as the Stock Stopwatch * watch-face. It works through calling a global handler function. The two watch-faces * therefore can't coexist within the same firmware. If you want to compile this watch-face - * then you need to remove the line <../watch_faces/complication/stock_stopwatch_face.c \> + * then you need to remove the line <../watch_faces/complication/fast_stopwatch_face.c \> * from the Makefile. */ -// FROM stock_stopwatch_face.c //////////////////////////////////////////////// +// FROM fast_stopwatch_face.c //////////////////////////////////////////////// // Copyright (c) 2022 Andreas Nebinger #if __EMSCRIPTEN__ @@ -107,7 +107,7 @@ static void _dual_timer_cb_initialize() { NVIC_EnableIRQ (TC2_IRQn); } -// you need to take stock_stopwatch.c out of the Makefile or this will create a conflict +// you need to take fast_stopwatch.c out of the Makefile or this will create a conflict // you have to choose between one of the stopwatches void TC2_Handler(void) { // interrupt handler for TC2 (globally!) diff --git a/movement/watch_faces/complication/dual_timer_face.h b/movement/watch_faces/complication/dual_timer_face.h index e1bd2d5a..ea8d3c4b 100644 --- a/movement/watch_faces/complication/dual_timer_face.h +++ b/movement/watch_faces/complication/dual_timer_face.h @@ -63,7 +63,7 @@ * IMPORTANT: This watch face uses the same TC2 callback counter as the Stock Stopwatch * watch-face. It works through calling a global handler function. The two watch-faces * therefore can't coexist within the same firmware. If you want to compile this watch-face - * then you need to remove the line <../watch_faces/complication/stock_stopwatch_face.c \> + * then you need to remove the line <../watch_faces/complication/fast_stopwatch_face.c \> * from the Makefile. */ diff --git a/movement/watch_faces/complication/stopwatch_face.h b/movement/watch_faces/complication/stopwatch_face.h index e3056283..cf0d8fe6 100644 --- a/movement/watch_faces/complication/stopwatch_face.h +++ b/movement/watch_faces/complication/stopwatch_face.h @@ -34,7 +34,7 @@ * when the timer is stopped resets it. * * This face does not count sub-seconds. - * See also: "stock_stopwatch_face.h" + * See also: "fast_stopwatch_face.h" */ #include "movement.h" diff --git a/movement_config.h b/movement_config.h index 632b4ee6..2fcf292d 100644 --- a/movement_config.h +++ b/movement_config.h @@ -29,7 +29,7 @@ const watch_face_t watch_faces[] = { clock_face, - stock_stopwatch_face, + fast_stopwatch_face, beats_face, world_clock_face, countdown_face, diff --git a/movement_faces.h b/movement_faces.h index 7c630a82..49c80c6e 100644 --- a/movement_faces.h +++ b/movement_faces.h @@ -29,7 +29,7 @@ #include "beats_face.h" #include "world_clock_face.h" #include "countdown_face.h" -#include "stock_stopwatch_face.h" +#include "fast_stopwatch_face.h" #include "set_time_face.h" #include "preferences_face.h" // New includes go above this line. diff --git a/watch-faces.mk b/watch-faces.mk index f5cb4cbe..65b775b6 100644 --- a/watch-faces.mk +++ b/watch-faces.mk @@ -4,6 +4,6 @@ SRCS += \ ./watch-faces/clock/beats_face.c \ ./watch-faces/clock/world_clock_face.c \ ./watch-faces/complication/countdown_face.c \ - ./watch-faces/complication/stock_stopwatch_face.c \ + ./watch-faces/complication/fast_stopwatch_face.c \ ./watch-faces/settings/set_time_face.c \ ./watch-faces/settings/preferences_face.c \ diff --git a/watch-faces/complication/stock_stopwatch_face.c b/watch-faces/complication/fast_stopwatch_face.c similarity index 94% rename from watch-faces/complication/stock_stopwatch_face.c rename to watch-faces/complication/fast_stopwatch_face.c index 7c86ffcf..1116898b 100644 --- a/watch-faces/complication/stock_stopwatch_face.c +++ b/watch-faces/complication/fast_stopwatch_face.c @@ -24,7 +24,7 @@ #include #include -#include "stock_stopwatch_face.h" +#include "fast_stopwatch_face.h" #include "watch.h" #include "watch_common_display.h" #include "watch_utility.h" @@ -209,12 +209,12 @@ static inline void _set_colon() { _colon = true; } -void stock_stopwatch_face_setup(uint8_t watch_face_index, void ** context_ptr) { +void fast_stopwatch_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { - *context_ptr = malloc(sizeof(stock_stopwatch_state_t)); - memset(*context_ptr, 0, sizeof(stock_stopwatch_state_t)); - stock_stopwatch_state_t *state = (stock_stopwatch_state_t *)*context_ptr; + *context_ptr = malloc(sizeof(fast_stopwatch_state_t)); + memset(*context_ptr, 0, sizeof(fast_stopwatch_state_t)); + fast_stopwatch_state_t *state = (fast_stopwatch_state_t *)*context_ptr; _ticks = _lap_ticks = _blink_ticks = _old_minutes = _old_seconds = _hours = 0; _is_running = _colon = false; state->light_on_button = true; @@ -225,7 +225,7 @@ void stock_stopwatch_face_setup(uint8_t watch_face_index, void ** context_ptr) { } } -void stock_stopwatch_face_activate(void *context) { +void fast_stopwatch_face_activate(void *context) { (void) context; if (_is_running) { // The background task will keep the watch from entering low energy mode while the stopwatch is on screen. @@ -233,8 +233,8 @@ void stock_stopwatch_face_activate(void *context) { } } -bool stock_stopwatch_face_loop(movement_event_t event, void *context) { - stock_stopwatch_state_t *state = (stock_stopwatch_state_t *)context; +bool fast_stopwatch_face_loop(movement_event_t event, void *context) { + fast_stopwatch_state_t *state = (fast_stopwatch_state_t *)context; // handle overflow of fast ticks while (_ticks >= (128 * 60 * 60)) { @@ -321,7 +321,7 @@ bool stock_stopwatch_face_loop(movement_event_t event, void *context) { return true; } -void stock_stopwatch_face_resign(void *context) { +void fast_stopwatch_face_resign(void *context) { (void) context; // cancel the keepalive task movement_cancel_background_task(); diff --git a/watch-faces/complication/stock_stopwatch_face.h b/watch-faces/complication/fast_stopwatch_face.h similarity index 80% rename from watch-faces/complication/stock_stopwatch_face.h rename to watch-faces/complication/fast_stopwatch_face.h index 349c166a..eac56651 100644 --- a/watch-faces/complication/stock_stopwatch_face.h +++ b/watch-faces/complication/fast_stopwatch_face.h @@ -22,8 +22,8 @@ * SOFTWARE. */ -#ifndef STOCK_STOPWATCH_FACE_H_ -#define STOCK_STOPWATCH_FACE_H_ +#ifndef FAST_STOPWATCH_FACE_H_ +#define FAST_STOPWATCH_FACE_H_ /* * STOCK STOPWATCH face @@ -45,7 +45,7 @@ * It either turns on with each button press or remains off. * * NOTE: - * This watch face relies heavily on static vars in stock_stopwatch.c. + * This watch face relies heavily on static vars in fast_stopwatch.c. * The disadvantage is that you cannot use more than one instance of this * watch face on your custom firmware - but then again, who would want that? * The advantage is that accessing vars is more direct and faster, and we @@ -56,12 +56,12 @@ typedef struct { bool light_on_button; // determines whether the light button actually triggers the led -} stock_stopwatch_state_t; +} fast_stopwatch_state_t; -void stock_stopwatch_face_setup(uint8_t watch_face_index, void ** context_ptr); -void stock_stopwatch_face_activate(void *context); -bool stock_stopwatch_face_loop(movement_event_t event, void *context); -void stock_stopwatch_face_resign(void *context); +void fast_stopwatch_face_setup(uint8_t watch_face_index, void ** context_ptr); +void fast_stopwatch_face_activate(void *context); +bool fast_stopwatch_face_loop(movement_event_t event, void *context); +void fast_stopwatch_face_resign(void *context); #if __EMSCRIPTEN__ void em_cb_handler(void *userData); @@ -69,12 +69,12 @@ void em_cb_handler(void *userData); void TC2_Handler(void); #endif -#define stock_stopwatch_face ((const watch_face_t){ \ - stock_stopwatch_face_setup, \ - stock_stopwatch_face_activate, \ - stock_stopwatch_face_loop, \ - stock_stopwatch_face_resign, \ +#define fast_stopwatch_face ((const watch_face_t){ \ + fast_stopwatch_face_setup, \ + fast_stopwatch_face_activate, \ + fast_stopwatch_face_loop, \ + fast_stopwatch_face_resign, \ NULL, \ }) -#endif // STOCK_STOPWATCH_FACE_H_ +#endif // FAST_STOPWATCH_FACE_H_