refactor: watch faces no longer need a pointer to settings!

This commit is contained in:
joeycastillo
2024-09-29 09:59:49 -04:00
parent 3bd8f8d51f
commit e88359d1d5
201 changed files with 1180 additions and 1553 deletions

View File

@@ -26,8 +26,7 @@
#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;
void <#watch_face_name#>_face_setup(uint8_t watch_face_index, void ** context_ptr) {
(void) watch_face_index;
if (*context_ptr == NULL) {
*context_ptr = malloc(sizeof(<#watch_face_name#>_state_t));
@@ -37,14 +36,13 @@ void <#watch_face_name#>_face_setup(movement_settings_t *settings, uint8_t watch
// Do any pin or peripheral setup here; this will be called whenever the watch wakes from deep sleep.
}
void <#watch_face_name#>_face_activate(movement_settings_t *settings, void *context) {
(void) settings;
void <#watch_face_name#>_face_activate(void *context) {
<#watch_face_name#>_state_t *state = (<#watch_face_name#>_state_t *)context;
// Handle any tasks related to your watch face coming on screen.
}
bool <#watch_face_name#>_face_loop(movement_event_t event, movement_settings_t *settings, void *context) {
bool <#watch_face_name#>_face_loop(movement_event_t event, void *context) {
<#watch_face_name#>_state_t *state = (<#watch_face_name#>_state_t *)context;
switch (event.event_type) {
@@ -79,7 +77,7 @@ bool <#watch_face_name#>_face_loop(movement_event_t event, movement_settings_t *
// * EVENT_MODE_BUTTON_UP moves to the next watch face in the list
// * EVENT_MODE_LONG_PRESS returns to the first watch face (or skips to the secondary watch face, if configured)
// You can override any of these behaviors by adding a case for these events to this switch statement.
return movement_default_loop_handler(event, settings);
return movement_default_loop_handler(event);
}
// return true if the watch can enter standby mode. Generally speaking, you should always return true.
@@ -91,8 +89,7 @@ bool <#watch_face_name#>_face_loop(movement_event_t event, movement_settings_t *
return true;
}
void <#watch_face_name#>_face_resign(movement_settings_t *settings, void *context) {
(void) settings;
void <#watch_face_name#>_face_resign(void *context) {
(void) context;
// handle any cleanup before your watch face goes off-screen.