Movement: give watch faces their index at setup time

This commit is contained in:
Joey Castillo
2021-12-20 17:02:17 -06:00
parent 03e107b81a
commit 60fe969191
33 changed files with 49 additions and 34 deletions

View File

@@ -3,8 +3,9 @@
#include "character_set_face.h"
#include "watch.h"
void character_set_face_setup(movement_settings_t *settings, void ** context_ptr) {
void character_set_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(char));
}

View File

@@ -3,7 +3,7 @@
#include "movement.h"
void character_set_face_setup(movement_settings_t *settings, void ** context_ptr);
void character_set_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
void character_set_face_activate(movement_settings_t *settings, void *context);
bool character_set_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
void character_set_face_resign(movement_settings_t *settings, void *context);

View File

@@ -14,8 +14,9 @@ typedef enum {
DEMO_FACE_NUM_FACES
} demo_face_index_t;
void demo_face_setup(movement_settings_t *settings, void ** context_ptr) {
void demo_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(demo_face_index_t));
memset(*context_ptr, 0, sizeof(demo_face_index_t));

View File

@@ -3,7 +3,7 @@
#include "movement.h"
void demo_face_setup(movement_settings_t *settings, void ** context_ptr);
void demo_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
void demo_face_activate(movement_settings_t *settings, void *context);
bool demo_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
void demo_face_resign(movement_settings_t *settings, void *context);

View File

@@ -86,8 +86,9 @@ static void _lis2dh_logging_face_log_data(lis2dh_logger_state_t *logger_state) {
logger_state->z_interrupts_this_hour = 0;
}
void lis2dh_logging_face_setup(movement_settings_t *settings, void ** context_ptr) {
void lis2dh_logging_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(lis2dh_logger_state_t));
memset(*context_ptr, 0, sizeof(lis2dh_logger_state_t));

View File

@@ -25,7 +25,7 @@ typedef struct {
lis2dh_logger_data_point_t data[LIS2DH_LOGGING_NUM_DATA_POINTS];
} lis2dh_logger_state_t;
void lis2dh_logging_face_setup(movement_settings_t *settings, void ** context_ptr);
void lis2dh_logging_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
void lis2dh_logging_face_activate(movement_settings_t *settings, void *context);
bool lis2dh_logging_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
void lis2dh_logging_face_resign(movement_settings_t *settings, void *context);

View File

@@ -11,8 +11,9 @@ static void _voltage_face_update_display(void) {
watch_display_string(buf, 0);
}
void voltage_face_setup(movement_settings_t *settings, void ** context_ptr) {
void voltage_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
(void) settings;
(void) watch_face_index;
(void) context_ptr;
}

View File

@@ -3,7 +3,7 @@
#include "movement.h"
void voltage_face_setup(movement_settings_t *settings, void ** context_ptr);
void voltage_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
void voltage_face_activate(movement_settings_t *settings, void *context);
bool voltage_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
void voltage_face_resign(movement_settings_t *settings, void *context);