From 23610430b31bce8e147080d9a9d660b98e28b418 Mon Sep 17 00:00:00 2001 From: David Keck Date: Wed, 26 Jan 2022 18:59:48 -0500 Subject: Added rough draft of watch_face script to generate custom watch faces from template. Corrected template file's missing includes and incorrect memset placeholder. --- movement/template/template.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'movement/template/template.c') diff --git a/movement/template/template.c b/movement/template/template.c index 3f60be97..34c6dbf5 100644 --- a/movement/template/template.c +++ b/movement/template/template.c @@ -22,13 +22,15 @@ * SOFTWARE. */ +#include +#include #include "<#watch_face_name#>_face.h" void <#watch_face_name#>_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { (void) settings; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(<#watch_face_name#>_state_t)); - memset(*context_ptr, 0, sizeof(<#watch_face_name#>)); + memset(*context_ptr, 0, sizeof(<#watch_face_name#>_state_t)); // Do any one-time tasks in here; the inside of this conditional happens only at boot. } // Do any pin or peripheral setup here; this will be called whenever the watch wakes from deep sleep. -- cgit v1.2.3 From cc2696c71a3cfc0e76f5daeafbde20cdc8790324 Mon Sep 17 00:00:00 2001 From: David Keck Date: Wed, 26 Jan 2022 19:12:12 -0500 Subject: added missing newlines to template files --- movement/template/template.c | 1 + 1 file changed, 1 insertion(+) (limited to 'movement/template/template.c') diff --git a/movement/template/template.c b/movement/template/template.c index 34c6dbf5..8a77d6c3 100644 --- a/movement/template/template.c +++ b/movement/template/template.c @@ -89,3 +89,4 @@ void <#watch_face_name#>_face_resign(movement_settings_t *settings, void *contex // handle any cleanup before your watch face goes off-screen. } + -- cgit v1.2.3 From c130f13bb802c91d65c7ad96a49976678e76ac2b Mon Sep 17 00:00:00 2001 From: David Keck Date: Wed, 26 Jan 2022 19:15:16 -0500 Subject: minor typo fix --- movement/template/template.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'movement/template/template.c') diff --git a/movement/template/template.c b/movement/template/template.c index 8a77d6c3..c9c174b6 100644 --- a/movement/template/template.c +++ b/movement/template/template.c @@ -78,7 +78,7 @@ bool <#watch_face_name#>_face_loop(movement_event_t event, movement_settings_t * break; } - // return true if the watch can enter standby mode. If you are PWM'ing an LED or buzzing the buzzer nere, + // return true if the watch can enter standby mode. If you are PWM'ing an LED or buzzing the buzzer here, // you should return false since the PWM driver does not operate in standby mode. return true; } -- cgit v1.2.3