Movement: give watch faces their index at setup time
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user