movement: day one watch face, counts days from birth

This commit is contained in:
Joey Castillo
2021-11-08 09:50:54 -06:00
parent 61f479db5a
commit 1b4bfe35c2
4 changed files with 210 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
#ifndef DAY_ONE_FACE_H_
#define DAY_ONE_FACE_H_
#include "movement.h"
// The Day One face is designed to count upwards from the wearer's date of birth. It also functions as an
// interface for setting the birth date register, which other watch faces can use for various purposes.
typedef struct {
uint8_t current_page;
uint16_t current_year;
uint16_t birth_year;
uint8_t birth_month;
uint8_t birth_day;
bool birthday_changed;
} day_one_state_t;
void day_one_face_setup(movement_settings_t *settings, void ** context_ptr);
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);
void day_one_face_resign(movement_settings_t *settings, void *context);
static const watch_face_t day_one_face = {
day_one_face_setup,
day_one_face_activate,
day_one_face_loop,
day_one_face_resign,
NULL
};
#endif // DAY_ONE_FACE_H_