[FIX] properly use animation_timer

This commit is contained in:
Marius Alwan Meyer 2023-06-01 21:20:08 +02:00
parent ae6715c8ed
commit 774281a0b0

View File

@ -20,11 +20,11 @@ static uint16_t animation_timer = 0;
#define SLEEP_TIMEOUT 30000
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
animation_timer = timer_read();
if (!is_keyboard_master()) {
return OLED_ROTATION_0; // flips the display 180 degrees if offhand
}
return OLED_ROTATION_270;
animation_timer = timer_read();
}
@ -471,7 +471,6 @@ bool oled_task_user(void) {
return false;
}
if (is_keyboard_master()) {
animation_timer = timer_read();
// Renders the current keyboard state (layers and mods)
render_logo();
render_logo_text();
@ -482,12 +481,9 @@ bool oled_task_user(void) {
render_mod_status_ctrl_shift(get_mods()|get_oneshot_mods());
render_kb_LED_state();
} else {
// time for the next frame?
if (timer_elapsed(animation_timer) > FRAME_TIMEOUT) {
animation_timer = timer_read();
render_space_animation();
}
render_space_animation();
}
animation_timer = timer_read();
return false;
}
#endif