Added rough draft of watch_face script to generate custom watch faces from template. Corrected template file's missing includes and incorrect memset placeholder.

This commit is contained in:
David Keck
2022-01-26 18:59:48 -05:00
parent 725f17bfb6
commit 23610430b3
2 changed files with 76 additions and 1 deletions

View File

@@ -22,13 +22,15 @@
* SOFTWARE.
*/
#include <stdlib.h>
#include <string.h>
#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.