diff options
author | Joey Castillo <joeycastillo@utexas.edu> | 2022-02-12 22:23:13 -0500 |
---|---|---|
committer | Joey Castillo <joeycastillo@utexas.edu> | 2022-02-13 11:25:28 -0500 |
commit | 96017d6ec1816ab1c9bd95b0308b908b4708d388 (patch) | |
tree | f2f6fcca2e479910712a64afaf46fa098bc95ca8 /movement/movement.c | |
parent | b8cb6f3bcf52d5c94f1cc99879deaceb9cbaf7b5 (diff) | |
download | Sensor-Watch-96017d6ec1816ab1c9bd95b0308b908b4708d388.tar.gz Sensor-Watch-96017d6ec1816ab1c9bd95b0308b908b4708d388.tar.bz2 Sensor-Watch-96017d6ec1816ab1c9bd95b0308b908b4708d388.zip |
movement: add mechanism for watch faces to use backup registers
Diffstat (limited to 'movement/movement.c')
-rw-r--r-- | movement/movement.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/movement/movement.c b/movement/movement.c index 42b73526..8185458c 100644 --- a/movement/movement.c +++ b/movement/movement.c @@ -216,6 +216,11 @@ void movement_play_alarm(void) { _movement_enable_fast_tick_if_needed(); } +uint8_t movement_claim_backup_register(void) { + if (movement_state.next_available_backup_register >= 8) return 0; + return movement_state.next_available_backup_register++; +} + void app_init(void) { memset(&movement_state, 0, sizeof(movement_state)); @@ -226,6 +231,7 @@ void app_init(void) { movement_state.settings.bit.time_zone = 16; // default to GMT movement_state.light_ticks = -1; movement_state.alarm_ticks = -1; + movement_state.next_available_backup_register = 4; _movement_reset_inactivity_countdown(); #if __EMSCRIPTEN__ |