state->timers[state->current_timer].unit.seconds);
watch_date_time target_dt = watch_utility_date_time_from_unix_time(state->target_ts, _get_tz_offset(settings));
state->mode = running;
- movement_schedule_background_task(target_dt);
+ movement_schedule_background_task_for_face(state->watch_face_index, target_dt);
watch_set_indicator(WATCH_INDICATOR_BELL);
- if (settings->bit.button_should_sound && with_beep) watch_buzzer_play_sequence((int8_t *)_sound_seq_start, NULL);
+ if (with_beep) watch_buzzer_play_sequence((int8_t *)_sound_seq_start, NULL);
}
static void _draw(timer_state_t *state, uint8_t subsecond) {
static void _reset(timer_state_t *state) {
state->mode = waiting;
- movement_cancel_background_task();
+ movement_cancel_background_task_for_face(state->watch_face_index);
watch_clear_indicator(WATCH_INDICATOR_BELL);
}
void timer_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(timer_state_t));
timer_state_t *state = (timer_state_t *)*context_ptr;
memset(*context_ptr, 0, sizeof(timer_state_t));
+ state->watch_face_index = watch_face_index;
for (uint8_t i = 0; i < sizeof(_default_timer_values) / sizeof(uint16_t); i++) {
state->timers[i].value = _default_timer_values[i];
}