handwired_k552.c (1314B)
1 /* Copyright 2022 HorrorTroll <https://github.com/HorrorTroll> 2 * 3 * This program is free software: you can redistribute it and/or modify 4 * it under the terms of the GNU General Public License as published by 5 * the Free Software Foundation, either version 2 of the License, or 6 * (at your option) any later version. 7 * 8 * This program is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * GNU General Public License for more details. 12 * 13 * You should have received a copy of the GNU General Public License 14 * along with this program. If not, see <http://www.gnu.org/licenses/>. 15 */ 16 17 #include "quantum.h" 18 19 // OLED animation 20 #include "lib/logo.h" 21 22 #ifdef OLED_ENABLE 23 uint16_t startup_timer; 24 25 oled_rotation_t oled_init_kb(oled_rotation_t rotation) { 26 startup_timer = timer_read(); 27 28 return rotation; 29 } 30 31 bool oled_task_kb(void) { 32 static bool finished_logo = false; 33 34 if ((timer_elapsed(startup_timer) < 5000) && !finished_logo) { 35 render_logo(); 36 } else { 37 finished_logo = true; 38 39 if (!oled_task_user()) { 40 return false; 41 } 42 } 43 44 return true; 45 } 46 #endif