diff options
Diffstat (limited to 'keyboards/horrortroll/handwired_k552/handwired_k552.c')
| -rw-r--r-- | keyboards/horrortroll/handwired_k552/handwired_k552.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/keyboards/horrortroll/handwired_k552/handwired_k552.c b/keyboards/horrortroll/handwired_k552/handwired_k552.c new file mode 100644 index 000000000..31012d8a3 --- /dev/null +++ b/keyboards/horrortroll/handwired_k552/handwired_k552.c | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | /* Copyright 2021 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 "handwired_k552.h" | ||
| 18 | |||
| 19 | // OLED animation | ||
| 20 | #include "lib/logo.c" | ||
| 21 | |||
| 22 | #ifdef RGB_MATRIX_ENABLE | ||
| 23 | led_config_t g_led_config = { { | ||
| 24 | { } | ||
| 25 | }, { | ||
| 26 | {152, 0}, {165, 0}, {190, 0}, {205, 0}, | ||
| 27 | {224, 21}, {224, 43}, {224, 54}, | ||
| 28 | {188, 64}, {172, 64}, {156, 64}, {140, 64}, {115, 64}, {99 , 64}, {75 , 64}, {59 , 64}, {43 , 64}, {26 , 64}, | ||
| 29 | {0 , 15}, {0 , 50}, {0 , 39}, | ||
| 30 | {18 , 0}, {36 , 0}, {57 , 0}, {67 , 0} | ||
| 31 | }, { | ||
| 32 | 2, 2, 2, 2, 2, 2, 2, 2, | ||
| 33 | 2, 2, | ||
| 34 | 2, 2, | ||
| 35 | 2, 2, | ||
| 36 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
| 37 | } }; | ||
| 38 | #endif | ||
| 39 | |||
| 40 | #ifdef OLED_ENABLE | ||
| 41 | uint16_t startup_timer; | ||
| 42 | |||
| 43 | oled_rotation_t oled_init_kb(oled_rotation_t rotation) { | ||
| 44 | startup_timer = timer_read(); | ||
| 45 | |||
| 46 | return rotation; | ||
| 47 | } | ||
| 48 | |||
| 49 | bool oled_task_kb(void) { | ||
| 50 | static bool finished_logo = false; | ||
| 51 | |||
| 52 | if ((timer_elapsed(startup_timer) < 5000) && !finished_logo) { | ||
| 53 | render_logo(); | ||
| 54 | } else { | ||
| 55 | finished_logo = true; | ||
| 56 | |||
| 57 | if (!oled_task_user()) { | ||
| 58 | return false; | ||
| 59 | } | ||
| 60 | } | ||
| 61 | |||
| 62 | return true; | ||
| 63 | } | ||
| 64 | #endif | ||
