remove the animation timer
All checks were successful
Build / build-sporq (push) Successful in 1m47s

This commit is contained in:
Marius Alwan Meyer 2023-06-04 21:22:19 +02:00
parent c64366b44d
commit e7e0609f8f

View File

@ -467,9 +467,6 @@ static void render_layer_state(void) {
// End of aurora corne things // End of aurora corne things
// point to render_left() or render_right() after olet_int_user() ran
void (*render)(void);
void render_left(void) { void render_left(void) {
// Renders the current keyboard state (layers and mods) // Renders the current keyboard state (layers and mods)
render_logo(); render_logo();
@ -485,7 +482,8 @@ void render_right(void) {
render_space_animation(); render_space_animation();
} }
static uint16_t animation_timer; // point to render_left() or render_right() after olet_int_user() ran
void (*render)(void);
oled_rotation_t oled_init_user(oled_rotation_t rotation) { oled_rotation_t oled_init_user(oled_rotation_t rotation) {
// define what's rendered on each half // define what's rendered on each half
@ -496,15 +494,10 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
render = render_right; render = render_right;
rotation = OLED_ROTATION_0; rotation = OLED_ROTATION_0;
} }
animation_timer = timer_read();
return rotation; return rotation;
} }
bool oled_task_user(void) { bool oled_task_user(void) {
if (timer_elapsed(animation_timer) < FRAME_TIMEOUT) {
return false;
}
(*render)(); // call render_left() or render_right() (*render)(); // call render_left() or render_right()
animation_timer = timer_read();
return false; return false;
} }