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