Movement: give watch faces their index at setup time
This commit is contained in:
parent
03e107b81a
commit
60fe969191
@ -91,7 +91,7 @@ typedef struct {
|
|||||||
Finally, we define the four required functions, and define the watch face struct that users will use to add the face to their watch:
|
Finally, we define the four required functions, and define the watch face struct that users will use to add the face to their watch:
|
||||||
|
|
||||||
```c
|
```c
|
||||||
void pulsometer_face_setup(movement_settings_t *settings, void ** context_ptr);
|
void pulsometer_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
|
||||||
void pulsometer_face_activate(movement_settings_t *settings, void *context);
|
void pulsometer_face_activate(movement_settings_t *settings, void *context);
|
||||||
bool pulsometer_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
bool pulsometer_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
||||||
void pulsometer_face_resign(movement_settings_t *settings, void *context);
|
void pulsometer_face_resign(movement_settings_t *settings, void *context);
|
||||||
@ -119,7 +119,7 @@ These define the tick frequency: when the pulsometer widget is updating the scre
|
|||||||
#### Watch Face Setup
|
#### Watch Face Setup
|
||||||
|
|
||||||
```c
|
```c
|
||||||
void pulsometer_face_setup(movement_settings_t *settings, void ** context_ptr) {
|
void pulsometer_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
|
||||||
(void) settings;
|
(void) settings;
|
||||||
if (*context_ptr == NULL) *context_ptr = malloc(sizeof(pulsometer_state_t));
|
if (*context_ptr == NULL) *context_ptr = malloc(sizeof(pulsometer_state_t));
|
||||||
}
|
}
|
||||||
|
@ -218,7 +218,7 @@ void app_setup(void) {
|
|||||||
movement_request_tick_frequency(1);
|
movement_request_tick_frequency(1);
|
||||||
|
|
||||||
for(uint8_t i = 0; i < MOVEMENT_NUM_FACES; i++) {
|
for(uint8_t i = 0; i < MOVEMENT_NUM_FACES; i++) {
|
||||||
watch_faces[i].setup(&movement_state.settings, &watch_face_contexts[i]);
|
watch_faces[i].setup(&movement_state.settings, i, &watch_face_contexts[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
watch_faces[movement_state.current_watch_face].activate(&movement_state.settings, watch_face_contexts[movement_state.current_watch_face]);
|
watch_faces[movement_state.current_watch_face].activate(&movement_state.settings, watch_face_contexts[movement_state.current_watch_face]);
|
||||||
|
@ -120,7 +120,7 @@ extern const char movement_valid_position_1_chars[];
|
|||||||
* data required for your watch face.
|
* data required for your watch face.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
typedef void (*watch_face_setup)(movement_settings_t *settings, void ** context_ptr);
|
typedef void (*watch_face_setup)(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
|
||||||
|
|
||||||
/** @brief Prepare to go on-screen.
|
/** @brief Prepare to go on-screen.
|
||||||
* @details This function is called just before your watch enters the foreground. If your watch face has any
|
* @details This function is called just before your watch enters the foreground. If your watch face has any
|
||||||
|
@ -3,8 +3,9 @@
|
|||||||
#include "watch.h"
|
#include "watch.h"
|
||||||
#include "watch_utility.h"
|
#include "watch_utility.h"
|
||||||
|
|
||||||
void simple_clock_face_setup(movement_settings_t *settings, void ** context_ptr) {
|
void simple_clock_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
|
||||||
(void) settings;
|
(void) settings;
|
||||||
|
(void) watch_face_index;
|
||||||
// the only context we need is the timestamp of the previous tick.
|
// the only context we need is the timestamp of the previous tick.
|
||||||
if (*context_ptr == NULL) *context_ptr = malloc(sizeof(uint32_t));
|
if (*context_ptr == NULL) *context_ptr = malloc(sizeof(uint32_t));
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "movement.h"
|
#include "movement.h"
|
||||||
|
|
||||||
void simple_clock_face_setup(movement_settings_t *settings, void ** context_ptr);
|
void simple_clock_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
|
||||||
void simple_clock_face_activate(movement_settings_t *settings, void *context);
|
void simple_clock_face_activate(movement_settings_t *settings, void *context);
|
||||||
bool simple_clock_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
bool simple_clock_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
||||||
void simple_clock_face_resign(movement_settings_t *settings, void *context);
|
void simple_clock_face_resign(movement_settings_t *settings, void *context);
|
||||||
|
@ -4,8 +4,9 @@
|
|||||||
#include "watch.h"
|
#include "watch.h"
|
||||||
#include "watch_utility.h"
|
#include "watch_utility.h"
|
||||||
|
|
||||||
void world_clock_face_setup(movement_settings_t *settings, void ** context_ptr) {
|
void world_clock_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
|
||||||
(void) settings;
|
(void) settings;
|
||||||
|
(void) watch_face_index;
|
||||||
if (*context_ptr == NULL) {
|
if (*context_ptr == NULL) {
|
||||||
*context_ptr = malloc(sizeof(world_clock_state_t));
|
*context_ptr = malloc(sizeof(world_clock_state_t));
|
||||||
world_clock_state_t *state = (world_clock_state_t *)*context_ptr;
|
world_clock_state_t *state = (world_clock_state_t *)*context_ptr;
|
||||||
|
@ -15,7 +15,7 @@ typedef struct {
|
|||||||
uint32_t previous_date_time;
|
uint32_t previous_date_time;
|
||||||
} world_clock_state_t;
|
} world_clock_state_t;
|
||||||
|
|
||||||
void world_clock_face_setup(movement_settings_t *settings, void ** context_ptr);
|
void world_clock_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
|
||||||
void world_clock_face_activate(movement_settings_t *settings, void *context);
|
void world_clock_face_activate(movement_settings_t *settings, void *context);
|
||||||
bool world_clock_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
bool world_clock_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
||||||
void world_clock_face_resign(movement_settings_t *settings, void *context);
|
void world_clock_face_resign(movement_settings_t *settings, void *context);
|
||||||
|
@ -5,8 +5,9 @@
|
|||||||
|
|
||||||
const uint8_t BEAT_REFRESH_FREQUENCY = 8;
|
const uint8_t BEAT_REFRESH_FREQUENCY = 8;
|
||||||
|
|
||||||
void beats_face_setup(movement_settings_t *settings, void ** context_ptr) {
|
void beats_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
|
||||||
(void) settings;
|
(void) settings;
|
||||||
|
(void) watch_face_index;
|
||||||
(void) context_ptr;
|
(void) context_ptr;
|
||||||
if (*context_ptr == NULL) {
|
if (*context_ptr == NULL) {
|
||||||
*context_ptr = malloc(sizeof(beats_face_state_t));
|
*context_ptr = malloc(sizeof(beats_face_state_t));
|
||||||
|
@ -9,7 +9,7 @@ typedef struct {
|
|||||||
} beats_face_state_t;
|
} beats_face_state_t;
|
||||||
|
|
||||||
uint32_t clock2beats(uint32_t hours, uint32_t minutes, uint32_t seconds, uint32_t subseconds, int16_t utc_offset);
|
uint32_t clock2beats(uint32_t hours, uint32_t minutes, uint32_t seconds, uint32_t subseconds, int16_t utc_offset);
|
||||||
void beats_face_setup(movement_settings_t *settings, void ** context_ptr);
|
void beats_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
|
||||||
void beats_face_activate(movement_settings_t *settings, void *context);
|
void beats_face_activate(movement_settings_t *settings, void *context);
|
||||||
bool beats_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
bool beats_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
||||||
void beats_face_resign(movement_settings_t *settings, void *context);
|
void beats_face_resign(movement_settings_t *settings, void *context);
|
||||||
|
@ -17,8 +17,9 @@ static void _day_one_face_update(day_one_state_t state) {
|
|||||||
watch_display_string(buf, 0);
|
watch_display_string(buf, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void day_one_face_setup(movement_settings_t *settings, void ** context_ptr) {
|
void day_one_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
|
||||||
(void) settings;
|
(void) settings;
|
||||||
|
(void) watch_face_index;
|
||||||
if (*context_ptr == NULL) {
|
if (*context_ptr == NULL) {
|
||||||
*context_ptr = malloc(sizeof(day_one_state_t));
|
*context_ptr = malloc(sizeof(day_one_state_t));
|
||||||
memset(*context_ptr, 0, sizeof(day_one_state_t));
|
memset(*context_ptr, 0, sizeof(day_one_state_t));
|
||||||
|
@ -15,7 +15,7 @@ typedef struct {
|
|||||||
bool birthday_changed;
|
bool birthday_changed;
|
||||||
} day_one_state_t;
|
} day_one_state_t;
|
||||||
|
|
||||||
void day_one_face_setup(movement_settings_t *settings, void ** context_ptr);
|
void day_one_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
|
||||||
void day_one_face_activate(movement_settings_t *settings, void *context);
|
void day_one_face_activate(movement_settings_t *settings, void *context);
|
||||||
bool day_one_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
bool day_one_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
||||||
void day_one_face_resign(movement_settings_t *settings, void *context);
|
void day_one_face_resign(movement_settings_t *settings, void *context);
|
||||||
|
@ -6,8 +6,9 @@
|
|||||||
#define PULSOMETER_FACE_FREQUENCY_FACTOR (4ul) // refresh rate will be 2 to this power Hz (0 for 1 Hz, 2 for 4 Hz, etc.)
|
#define PULSOMETER_FACE_FREQUENCY_FACTOR (4ul) // refresh rate will be 2 to this power Hz (0 for 1 Hz, 2 for 4 Hz, etc.)
|
||||||
#define PULSOMETER_FACE_FREQUENCY (1 << PULSOMETER_FACE_FREQUENCY_FACTOR)
|
#define PULSOMETER_FACE_FREQUENCY (1 << PULSOMETER_FACE_FREQUENCY_FACTOR)
|
||||||
|
|
||||||
void pulsometer_face_setup(movement_settings_t *settings, void ** context_ptr) {
|
void pulsometer_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
|
||||||
(void) settings;
|
(void) settings;
|
||||||
|
(void) watch_face_index;
|
||||||
if (*context_ptr == NULL) *context_ptr = malloc(sizeof(pulsometer_state_t));
|
if (*context_ptr == NULL) *context_ptr = malloc(sizeof(pulsometer_state_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ typedef struct {
|
|||||||
int16_t ticks;
|
int16_t ticks;
|
||||||
} pulsometer_state_t;
|
} pulsometer_state_t;
|
||||||
|
|
||||||
void pulsometer_face_setup(movement_settings_t *settings, void ** context_ptr);
|
void pulsometer_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
|
||||||
void pulsometer_face_activate(movement_settings_t *settings, void *context);
|
void pulsometer_face_activate(movement_settings_t *settings, void *context);
|
||||||
bool pulsometer_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
bool pulsometer_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
||||||
void pulsometer_face_resign(movement_settings_t *settings, void *context);
|
void pulsometer_face_resign(movement_settings_t *settings, void *context);
|
||||||
|
@ -3,8 +3,9 @@
|
|||||||
#include "stopwatch_face.h"
|
#include "stopwatch_face.h"
|
||||||
#include "watch.h"
|
#include "watch.h"
|
||||||
|
|
||||||
void stopwatch_face_setup(movement_settings_t *settings, void ** context_ptr) {
|
void stopwatch_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
|
||||||
(void) settings;
|
(void) settings;
|
||||||
|
(void) watch_face_index;
|
||||||
if (*context_ptr == NULL) *context_ptr = malloc(sizeof(stopwatch_state_t));
|
if (*context_ptr == NULL) *context_ptr = malloc(sizeof(stopwatch_state_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ typedef struct {
|
|||||||
uint8_t hours;
|
uint8_t hours;
|
||||||
} stopwatch_state_t;
|
} stopwatch_state_t;
|
||||||
|
|
||||||
void stopwatch_face_setup(movement_settings_t *settings, void ** context_ptr);
|
void stopwatch_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
|
||||||
void stopwatch_face_activate(movement_settings_t *settings, void *context);
|
void stopwatch_face_activate(movement_settings_t *settings, void *context);
|
||||||
bool stopwatch_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
bool stopwatch_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
||||||
void stopwatch_face_resign(movement_settings_t *settings, void *context);
|
void stopwatch_face_resign(movement_settings_t *settings, void *context);
|
||||||
|
@ -17,8 +17,9 @@ static uint8_t hmacKey[] = {0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x21, 0xde, 0xad, 0xbe
|
|||||||
|
|
||||||
static const uint32_t TIMESTEP = 30;
|
static const uint32_t TIMESTEP = 30;
|
||||||
|
|
||||||
void totp_face_setup(movement_settings_t *settings, void ** context_ptr) {
|
void totp_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
|
||||||
(void) settings;
|
(void) settings;
|
||||||
|
(void) watch_face_index;
|
||||||
if (*context_ptr == NULL) *context_ptr = malloc(sizeof(totp_state_t));
|
if (*context_ptr == NULL) *context_ptr = malloc(sizeof(totp_state_t));
|
||||||
TOTP(hmacKey, sizeof(hmacKey), TIMESTEP);
|
TOTP(hmacKey, sizeof(hmacKey), TIMESTEP);
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ typedef struct {
|
|||||||
|
|
||||||
} totp_state_t;
|
} totp_state_t;
|
||||||
|
|
||||||
void totp_face_setup(movement_settings_t *settings, void ** context_ptr);
|
void totp_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
|
||||||
void totp_face_activate(movement_settings_t *settings, void *context);
|
void totp_face_activate(movement_settings_t *settings, void *context);
|
||||||
bool totp_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
bool totp_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
||||||
void totp_face_resign(movement_settings_t *settings, void *context);
|
void totp_face_resign(movement_settings_t *settings, void *context);
|
||||||
|
@ -3,8 +3,9 @@
|
|||||||
#include "character_set_face.h"
|
#include "character_set_face.h"
|
||||||
#include "watch.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) settings;
|
||||||
|
(void) watch_face_index;
|
||||||
if (*context_ptr == NULL) *context_ptr = malloc(sizeof(char));
|
if (*context_ptr == NULL) *context_ptr = malloc(sizeof(char));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "movement.h"
|
#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);
|
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);
|
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);
|
void character_set_face_resign(movement_settings_t *settings, void *context);
|
||||||
|
@ -14,8 +14,9 @@ typedef enum {
|
|||||||
DEMO_FACE_NUM_FACES
|
DEMO_FACE_NUM_FACES
|
||||||
} demo_face_index_t;
|
} 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) settings;
|
||||||
|
(void) watch_face_index;
|
||||||
if (*context_ptr == NULL) {
|
if (*context_ptr == NULL) {
|
||||||
*context_ptr = malloc(sizeof(demo_face_index_t));
|
*context_ptr = malloc(sizeof(demo_face_index_t));
|
||||||
memset(*context_ptr, 0, sizeof(demo_face_index_t));
|
memset(*context_ptr, 0, sizeof(demo_face_index_t));
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "movement.h"
|
#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);
|
void demo_face_activate(movement_settings_t *settings, void *context);
|
||||||
bool demo_face_loop(movement_event_t event, 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);
|
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;
|
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) settings;
|
||||||
|
(void) watch_face_index;
|
||||||
if (*context_ptr == NULL) {
|
if (*context_ptr == NULL) {
|
||||||
*context_ptr = malloc(sizeof(lis2dh_logger_state_t));
|
*context_ptr = malloc(sizeof(lis2dh_logger_state_t));
|
||||||
memset(*context_ptr, 0, 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_data_point_t data[LIS2DH_LOGGING_NUM_DATA_POINTS];
|
||||||
} lis2dh_logger_state_t;
|
} 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);
|
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);
|
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);
|
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);
|
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) settings;
|
||||||
|
(void) watch_face_index;
|
||||||
(void) context_ptr;
|
(void) context_ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "movement.h"
|
#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);
|
void voltage_face_activate(movement_settings_t *settings, void *context);
|
||||||
bool voltage_face_loop(movement_event_t event, 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);
|
void voltage_face_resign(movement_settings_t *settings, void *context);
|
||||||
|
@ -17,8 +17,9 @@ const char preferences_face_titles[PREFERENCES_FACE_NUM_PREFEFENCES][11] = {
|
|||||||
"LT red ", // Light: red component
|
"LT red ", // Light: red component
|
||||||
};
|
};
|
||||||
|
|
||||||
void preferences_face_setup(movement_settings_t *settings, void ** context_ptr) {
|
void preferences_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
|
||||||
(void) settings;
|
(void) settings;
|
||||||
|
(void) watch_face_index;
|
||||||
if (*context_ptr == NULL) *context_ptr = malloc(sizeof(uint8_t));
|
if (*context_ptr == NULL) *context_ptr = malloc(sizeof(uint8_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "movement.h"
|
#include "movement.h"
|
||||||
|
|
||||||
void preferences_face_setup(movement_settings_t *settings, void ** context_ptr);
|
void preferences_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
|
||||||
void preferences_face_activate(movement_settings_t *settings, void *context);
|
void preferences_face_activate(movement_settings_t *settings, void *context);
|
||||||
bool preferences_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
bool preferences_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
||||||
void preferences_face_resign(movement_settings_t *settings, void *context);
|
void preferences_face_resign(movement_settings_t *settings, void *context);
|
||||||
|
@ -5,8 +5,9 @@
|
|||||||
#define SET_TIME_FACE_NUM_SETTINGS (7)
|
#define SET_TIME_FACE_NUM_SETTINGS (7)
|
||||||
const char set_time_face_titles[SET_TIME_FACE_NUM_SETTINGS][3] = {"HR", "M1", "SE", "YR", "MO", "DA", "ZO"};
|
const char set_time_face_titles[SET_TIME_FACE_NUM_SETTINGS][3] = {"HR", "M1", "SE", "YR", "MO", "DA", "ZO"};
|
||||||
|
|
||||||
void set_time_face_setup(movement_settings_t *settings, void ** context_ptr) {
|
void set_time_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
|
||||||
(void) settings;
|
(void) settings;
|
||||||
|
(void) watch_face_index;
|
||||||
if (*context_ptr == NULL) *context_ptr = malloc(sizeof(uint8_t));
|
if (*context_ptr == NULL) *context_ptr = malloc(sizeof(uint8_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "movement.h"
|
#include "movement.h"
|
||||||
|
|
||||||
void set_time_face_setup(movement_settings_t *settings, void ** context_ptr);
|
void set_time_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
|
||||||
void set_time_face_activate(movement_settings_t *settings, void *context);
|
void set_time_face_activate(movement_settings_t *settings, void *context);
|
||||||
bool set_time_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
bool set_time_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
||||||
void set_time_face_resign(movement_settings_t *settings, void *context);
|
void set_time_face_resign(movement_settings_t *settings, void *context);
|
||||||
|
@ -48,8 +48,9 @@ static void _thermistor_logging_face_update_display(thermistor_logger_state_t *l
|
|||||||
watch_display_string(buf, 0);
|
watch_display_string(buf, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void thermistor_logging_face_setup(movement_settings_t *settings, void ** context_ptr) {
|
void thermistor_logging_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
|
||||||
(void) settings;
|
(void) settings;
|
||||||
|
(void) watch_face_index;
|
||||||
if (*context_ptr == NULL) {
|
if (*context_ptr == NULL) {
|
||||||
*context_ptr = malloc(sizeof(thermistor_logger_state_t));
|
*context_ptr = malloc(sizeof(thermistor_logger_state_t));
|
||||||
memset(*context_ptr, 0, sizeof(thermistor_logger_state_t));
|
memset(*context_ptr, 0, sizeof(thermistor_logger_state_t));
|
||||||
|
@ -18,7 +18,7 @@ typedef struct {
|
|||||||
thermistor_logger_data_point_t data[THERMISTOR_LOGGING_NUM_DATA_POINTS];
|
thermistor_logger_data_point_t data[THERMISTOR_LOGGING_NUM_DATA_POINTS];
|
||||||
} thermistor_logger_state_t;
|
} thermistor_logger_state_t;
|
||||||
|
|
||||||
void thermistor_logging_face_setup(movement_settings_t *settings, void ** context_ptr);
|
void thermistor_logging_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
|
||||||
void thermistor_logging_face_activate(movement_settings_t *settings, void *context);
|
void thermistor_logging_face_activate(movement_settings_t *settings, void *context);
|
||||||
bool thermistor_logging_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
bool thermistor_logging_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
||||||
void thermistor_logging_face_resign(movement_settings_t *settings, void *context);
|
void thermistor_logging_face_resign(movement_settings_t *settings, void *context);
|
||||||
|
@ -17,8 +17,9 @@ static void _thermistor_readout_face_update_display(bool in_fahrenheit) {
|
|||||||
thermistor_driver_disable();
|
thermistor_driver_disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
void thermistor_readout_face_setup(movement_settings_t *settings, void ** context_ptr) {
|
void thermistor_readout_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
|
||||||
(void) settings;
|
(void) settings;
|
||||||
|
(void) watch_face_index;
|
||||||
(void) context_ptr;
|
(void) context_ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "movement.h"
|
#include "movement.h"
|
||||||
|
|
||||||
void thermistor_readout_face_setup(movement_settings_t *settings, void ** context_ptr);
|
void thermistor_readout_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
|
||||||
void thermistor_readout_face_activate(movement_settings_t *settings, void *context);
|
void thermistor_readout_face_activate(movement_settings_t *settings, void *context);
|
||||||
bool thermistor_readout_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
bool thermistor_readout_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
||||||
void thermistor_readout_face_resign(movement_settings_t *settings, void *context);
|
void thermistor_readout_face_resign(movement_settings_t *settings, void *context);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user