tarot: avoid mandatory function call on every tick (#185)

This commit is contained in:
Jeremy O'Brien 2023-01-23 15:15:57 -05:00 committed by GitHub
parent 8d20b46fec
commit 3cd8e5c47e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -179,7 +179,6 @@ static void pick_cards(tarot_state_t *state) {
}
static void display_animation(tarot_state_t *state) {
if (state->is_picking) {
if (state->animation_frame == 0) {
watch_display_string(" ", 7);
watch_set_pixel(1, 4);
@ -203,7 +202,6 @@ static void display_animation(tarot_state_t *state) {
movement_request_tick_frequency(1);
tarot_display(state);
}
}
}
@ -246,7 +244,9 @@ bool tarot_face_loop(movement_event_t event, movement_settings_t *settings, void
tarot_display(state);
break;
case EVENT_TICK:
if (state->is_picking) {
display_animation(state);
}
break;
case EVENT_MODE_BUTTON_UP:
movement_move_to_next_face();