diff options
author | HorrorTroll <sonicvipduc@gmail.com> | 2022-01-10 17:21:53 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-10 02:21:53 -0800 |
commit | f59cbfb75c0b161187d22d07b58e242ef225611a (patch) | |
tree | 3a4670bce76e5f98b0bb5278a0d073392919a36f /keyboards/handwired | |
parent | c5728aebeeb75e0069642f984d579e4691ec9677 (diff) | |
download | qmk_firmware-f59cbfb75c0b161187d22d07b58e242ef225611a.tar.gz qmk_firmware-f59cbfb75c0b161187d22d07b58e242ef225611a.zip |
[Keyboard] Added Handwired Redragon K552 Kumara (RGB) (#14004)
* Added Handwired Redragon K552 with default and via keymaps
* Resolve some request changes, and change the cols pin to a better one.
* Resolved request changes
* Added OLED support and resolve request change
* Increase polling rate to 1000hz
* Update font for OLED, and change logo
* Added LED Underglow support
* Add personal custom keymap
* Nit some line, to get better way to look on code
* Refactor everything and solved some issue.
* Resolved issue
Diffstat (limited to 'keyboards/handwired')
41 files changed, 3126 insertions, 0 deletions
diff --git a/keyboards/handwired/horrortroll/k552/boards/k552/board.c b/keyboards/handwired/horrortroll/k552/boards/k552/board.c new file mode 100644 index 000000000..65269520e --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/boards/k552/board.c | |||
@@ -0,0 +1,49 @@ | |||
1 | /* | ||
2 | ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio | ||
3 | |||
4 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | you may not use this file except in compliance with the License. | ||
6 | You may obtain a copy of the License at | ||
7 | |||
8 | http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | |||
10 | Unless required by applicable law or agreed to in writing, software | ||
11 | distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | See the License for the specific language governing permissions and | ||
14 | limitations under the License. | ||
15 | */ | ||
16 | |||
17 | #include <hal.h> | ||
18 | |||
19 | /** | ||
20 | * @brief PAL setup. | ||
21 | * @details Digital I/O ports static configuration as defined in @p board.h. | ||
22 | * This variable is used by the HAL when initializing the PAL driver. | ||
23 | */ | ||
24 | #if HAL_USE_PAL || defined(__DOXYGEN__) | ||
25 | const PALConfig pal_default_config = | ||
26 | { | ||
27 | {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH}, | ||
28 | {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH}, | ||
29 | {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH}, | ||
30 | {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH}, | ||
31 | }; | ||
32 | #endif | ||
33 | |||
34 | /* | ||
35 | * Early initialization code. | ||
36 | * This initialization must be performed just after stack setup and before | ||
37 | * any other initialization. | ||
38 | */ | ||
39 | void __early_init(void) { | ||
40 | stm32_clock_init(); | ||
41 | |||
42 | } | ||
43 | |||
44 | /* | ||
45 | * Board-specific initialization code. | ||
46 | */ | ||
47 | void boardInit(void) { | ||
48 | |||
49 | } | ||
diff --git a/keyboards/handwired/horrortroll/k552/boards/k552/board.h b/keyboards/handwired/horrortroll/k552/boards/k552/board.h new file mode 100644 index 000000000..f9b38b0ca --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/boards/k552/board.h | |||
@@ -0,0 +1,145 @@ | |||
1 | /* | ||
2 | ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio | ||
3 | |||
4 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | you may not use this file except in compliance with the License. | ||
6 | You may obtain a copy of the License at | ||
7 | |||
8 | http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | |||
10 | Unless required by applicable law or agreed to in writing, software | ||
11 | distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | See the License for the specific language governing permissions and | ||
14 | limitations under the License. | ||
15 | */ | ||
16 | |||
17 | #ifndef _BOARD_H_ | ||
18 | #define _BOARD_H_ | ||
19 | |||
20 | /* | ||
21 | * Board identifier. | ||
22 | */ | ||
23 | #define BOARD_K552 | ||
24 | #define BOARD_NAME "K552 keyboard" | ||
25 | |||
26 | /* | ||
27 | * Board frequencies. | ||
28 | */ | ||
29 | #define STM32_LSECLK 32768 | ||
30 | #define STM32_HSECLK 8000000 | ||
31 | |||
32 | /* | ||
33 | * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h. | ||
34 | * | ||
35 | * Only xC (256KB Flash) is defined, but it's identical to the | ||
36 | * x8 version (64KB Flash) except for the Flash region size in the | ||
37 | * linker script. For x8 parts use xC here and change to the x8 linker | ||
38 | * script in the project Makefile. | ||
39 | */ | ||
40 | #pragma once | ||
41 | #include_next <board.h> | ||
42 | #undef STM32F103xB | ||
43 | #define STM32F103xE | ||
44 | |||
45 | /* | ||
46 | * IO pins assignments | ||
47 | * | ||
48 | * numbering is sorted by onboard/connectors, as from the schematics in | ||
49 | * http://www.vcc-gnd.com/read.php?tid=369 | ||
50 | */ | ||
51 | |||
52 | /* on-board */ | ||
53 | #define GPIOA_USBDM 11 // pin 8 | ||
54 | #define GPIOA_USBDP 12 // pin 9 | ||
55 | |||
56 | #define GPIOC_OSC32_IN 14 | ||
57 | #define GPIOC_OSC32_OUT 15 | ||
58 | |||
59 | /* | ||
60 | * I/O ports initial setup, this configuration is established soon after reset | ||
61 | * in the initialization code. | ||
62 | * | ||
63 | * The digits have the following meaning: | ||
64 | * 0 - Analog input. | ||
65 | * 1 - Push Pull output 10MHz. | ||
66 | * 2 - Push Pull output 2MHz. | ||
67 | * 3 - Push Pull output 50MHz. | ||
68 | * 4 - Digital input. | ||
69 | * 5 - Open Drain output 10MHz. | ||
70 | * 6 - Open Drain output 2MHz. | ||
71 | * 7 - Open Drain output 50MHz. | ||
72 | * 8 - Digital input with PullUp or PullDown resistor depending on ODR. | ||
73 | * 9 - Alternate Push Pull output 10MHz. | ||
74 | * A - Alternate Push Pull output 2MHz. | ||
75 | * B - Alternate Push Pull output 50MHz. | ||
76 | * C - Reserved. | ||
77 | * D - Alternate Open Drain output 10MHz. | ||
78 | * E - Alternate Open Drain output 2MHz. | ||
79 | * F - Alternate Open Drain output 50MHz. | ||
80 | * Please refer to the STM32 Reference Manual for details. | ||
81 | */ | ||
82 | |||
83 | /* | ||
84 | * Port A setup. | ||
85 | * Everything input with pull-up except: | ||
86 | */ | ||
87 | #define VAL_GPIOACRL 0x88888888 /* PA7...PA0 */ | ||
88 | #define VAL_GPIOACRH 0x88888888 /* PA15...PA8 */ | ||
89 | #define VAL_GPIOAODR 0xFFFFFFFF | ||
90 | |||
91 | /* | ||
92 | * Port B setup. | ||
93 | * Everything input with pull-up except: | ||
94 | */ | ||
95 | #define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */ | ||
96 | #define VAL_GPIOBCRH 0x88888888 /* PB15...PB8 */ | ||
97 | #define VAL_GPIOBODR 0xFFFFFFFF | ||
98 | |||
99 | /* | ||
100 | * Port C setup. | ||
101 | * Everything input with pull-up except: | ||
102 | */ | ||
103 | #define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */ | ||
104 | #define VAL_GPIOCCRH 0x88888888 /* PC15...PC8 */ | ||
105 | #define VAL_GPIOCODR 0xFFFFFFFF | ||
106 | |||
107 | /* | ||
108 | * Port D setup. | ||
109 | * Everything input with pull-up except: | ||
110 | * PD0 - Normal input (XTAL). | ||
111 | * PD1 - Normal input (XTAL). | ||
112 | */ | ||
113 | #define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */ | ||
114 | #define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */ | ||
115 | #define VAL_GPIODODR 0xFFFFFFFF | ||
116 | |||
117 | /* | ||
118 | * Port E setup. | ||
119 | * Everything input with pull-up except: | ||
120 | */ | ||
121 | #define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */ | ||
122 | #define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */ | ||
123 | #define VAL_GPIOEODR 0xFFFFFFFF | ||
124 | |||
125 | /* | ||
126 | * USB bus activation macro, required by the USB driver. | ||
127 | */ | ||
128 | #define usb_lld_connect_bus(usbp) /* always connected */ | ||
129 | |||
130 | /* | ||
131 | * USB bus de-activation macro, required by the USB driver. | ||
132 | */ | ||
133 | #define usb_lld_disconnect_bus(usbp) /* always connected */ | ||
134 | |||
135 | #if !defined(_FROM_ASM_) | ||
136 | #ifdef __cplusplus | ||
137 | extern "C" { | ||
138 | #endif | ||
139 | void boardInit(void); | ||
140 | #ifdef __cplusplus | ||
141 | } | ||
142 | #endif | ||
143 | #endif /* _FROM_ASM_ */ | ||
144 | |||
145 | #endif /* _BOARD_H_ */ | ||
diff --git a/keyboards/handwired/horrortroll/k552/boards/k552/board.mk b/keyboards/handwired/horrortroll/k552/boards/k552/board.mk new file mode 100644 index 000000000..15831c4f1 --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/boards/k552/board.mk | |||
@@ -0,0 +1,5 @@ | |||
1 | # List of all the board related files. | ||
2 | BOARDSRC = $(BOARD_PATH)/boards/k552/board.c | ||
3 | |||
4 | # Required include directories | ||
5 | BOARDINC = $(BOARD_PATH)/boards/k552 | ||
diff --git a/keyboards/handwired/horrortroll/k552/chconf.h b/keyboards/handwired/horrortroll/k552/chconf.h new file mode 100644 index 000000000..41c38c33e --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/chconf.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* Copyright 2020 QMK | ||
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 | /* | ||
18 | * This file was auto-generated by: | ||
19 | * `qmk chibios-confmigrate -i keyboards/wolfmarkclub/wm1/chconf.h -r platforms/chibios/common/configs/chconf.h` | ||
20 | */ | ||
21 | |||
22 | #pragma once | ||
23 | |||
24 | #define CH_CFG_ST_TIMEDELTA 0 | ||
25 | |||
26 | #define CH_CFG_USE_CONDVARS_TIMEOUT FALSE | ||
27 | |||
28 | #include_next <chconf.h> | ||
29 | |||
diff --git a/keyboards/handwired/horrortroll/k552/config.h b/keyboards/handwired/horrortroll/k552/config.h new file mode 100644 index 000000000..1071b7ff3 --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/config.h | |||
@@ -0,0 +1,102 @@ | |||
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 | #pragma once | ||
18 | |||
19 | #include "config_common.h" | ||
20 | |||
21 | /* USB Device descriptor parameter */ | ||
22 | #define VENDOR_ID 0x7516 //Redragon | ||
23 | #define PRODUCT_ID 0x5104 | ||
24 | #define DEVICE_VER 0x0001 | ||
25 | #define MANUFACTURER Redragon | ||
26 | #define PRODUCT K552 Kumara | ||
27 | |||
28 | /* Key matrix size */ | ||
29 | #define MATRIX_ROWS 6 | ||
30 | #define MATRIX_COLS 17 | ||
31 | |||
32 | /* Key matrix pin 0 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 */ | ||
33 | #define MATRIX_ROW_PINS { C12, C10, A10, A8, C8, C9 } | ||
34 | #define MATRIX_COL_PINS { B15, C6, C7, A3, A1, C3, C1, B14, B13, A9, B3, B4, A0, C11, A2, C0, C2 } | ||
35 | |||
36 | /* Direction of diode (COL2ROW or ROW2COL) */ | ||
37 | #define DIODE_DIRECTION ROW2COL | ||
38 | |||
39 | /* Bootmagic reset */ | ||
40 | #define BOOTMAGIC_LITE_ROW 4 | ||
41 | #define BOOTMAGIC_LITE_COLUMN 6 | ||
42 | |||
43 | /* Forcing to use NKRO instead 6KRO */ | ||
44 | #define FORCE_NKRO | ||
45 | |||
46 | /* Change USB Polling Rate to 1000hz and a larger keys per scan for elite gaming */ | ||
47 | #define USB_POLLING_INTERVAL_MS 1 | ||
48 | #define QMK_KEYS_PER_SCAN 12 | ||
49 | |||
50 | /* Set 0 if debouncing isn't needed */ | ||
51 | #define DEBOUNCE 5 | ||
52 | |||
53 | /* EEPROM size */ | ||
54 | #define EEPROM_PAGE_SIZE | ||
55 | #define FEE_PAGE_SIZE 0x800 | ||
56 | #define FEE_PAGE_COUNT 4 | ||
57 | |||
58 | #define FEE_MCU_FLASH_SIZE_IGNORE_CHECK | ||
59 | #define FEE_MCU_FLASH_SIZE \ | ||
60 | ({ \ | ||
61 | uint16_t flash_size = *(uint16_t*)FLASHSIZE_BASE; \ | ||
62 | (flash_size <= 512) ? flash_size : 512; \ | ||
63 | }) | ||
64 | |||
65 | #ifdef OLED_ENABLE | ||
66 | /* Mapping I2C2 for OLED */ | ||
67 | #define I2C1_SCL_PIN B10 | ||
68 | #define I2C1_SDA_PIN B11 | ||
69 | #define I2C_DRIVER I2CD2 | ||
70 | |||
71 | /* Use the custom font */ | ||
72 | #define OLED_FONT_H "lib/glcdfont.c" | ||
73 | #endif | ||
74 | |||
75 | #ifdef RGB_MATRIX_ENABLE | ||
76 | #define DRIVER_LED_TOTAL 24 | ||
77 | #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 | ||
78 | #define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS | ||
79 | |||
80 | /* RGB Matrix config */ | ||
81 | #define RGB_DI_PIN C14 | ||
82 | |||
83 | /* RGB Matrix effect */ | ||
84 | #define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN | ||
85 | #define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT | ||
86 | #define ENABLE_RGB_MATRIX_BREATHING | ||
87 | #define ENABLE_RGB_MATRIX_BAND_VAL | ||
88 | #define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL | ||
89 | #define ENABLE_RGB_MATRIX_CYCLE_ALL | ||
90 | #define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT | ||
91 | #define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN | ||
92 | #define ENABLE_RGB_MATRIX_CYCLE_OUT_IN | ||
93 | #define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL | ||
94 | #define ENABLE_RGB_MATRIX_DUAL_BEACON | ||
95 | #define ENABLE_RGB_MATRIX_RAINBOW_BEACON | ||
96 | #define ENABLE_RGB_MATRIX_RAINDROPS | ||
97 | #define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS | ||
98 | #define ENABLE_RGB_MATRIX_HUE_BREATHING | ||
99 | #define ENABLE_RGB_MATRIX_HUE_PENDULUM | ||
100 | #define ENABLE_RGB_MATRIX_HUE_WAVE | ||
101 | #define ENABLE_RGB_MATRIX_PIXEL_RAIN | ||
102 | #endif | ||
diff --git a/keyboards/handwired/horrortroll/k552/halconf.h b/keyboards/handwired/horrortroll/k552/halconf.h new file mode 100644 index 000000000..e872252b6 --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/halconf.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* Copyright 2020 QMK | ||
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 | /* | ||
18 | * This file was auto-generated by: | ||
19 | * `qmk chibios-confmigrate -i keyboards/wolfmarkclub/wm1/halconf.h -r platforms/chibios/common/configs/halconf.h` | ||
20 | */ | ||
21 | |||
22 | #pragma once | ||
23 | |||
24 | #define HAL_USE_I2C TRUE | ||
25 | |||
26 | #include_next <halconf.h> | ||
diff --git a/keyboards/handwired/horrortroll/k552/info.json b/keyboards/handwired/horrortroll/k552/info.json new file mode 100644 index 000000000..d7cbb2b44 --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/info.json | |||
@@ -0,0 +1,103 @@ | |||
1 | { | ||
2 | "keyboard_name": "Redragon K552 Kumara", | ||
3 | "url": "", | ||
4 | "maintainer": "HorrorTroll", | ||
5 | "layouts": { | ||
6 | "LAYOUT_tkl_ansi": { | ||
7 | "layout": [ | ||
8 | {"label":"Esc", "x":0, "y":0}, | ||
9 | {"label":"F1", "x":2, "y":0}, | ||
10 | {"label":"F2", "x":3, "y":0}, | ||
11 | {"label":"F3", "x":4, "y":0}, | ||
12 | {"label":"F4", "x":5, "y":0}, | ||
13 | {"label":"F5", "x":6.5, "y":0}, | ||
14 | {"label":"F6", "x":7.5, "y":0}, | ||
15 | {"label":"F7", "x":8.5, "y":0}, | ||
16 | {"label":"F8", "x":9.5, "y":0}, | ||
17 | {"label":"F9", "x":11, "y":0}, | ||
18 | {"label":"F10", "x":12, "y":0}, | ||
19 | {"label":"F11", "x":13, "y":0}, | ||
20 | {"label":"F12", "x":14, "y":0}, | ||
21 | {"label":"Print Screen", "x":15.25, "y":0}, | ||
22 | {"label":"Scroll Lock", "x":16.25, "y":0}, | ||
23 | {"label":"Pause", "x":17.25, "y":0}, | ||
24 | |||
25 | {"label":"`~", "x":0, "y":1.25}, | ||
26 | {"label":"1!", "x":1, "y":1.25}, | ||
27 | {"label":"2@", "x":2, "y":1.25}, | ||
28 | {"label":"3#", "x":3, "y":1.25}, | ||
29 | {"label":"4$", "x":4, "y":1.25}, | ||
30 | {"label":"5%", "x":5, "y":1.25}, | ||
31 | {"label":"6^", "x":6, "y":1.25}, | ||
32 | {"label":"7&", "x":7, "y":1.25}, | ||
33 | {"label":"8*", "x":8, "y":1.25}, | ||
34 | {"label":"9(", "x":9, "y":1.25}, | ||
35 | {"label":"0)", "x":10, "y":1.25}, | ||
36 | {"label":"-_", "x":11, "y":1.25}, | ||
37 | {"label":"=+", "x":12, "y":1.25}, | ||
38 | {"label":"Backspace", "x":13, "y":1.25, "w":2}, | ||
39 | {"label":"Insert", "x":15.25, "y":1.25}, | ||
40 | {"label":"Home", "x":16.25, "y":1.25}, | ||
41 | {"label":"PgUp", "x":17.25, "y":1.25}, | ||
42 | |||
43 | {"label":"Tab", "x":0, "y":2.25, "w":1.5}, | ||
44 | {"label":"Q", "x":1.5, "y":2.25}, | ||
45 | {"label":"W", "x":2.5, "y":2.25}, | ||
46 | {"label":"E", "x":3.5, "y":2.25}, | ||
47 | {"label":"R", "x":4.5, "y":2.25}, | ||
48 | {"label":"T", "x":5.5, "y":2.25}, | ||
49 | {"label":"Y", "x":6.5, "y":2.25}, | ||
50 | {"label":"U", "x":7.5, "y":2.25}, | ||
51 | {"label":"I", "x":8.5, "y":2.25}, | ||
52 | {"label":"O", "x":9.5, "y":2.25}, | ||
53 | {"label":"P", "x":10.5, "y":2.25}, | ||
54 | {"label":"[{", "x":11.5, "y":2.25}, | ||
55 | {"label":"]}", "x":12.5, "y":2.25}, | ||
56 | {"label":"\\|", "x":13.5, "y":2.25, "w":1.5}, | ||
57 | {"label":"Delete", "x":15.25, "y":2.25}, | ||
58 | {"label":"End", "x":16.25, "y":2.25}, | ||
59 | {"label":"PgDn", "x":17.25, "y":2.25}, | ||
60 | |||
61 | {"label":"Caps Lock", "x":0, "y":3.25, "w":1.75}, | ||
62 | {"label":"A", "x":1.75, "y":3.25}, | ||
63 | {"label":"S", "x":2.75, "y":3.25}, | ||
64 | {"label":"D", "x":3.75, "y":3.25}, | ||
65 | {"label":"F", "x":4.75, "y":3.25}, | ||
66 | {"label":"G", "x":5.75, "y":3.25}, | ||
67 | {"label":"H", "x":6.75, "y":3.25}, | ||
68 | {"label":"J", "x":7.75, "y":3.25}, | ||
69 | {"label":"K", "x":8.75, "y":3.25}, | ||
70 | {"label":"L", "x":9.75, "y":3.25}, | ||
71 | {"label":";:", "x":10.75, "y":3.25}, | ||
72 | {"label":"'\"", "x":11.75, "y":3.25}, | ||
73 | {"label":"Enter", "x":12.75, "y":3.25, "w":2.25}, | ||
74 | |||
75 | {"label":"Shift", "x":0, "y":4.25, "w":2.25}, | ||
76 | {"label":"Z", "x":2.25, "y":4.25}, | ||
77 | {"label":"X", "x":3.25, "y":4.25}, | ||
78 | {"label":"C", "x":4.25, "y":4.25}, | ||
79 | {"label":"V", "x":5.25, "y":4.25}, | ||
80 | {"label":"B", "x":6.25, "y":4.25}, | ||
81 | {"label":"N", "x":7.25, "y":4.25}, | ||
82 | {"label":"M", "x":8.25, "y":4.25}, | ||
83 | {"label":",<", "x":9.25, "y":4.25}, | ||
84 | {"label":".>", "x":10.25, "y":4.25}, | ||
85 | {"label":"/?", "x":11.25, "y":4.25}, | ||
86 | {"label":"Shift", "x":12.25, "y":4.25, "w":2.75}, | ||
87 | {"label":"\u2191", "x":16.25, "y":4.25}, | ||
88 | |||
89 | {"label":"Ctrl", "x":0, "y":5.25, "w":1.25}, | ||
90 | {"label":"Win", "x":1.25, "y":5.25, "w":1.25}, | ||
91 | {"label":"Alt", "x":2.5, "y":5.25, "w":1.25}, | ||
92 | {"label":"Space", "x":3.75, "y":5.25, "w":6.25}, | ||
93 | {"label":"Alt", "x":10, "y":5.25, "w":1.25}, | ||
94 | {"label":"Fn", "x":11.25, "y":5.25, "w":1.25}, | ||
95 | {"label":"App", "x":12.5, "y":5.25, "w":1.25}, | ||
96 | {"label":"Ctrl", "x":13.75, "y":5.25, "w":1.25}, | ||
97 | {"label":"\u2190", "x":15.25, "y":5.25}, | ||
98 | {"label":"\u2193", "x":16.25, "y":5.25}, | ||
99 | {"label":"\u2192", "x":17.25, "y":5.25} | ||
100 | ] | ||
101 | } | ||
102 | } | ||
103 | } | ||
diff --git a/keyboards/handwired/horrortroll/k552/k552.c b/keyboards/handwired/horrortroll/k552/k552.c new file mode 100644 index 000000000..31ce5d1bb --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/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 "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 | ||
diff --git a/keyboards/handwired/horrortroll/k552/k552.h b/keyboards/handwired/horrortroll/k552/k552.h new file mode 100644 index 000000000..2a537714e --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/k552.h | |||
@@ -0,0 +1,54 @@ | |||
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 | #pragma once | ||
18 | |||
19 | #include "quantum.h" | ||
20 | |||
21 | #define XXX KC_NO | ||
22 | |||
23 | /* ┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ | ||
24 | * │00 │ │01 │02 │03 │04 │ │05 │06 │07 │08 │ │09 │0A │0B │0C │ │0E │0F │0G │ | ||
25 | * └───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ | ||
26 | * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┐ | ||
27 | * │10 │11 │12 │13 │14 │15 │16 │17 │18 │19 │1A │1B │1C │1D │ │1E │1F │1G │ | ||
28 | * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ | ||
29 | * │20 │21 │22 │23 │24 │25 │26 │27 │28 │29 │2A │2B │2C │2D │ │2E │2F │2G │ | ||
30 | * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┘ | ||
31 | * │30 │31 │32 │33 │34 │35 │36 │37 │38 │39 │3A │3B │3D │ | ||
32 | * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ ┌───┐ | ||
33 | * │40 │42 │43 │44 │45 │46 │47 │48 │49 │4A │4B │4D │ │4F │ | ||
34 | * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ ┌───┼───┼───┐ | ||
35 | * │50 │51 │52 │53 │54 │55 │56 │58 │ │5E │5F │5G │ | ||
36 | * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ └───┴───┴───┘ | ||
37 | */ | ||
38 | |||
39 | #define LAYOUT_tkl_ansi( \ | ||
40 | K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, K0F, K0G, \ | ||
41 | K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, \ | ||
42 | K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, \ | ||
43 | K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ | ||
44 | K40, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4D, K4F, \ | ||
45 | K50, K51, K52, K53, K54, K55, K56, K58, K5E, K5F, K5G \ | ||
46 | )\ | ||
47 | {\ | ||
48 | { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, XXX, K0E, K0F, K0G }, \ | ||
49 | { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G }, \ | ||
50 | { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G }, \ | ||
51 | { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, XXX, XXX, XXX }, \ | ||
52 | { K40, XXX, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, XXX, K4D, XXX, K4F, XXX }, \ | ||
53 | { K50, K51, K52, K53, K54, K55, K56, XXX, K58, XXX, XXX, XXX, XXX, XXX, K5E, K5F, K5G }, \ | ||
54 | } | ||
diff --git a/keyboards/handwired/horrortroll/k552/keymaps/default/keymap.c b/keyboards/handwired/horrortroll/k552/keymaps/default/keymap.c new file mode 100644 index 000000000..641e0e538 --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/keymaps/default/keymap.c | |||
@@ -0,0 +1,98 @@ | |||
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 QMK_KEYBOARD_H | ||
18 | |||
19 | #include "keymap_stuff.h" | ||
20 | |||
21 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
22 | |||
23 | /* | ||
24 | ┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ | ||
25 | │Esc│ │F1 │F2 │F3 │F4 │ │F5 │F6 │F7 │F8 │ │F9 │F10│F11│F12│ │PSc│Scr│Pse│ | ||
26 | └───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ | ||
27 | ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┐ | ||
28 | │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Backsp│ │Ins│Hom│PgU│ | ||
29 | ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ | ||
30 | │ Tab │ q │ w │ e │ r │ t │ y │ u │ i │ o │ p │ [ │ ] │ \ │ │Del│End│PgD│ | ||
31 | ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┘ | ||
32 | │ Caps │ a │ s │ d │ f │ g │ h │ j │ k │ l │ ; │ ' │ Enter │ | ||
33 | ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ ┌───┐ | ||
34 | │ LShift │ z │ x │ c │ v │ b │ n │ m │ , │ . │ / │ RShift │ │ ↑ │ | ||
35 | ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ ┌───┼───┼───┐ | ||
36 | │LCrl│GUI │LAlt│ Space │RAlt│ Fn │ App│RCrl│ │ ← │ ↓ │ → │ | ||
37 | └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ └───┴───┴───┘ | ||
38 | ┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ | ||
39 | │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ | ||
40 | └───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ | ||
41 | ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┐ | ||
42 | │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ │ │ │ │ | ||
43 | ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ | ||
44 | │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ { │ } │ | │ │ │ │ │ | ||
45 | ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┘ | ||
46 | │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ : │ " │ │ | ||
47 | ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ ┌───┐ | ||
48 | │ LShift │ Z │ X │ C │ V │ B │ N │ M │ < │ > │ ? │ RShift │ │ │ | ||
49 | ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ ┌───┼───┼───┐ | ||
50 | │ │ │ │ │ │ │ │ │ │ │ │ │ | ||
51 | └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ └───┴───┴───┘ | ||
52 | */ | ||
53 | /* Row: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 */ | ||
54 | [_BASE] = LAYOUT_tkl_ansi( | ||
55 | KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUSE, | ||
56 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, | ||
57 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, | ||
58 | KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, | ||
59 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, | ||
60 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT | ||
61 | ), | ||
62 | |||
63 | /* Row: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 */ | ||
64 | [_WAVE] = LAYOUT_tkl_ansi( | ||
65 | KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUSE, | ||
66 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, | ||
67 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, | ||
68 | KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, | ||
69 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, | ||
70 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT | ||
71 | ), | ||
72 | |||
73 | /* | ||
74 | ┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ | ||
75 | │Rst│ │MeP│VoD│VoU│Mut│ │Stp│Prv│Ply│Nxt│ │Mai│Hom│Cal│Sch│ │Rod│Mod│Tog│ | ||
76 | └───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ | ||
77 | ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┐ | ||
78 | │ │ │ │ │ │ │ │ │ │ │ │Spd│Spi│ │ │C_E│ │ │ | ||
79 | ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ | ||
80 | │ │1Hd│1Hi│1Sd│1Si│1Vd│1Vi│ │ │ │ │ │ │ │ │ │ │Wve│ | ||
81 | ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┘ | ||
82 | │ │2Hd│2Hi│2Sd│2Si│2Vd│2Vi│ │ │ │ │ │ │ | ||
83 | ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ ┌───┐ | ||
84 | │ │ │Pre│Ref│Flp│ │ │ │ │ │ │ │ │Vai│ | ||
85 | ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ ┌───┼───┼───┐ | ||
86 | │ │ │ │ │ │ Fn │ │ │ │Hud│Vad│Hui│ | ||
87 | └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ └───┴───┴───┘ | ||
88 | */ | ||
89 | /* Row: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 */ | ||
90 | [_FN] = LAYOUT_tkl_ansi( | ||
91 | RESET, KC_MSEL, KC_VOLD, KC_VOLU, KC_MUTE, KC_MSTP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MAIL, KC_WHOM, KC_CALC, KC_WSCH, RGB_RMOD, RGB_MOD, RGB_TOG, | ||
92 | NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______, RGB_C_E, _______, _______, | ||
93 | _______, G1_HUD, G1_HUI, G1_SAD, G1_SAI, G1_VAD, G1_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, TG(_WAVE), | ||
94 | _______, G2_HUD, G2_HUI, G2_SAD, G2_SAI, G2_VAD, G2_VAI, _______, _______, _______, _______, _______, _______, | ||
95 | _______, G_PRE, REF_G, G_FLIP, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, | ||
96 | _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_VAD, RGB_HUI | ||
97 | ), | ||
98 | }; | ||
diff --git a/keyboards/handwired/horrortroll/k552/keymaps/default/keymap_stuff.h b/keyboards/handwired/horrortroll/k552/keymaps/default/keymap_stuff.h new file mode 100644 index 000000000..c328e03e0 --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/keymaps/default/keymap_stuff.h | |||
@@ -0,0 +1,304 @@ | |||
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 "rgb_matrix.h" | ||
18 | #include "progmem.h" | ||
19 | #include "config.h" | ||
20 | #include "eeprom.h" | ||
21 | #include <string.h> | ||
22 | #include <math.h> | ||
23 | |||
24 | #include <lib/lib8tion/lib8tion.h> | ||
25 | |||
26 | #include "oled/oled_stuff.h" | ||
27 | |||
28 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
29 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
30 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
31 | // entirely and just use numbers. | ||
32 | |||
33 | enum layer_names { | ||
34 | _BASE = 0, | ||
35 | _WAVE = 1, | ||
36 | _FN = 2 | ||
37 | }; | ||
38 | |||
39 | // For CUSTOM_GRADIENT | ||
40 | HSV gradient_0 = {205, 250, 255}; | ||
41 | HSV gradient_100 = {140, 215, 125}; | ||
42 | bool reflected_gradient = false; | ||
43 | uint8_t gp_i = 0; | ||
44 | |||
45 | typedef struct { | ||
46 | HSV gradient_0; | ||
47 | HSV gradient_1; | ||
48 | bool reflected; | ||
49 | } CUSTOM_PRESETS; | ||
50 | |||
51 | enum user_rgb_mode { | ||
52 | RGB_MODE_ALL, | ||
53 | RGB_MODE_NONE, | ||
54 | }; | ||
55 | |||
56 | typedef union { | ||
57 | uint32_t raw; | ||
58 | struct { | ||
59 | uint8_t rgb_mode :8; | ||
60 | }; | ||
61 | } user_config_t; | ||
62 | |||
63 | user_config_t user_config; | ||
64 | |||
65 | enum layer_keycodes { | ||
66 | //Custom Gradient control keycode | ||
67 | G1_HUI = SAFE_RANGE, //Custom gradient color 1 hue increase | ||
68 | G1_HUD, //Custom gradient color 1 hue decrease | ||
69 | G1_SAI, //Custom gradient color 1 saturation increase | ||
70 | G1_SAD, //Custom gradient color 1 saturation decrease | ||
71 | G1_VAI, //Custom gradient color 1 value increase | ||
72 | G1_VAD, //Custom gradient color 1 value decrease | ||
73 | G2_HUI, //Custom gradient color 2 hue increase | ||
74 | G2_HUD, //Custom gradient color 2 hue decrease | ||
75 | G2_SAI, //Custom gradient color 2 saturation increase | ||
76 | G2_SAD, //Custom gradient color 2 saturation decrease | ||
77 | G2_VAI, //Custom gradient color 2 value increase | ||
78 | G2_VAD, //Custom gradient color 2 value decrease | ||
79 | G_PRE, //Gradient presets | ||
80 | REF_G, //Toggle between linear and reflected gradient | ||
81 | G_FLIP, //Flip the gradient colors | ||
82 | |||
83 | //Custom led effect keycode | ||
84 | RGB_C_E, //Cycle user effect | ||
85 | }; | ||
86 | |||
87 | void keyboard_post_init_kb(void) { | ||
88 | user_config.raw = eeconfig_read_user(); | ||
89 | switch (user_config.rgb_mode) { | ||
90 | case RGB_MODE_ALL: | ||
91 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
92 | rgb_matrix_enable_noeeprom(); | ||
93 | break; | ||
94 | case RGB_MODE_NONE: | ||
95 | rgb_matrix_set_flags(LED_FLAG_NONE); | ||
96 | rgb_matrix_set_color_all(0, 0, 0); | ||
97 | break; | ||
98 | } | ||
99 | } | ||
100 | |||
101 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
102 | process_record_user_oled(keycode, record); | ||
103 | |||
104 | uint8_t color_adj_step = 5; | ||
105 | |||
106 | CUSTOM_PRESETS gradient_presets[] = { | ||
107 | {{41 , 255, 255}, {233, 245, 255}, false }, | ||
108 | {{45 , 245, 155}, {160, 255, 80}, false }, | ||
109 | {{173, 245, 40}, {41 , 255, 205}, true }, | ||
110 | {{32 , 255, 165}, {217, 185, 70}, false }, | ||
111 | {{240, 255, 145}, {115, 255, 245}, true }, | ||
112 | {{118, 255, 255}, {242, 255, 255}, false }, | ||
113 | {{212, 0 , 0}, {223, 235, 165}, true }, | ||
114 | {{205, 250, 255}, {140, 215, 125}, false }, | ||
115 | }; | ||
116 | |||
117 | uint8_t gp_length = sizeof(gradient_presets)/sizeof(gradient_presets[0]); | ||
118 | |||
119 | switch (keycode) { | ||
120 | case G1_HUI: | ||
121 | if (record->event.pressed) { | ||
122 | gradient_0.h += color_adj_step; | ||
123 | dprintf("Gradient 0 HSV: %d, %d, %d\n", gradient_0.h, gradient_0.s, gradient_0.v); | ||
124 | } | ||
125 | return false; | ||
126 | case G1_HUD: | ||
127 | if (record->event.pressed) { | ||
128 | gradient_0.h -= color_adj_step; | ||
129 | dprintf("Gradient 0 HSV: %d, %d, %d\n", gradient_0.h, gradient_0.s, gradient_0.v); | ||
130 | } | ||
131 | return false; | ||
132 | case G1_SAI: | ||
133 | if (record->event.pressed) { | ||
134 | gradient_0.s = (gradient_0.s + color_adj_step * 2 <= 255) ? gradient_0.s + color_adj_step * 2 : 255; | ||
135 | dprintf("Gradient 0 HSV: %d, %d, %d\n", gradient_0.h, gradient_0.s, gradient_0.v); | ||
136 | } | ||
137 | return false; | ||
138 | case G1_SAD: | ||
139 | if (record->event.pressed) { | ||
140 | gradient_0.s = (gradient_0.s - color_adj_step * 2 >= 0) ? gradient_0.s - color_adj_step * 2 : 0; | ||
141 | dprintf("Gradient 0 HSV: %d, %d, %d\n", gradient_0.h, gradient_0.s, gradient_0.v); | ||
142 | } | ||
143 | return false; | ||
144 | case G1_VAI: | ||
145 | if (record->event.pressed) { | ||
146 | gradient_0.v = (gradient_0.v + color_adj_step * 2 <= 255) ? gradient_0.v + color_adj_step * 2 : 255; | ||
147 | dprintf("Gradient 0 HSV: %d, %d, %d\n", gradient_0.h, gradient_0.s, gradient_0.v); | ||
148 | } | ||
149 | return false; | ||
150 | case G1_VAD: | ||
151 | if (record->event.pressed) { | ||
152 | gradient_0.v = (gradient_0.v - color_adj_step * 2 >= 0) ? gradient_0.v - color_adj_step * 2 : 0; | ||
153 | dprintf("Gradient 0 HSV: %d, %d, %d\n", gradient_0.h, gradient_0.s, gradient_0.v); | ||
154 | } | ||
155 | return false; | ||
156 | case G2_HUI: | ||
157 | if (record->event.pressed) { | ||
158 | gradient_100.h += color_adj_step; | ||
159 | dprintf("Gradient 100 HSV: %d, %d, %d\n", gradient_100.h, gradient_100.s, gradient_100.v); | ||
160 | } | ||
161 | return false; | ||
162 | case G2_HUD: | ||
163 | if (record->event.pressed) { | ||
164 | gradient_100.h -= color_adj_step; | ||
165 | dprintf("Gradient 100 HSV: %d, %d, %d\n", gradient_100.h, gradient_100.s, gradient_100.v); | ||
166 | } | ||
167 | return false; | ||
168 | case G2_SAI: | ||
169 | if (record->event.pressed) { | ||
170 | gradient_100.s = (gradient_100.s + color_adj_step * 2 <= 255) ? gradient_100.s + color_adj_step * 2 : 255; | ||
171 | dprintf("Gradient 100 HSV: %d, %d, %d\n", gradient_100.h, gradient_100.s, gradient_100.v); | ||
172 | } | ||
173 | return false; | ||
174 | case G2_SAD: | ||
175 | if (record->event.pressed) { | ||
176 | gradient_100.s = (gradient_100.s - color_adj_step * 2 >= 0) ? gradient_100.s - color_adj_step * 2 : 0; | ||
177 | dprintf("Gradient 100 HSV: %d, %d, %d\n", gradient_100.h, gradient_100.s, gradient_100.v); | ||
178 | } | ||
179 | return false; | ||
180 | case G2_VAI: | ||
181 | if (record->event.pressed) { | ||
182 | gradient_100.v = (gradient_100.v + color_adj_step * 2 <= 255) ? gradient_100.v + color_adj_step * 2 : 255; | ||
183 | dprintf("Gradient 100 HSV: %d, %d, %d\n", gradient_100.h, gradient_100.s, gradient_100.v); | ||
184 | } | ||
185 | return false; | ||
186 | case G2_VAD: | ||
187 | if (record->event.pressed) { | ||
188 | gradient_100.v = (gradient_100.v - color_adj_step * 2 >= 0) ? gradient_100.v - color_adj_step * 2 : 0; | ||
189 | dprintf("Gradient 100 HSV: %d, %d, %d\n", gradient_100.h, gradient_100.s, gradient_100.v); | ||
190 | } | ||
191 | return false; | ||
192 | case G_PRE: | ||
193 | if (record->event.pressed) { | ||
194 | gp_i = (gp_i + gp_length ) % gp_length; | ||
195 | |||
196 | gradient_0 = gradient_presets[gp_i].gradient_0; | ||
197 | gradient_100 = gradient_presets[gp_i].gradient_1; | ||
198 | reflected_gradient = gradient_presets[gp_i].reflected; | ||
199 | |||
200 | gp_i += 1; | ||
201 | } | ||
202 | return false; | ||
203 | case REF_G: | ||
204 | if (record->event.pressed) { | ||
205 | reflected_gradient = !reflected_gradient; | ||
206 | } | ||
207 | return false; | ||
208 | case G_FLIP: | ||
209 | if (record->event.pressed) { | ||
210 | HSV temp_color = gradient_0; | ||
211 | gradient_0 = gradient_100; | ||
212 | gradient_100 = temp_color; | ||
213 | } | ||
214 | return false; | ||
215 | case RGB_C_E: | ||
216 | if (record->event.pressed) { | ||
217 | switch (rgb_matrix_get_mode()) { | ||
218 | case RGB_MATRIX_CUSTOM_CUSTOM_GRADIENT: | ||
219 | rgb_matrix_mode(RGB_MATRIX_CUSTOM_DIAGONAL); | ||
220 | return false; | ||
221 | case RGB_MATRIX_CUSTOM_DIAGONAL: | ||
222 | rgb_matrix_mode(RGB_MATRIX_CUSTOM_COOL_DIAGONAL); | ||
223 | return false; | ||
224 | case RGB_MATRIX_CUSTOM_COOL_DIAGONAL: | ||
225 | rgb_matrix_mode(RGB_MATRIX_CUSTOM_KITT); | ||
226 | return false; | ||
227 | case RGB_MATRIX_CUSTOM_KITT: | ||
228 | rgb_matrix_mode(RGB_MATRIX_CUSTOM_RANDOM_BREATH_RAINBOW); | ||
229 | return false; | ||
230 | default: | ||
231 | rgb_matrix_mode(RGB_MATRIX_CUSTOM_CUSTOM_GRADIENT); | ||
232 | return false; | ||
233 | } | ||
234 | } | ||
235 | return false; | ||
236 | case RGB_TOG: | ||
237 | if (record->event.pressed) { | ||
238 | switch (rgb_matrix_get_flags()) { | ||
239 | case LED_FLAG_ALL: { | ||
240 | rgb_matrix_set_flags(LED_FLAG_NONE); | ||
241 | rgb_matrix_set_color_all(0, 0, 0); | ||
242 | user_config.rgb_mode = RGB_MODE_NONE; | ||
243 | } | ||
244 | break; | ||
245 | default: { | ||
246 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
247 | rgb_matrix_enable_noeeprom(); | ||
248 | user_config.rgb_mode = RGB_MODE_ALL; | ||
249 | } | ||
250 | break; | ||
251 | } | ||
252 | eeconfig_update_user(user_config.raw); | ||
253 | } | ||
254 | return false; | ||
255 | } | ||
256 | return true; | ||
257 | } | ||
258 | |||
259 | void rgb_matrix_indicators_user(void) { | ||
260 | uint8_t side_leds_left[3] = {17, 18, 19}; | ||
261 | uint8_t side_leds_right[3] = { 4, 5, 6}; | ||
262 | HSV hsv = rgb_matrix_config.hsv; | ||
263 | uint8_t time = scale16by8(g_rgb_timer, qadd8(32, 1)); | ||
264 | hsv.h = time; | ||
265 | RGB rgb = hsv_to_rgb(hsv); | ||
266 | |||
267 | if ((rgb_matrix_get_flags() & LED_FLAG_ALL)) { | ||
268 | if (host_keyboard_led_state().caps_lock) { | ||
269 | for (uint8_t i = 0; i < 3; i++) | ||
270 | { | ||
271 | rgb_matrix_set_color(side_leds_left[i], rgb.r, rgb.g, rgb.b); | ||
272 | } | ||
273 | } | ||
274 | if (host_keyboard_led_state().scroll_lock) { | ||
275 | for (uint8_t i = 0; i < 3; i++) | ||
276 | { | ||
277 | rgb_matrix_set_color(side_leds_right[i], rgb.r, rgb.g, rgb.b); | ||
278 | } | ||
279 | } | ||
280 | } else { | ||
281 | if (host_keyboard_led_state().caps_lock) { | ||
282 | for (uint8_t i = 0; i < 3; i++) | ||
283 | { | ||
284 | rgb_matrix_set_color(side_leds_left[i], rgb.r, rgb.g, rgb.b); | ||
285 | } | ||
286 | } else { | ||
287 | for (uint8_t i = 0; i < 3; i++) | ||
288 | { | ||
289 | rgb_matrix_set_color(side_leds_left[i], 0, 0, 0); | ||
290 | } | ||
291 | } | ||
292 | if (host_keyboard_led_state().scroll_lock) { | ||
293 | for (uint8_t i = 0; i < 3; i++) | ||
294 | { | ||
295 | rgb_matrix_set_color(side_leds_right[i], rgb.r, rgb.g, rgb.b); | ||
296 | } | ||
297 | } else { | ||
298 | for (uint8_t i = 0; i < 3; i++) | ||
299 | { | ||
300 | rgb_matrix_set_color(side_leds_right[i], 0, 0, 0); | ||
301 | } | ||
302 | } | ||
303 | } | ||
304 | } | ||
diff --git a/keyboards/handwired/horrortroll/k552/keymaps/default/led/cool_diagonal.c b/keyboards/handwired/horrortroll/k552/keymaps/default/led/cool_diagonal.c new file mode 100644 index 000000000..2c518a543 --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/keymaps/default/led/cool_diagonal.c | |||
@@ -0,0 +1,22 @@ | |||
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 | static HSV COOL_DIAGONAL_math(HSV hsv, uint8_t i, uint8_t time) { | ||
18 | hsv.h = (g_led_config.point[i].x / 4) - g_led_config.point[i].y - time; | ||
19 | return hsv; | ||
20 | } | ||
21 | |||
22 | bool COOL_DIAGONAL(effect_params_t* params) { return effect_runner_i(params, &COOL_DIAGONAL_math); } \ No newline at end of file | ||
diff --git a/keyboards/handwired/horrortroll/k552/keymaps/default/led/custom_gradient.c b/keyboards/handwired/horrortroll/k552/keymaps/default/led/custom_gradient.c new file mode 100644 index 000000000..49e4a242f --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/keymaps/default/led/custom_gradient.c | |||
@@ -0,0 +1,74 @@ | |||
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 | extern HSV gradient_0; | ||
18 | extern HSV gradient_100; | ||
19 | extern bool reflected_gradient; | ||
20 | |||
21 | static HSV INTERPOLATE_HSV(float step, HSV gradient_0, HSV gradient_100) { | ||
22 | uint8_t cw, ccw; | ||
23 | HSV color; | ||
24 | |||
25 | cw = (gradient_0.h >= gradient_100.h) ? 255 + gradient_100.h - gradient_0.h : gradient_100.h - gradient_0.h; // Hue range is 0 to 255. | ||
26 | ccw = (gradient_0.h >= gradient_100.h) ? gradient_0.h - gradient_100.h : 255 + gradient_0.h - gradient_100.h; | ||
27 | |||
28 | if( cw < ccw ) { // going clockwise | ||
29 | color.h = gradient_0.h + (uint8_t)(step * cw); | ||
30 | } else { // Going counter clockwise | ||
31 | color.h = gradient_0.h - (uint8_t)(step * ccw); | ||
32 | } | ||
33 | |||
34 | color.s = gradient_0.s + step * (gradient_100.s - gradient_0.s); | ||
35 | |||
36 | // Scale V with global RGB Matrix's V, so users can still control overall brightness with RGB_VAI & RGB_VAD0 | ||
37 | color.v = round((gradient_0.v + step * (gradient_100.v - gradient_0.v)) * ((float)rgb_matrix_config.hsv.v / 255)); | ||
38 | |||
39 | return color; | ||
40 | } | ||
41 | |||
42 | static HSV CUSTOM_GRADIENT_math(uint8_t led_x, uint8_t min_x, uint8_t max_x) { | ||
43 | float step = (float)led_x / (max_x - min_x); | ||
44 | float mid_gradient_pos = 0.5; | ||
45 | |||
46 | if( reflected_gradient ) { | ||
47 | if( step <= mid_gradient_pos ) { | ||
48 | return INTERPOLATE_HSV(step * (1/mid_gradient_pos), gradient_0, gradient_100); | ||
49 | } else { | ||
50 | return INTERPOLATE_HSV((step - mid_gradient_pos) * (1/(1-mid_gradient_pos)), gradient_100, gradient_0); | ||
51 | } | ||
52 | |||
53 | } else { | ||
54 | return INTERPOLATE_HSV(step, gradient_0, gradient_100); | ||
55 | } | ||
56 | } | ||
57 | |||
58 | static bool CUSTOM_GRADIENT(effect_params_t* params) { | ||
59 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | ||
60 | |||
61 | uint8_t min_x = 0; // X coordinate of the left-most LED | ||
62 | uint8_t max_x = 224; // X coordinate of the right-most LED | ||
63 | |||
64 | for (uint8_t i = led_min; i < led_max; i++) { | ||
65 | RGB_MATRIX_TEST_LED_FLAGS(); | ||
66 | |||
67 | HSV hsv_orig = CUSTOM_GRADIENT_math(g_led_config.point[i].x, min_x, max_x); | ||
68 | RGB rgb = hsv_to_rgb(hsv_orig); | ||
69 | |||
70 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); | ||
71 | } | ||
72 | |||
73 | return led_max < DRIVER_LED_TOTAL; | ||
74 | } | ||
diff --git a/keyboards/handwired/horrortroll/k552/keymaps/default/led/diagonal.c b/keyboards/handwired/horrortroll/k552/keymaps/default/led/diagonal.c new file mode 100644 index 000000000..19e3791bd --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/keymaps/default/led/diagonal.c | |||
@@ -0,0 +1,22 @@ | |||
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 | static HSV DIAGONAL_math(HSV hsv, uint8_t i, uint8_t time) { | ||
18 | hsv.h = g_led_config.point[i].x - g_led_config.point[i].y - time; | ||
19 | return hsv; | ||
20 | } | ||
21 | |||
22 | bool DIAGONAL(effect_params_t* params) { return effect_runner_i(params, &DIAGONAL_math); } | ||
diff --git a/keyboards/handwired/horrortroll/k552/keymaps/default/led/kitt.c b/keyboards/handwired/horrortroll/k552/keymaps/default/led/kitt.c new file mode 100644 index 000000000..823eb5839 --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/keymaps/default/led/kitt.c | |||
@@ -0,0 +1,68 @@ | |||
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 | // variable for startup animation | ||
18 | bool BASE_EFFECT_NOT_STARTED_YET = true; | ||
19 | uint8_t base_effect_startup_counter = 255; | ||
20 | |||
21 | uint8_t led_count = 10; | ||
22 | uint8_t led_first = 7; | ||
23 | |||
24 | static uint8_t time_to_led(uint8_t time, uint8_t led_behind) { | ||
25 | uint16_t led_time = led_count * time; | ||
26 | uint16_t step = ((2 * led_count + (led_time / 128)) - led_behind) % (2 * led_count); | ||
27 | uint8_t led; | ||
28 | |||
29 | if (step < led_count) { | ||
30 | led = step; | ||
31 | } else { | ||
32 | led = led_count - 1 - (step - led_count); | ||
33 | } | ||
34 | |||
35 | return led; | ||
36 | } | ||
37 | |||
38 | static HSV KITT_math(HSV hsv, uint8_t i, uint8_t time) { | ||
39 | |||
40 | // reset base effect startup | ||
41 | if (i == 0) { | ||
42 | BASE_EFFECT_NOT_STARTED_YET = true; | ||
43 | } | ||
44 | |||
45 | hsv.h = 0; | ||
46 | hsv.s = 255; | ||
47 | |||
48 | if (i >= led_first && i < led_first + led_count) { | ||
49 | uint8_t j = i - led_first; | ||
50 | if (j == time_to_led(time, 0)) { | ||
51 | hsv.v = hsv.v; | ||
52 | } else if (j == time_to_led(time, 1)) { | ||
53 | hsv.v = hsv.v/2; | ||
54 | } else if (j == time_to_led(time, 2)) { | ||
55 | hsv.v = hsv.v/4; | ||
56 | } else if (j == time_to_led(time, 3)) { | ||
57 | hsv.v = hsv.v/8; | ||
58 | } else { | ||
59 | hsv.v = 0; | ||
60 | } | ||
61 | } else { | ||
62 | hsv.v = 0; | ||
63 | } | ||
64 | |||
65 | return hsv; | ||
66 | } | ||
67 | |||
68 | bool KITT(effect_params_t* params) { return effect_runner_i(params, &KITT_math); } | ||
diff --git a/keyboards/handwired/horrortroll/k552/keymaps/default/led/random_breath_rainbow.c b/keyboards/handwired/horrortroll/k552/keymaps/default/led/random_breath_rainbow.c new file mode 100644 index 000000000..041417477 --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/keymaps/default/led/random_breath_rainbow.c | |||
@@ -0,0 +1,55 @@ | |||
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 | static uint8_t offset[DRIVER_LED_TOTAL]; | ||
18 | |||
19 | static void doRandom_breath_rainbow(int i, effect_params_t* params) { | ||
20 | if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) return; | ||
21 | uint16_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 6); | ||
22 | |||
23 | if (rand() * 50 == 1) { | ||
24 | if (rand() * 2 == 1) { | ||
25 | offset[i]++; | ||
26 | } | ||
27 | else { | ||
28 | offset[i]--; | ||
29 | } | ||
30 | } | ||
31 | |||
32 | //float val = (((float)sin8(time + offset[i]) / 256)/2.1) + .05; | ||
33 | HSV hsv = {0, 255, 255}; | ||
34 | hsv.h = scale16by8(g_rgb_timer + offset[i], rgb_matrix_config.speed / 4) + (offset[i]*2); | ||
35 | hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); | ||
36 | RGB rgb = rgb_matrix_hsv_to_rgb(hsv); | ||
37 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); | ||
38 | } | ||
39 | |||
40 | bool RANDOM_BREATH_RAINBOW(effect_params_t* params) { | ||
41 | |||
42 | if (!params->init) { | ||
43 | // Change one LED every tick, make sure speed is not 0 | ||
44 | doRandom_breath_rainbow(rand() % DRIVER_LED_TOTAL, params); | ||
45 | return false; | ||
46 | } | ||
47 | |||
48 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | ||
49 | |||
50 | for (uint8_t i = led_min; i < led_max; i++) { | ||
51 | doRandom_breath_rainbow(i, params); | ||
52 | } | ||
53 | |||
54 | return led_max < DRIVER_LED_TOTAL; | ||
55 | } | ||
diff --git a/keyboards/handwired/horrortroll/k552/keymaps/default/oled/oled_stuff.h b/keyboards/handwired/horrortroll/k552/keymaps/default/oled/oled_stuff.h new file mode 100644 index 000000000..9d8d62917 --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/keymaps/default/oled/oled_stuff.h | |||
@@ -0,0 +1,69 @@ | |||
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 | // OLED animation | ||
18 | #include "lib/bongocat.c" | ||
19 | #include "lib/galaxy.c" | ||
20 | #include "lib/wave.c" | ||
21 | |||
22 | #ifdef OLED_ENABLE | ||
23 | bool oled_task_user(void) { | ||
24 | led_t led_usb_state = host_keyboard_led_state(); | ||
25 | static uint8_t old_layer; | ||
26 | uint8_t layer = get_highest_layer(layer_state | default_layer_state); | ||
27 | |||
28 | if (layer != old_layer) { | ||
29 | oled_clear(); | ||
30 | } | ||
31 | |||
32 | old_layer = layer; | ||
33 | |||
34 | switch (layer) { | ||
35 | case 0: | ||
36 | render_bongocat(); | ||
37 | oled_set_cursor(14, 0); // sets cursor to (column, row) using charactar spacing (4 rows on 128x32 screen, anything more will overflow back to the top) | ||
38 | oled_write_P(PSTR("WPM:"), false); | ||
39 | oled_write(get_u8_str(get_current_wpm(), '0'), false); // writes wpm on top right corner of string | ||
40 | oled_set_cursor(17, 2); | ||
41 | oled_write_P(led_usb_state.caps_lock ? PSTR("CAPS") : PSTR(" "), false); | ||
42 | oled_set_cursor(17, 3); | ||
43 | oled_write_P(led_usb_state.scroll_lock ? PSTR("SCRL") : PSTR(" "), false); | ||
44 | break; | ||
45 | case 1: | ||
46 | // sleep if it has been long enough since we last got a char | ||
47 | if (timer_elapsed32(wave_sleep) > OLED_TIMEOUT) { | ||
48 | oled_off(); | ||
49 | } else { | ||
50 | oled_on(); | ||
51 | } | ||
52 | // time for the next frame? | ||
53 | if (timer_elapsed(wave_timer) > FRAME_TIMEOUT) { | ||
54 | wave_timer = timer_read(); | ||
55 | render_frame(); | ||
56 | } | ||
57 | |||
58 | oled_set_cursor(0, 3); | ||
59 | oled_write_P(led_usb_state.caps_lock ? PSTR("CAPS") : PSTR(" "), false); | ||
60 | oled_set_cursor(17, 3); | ||
61 | oled_write_P(led_usb_state.scroll_lock ? PSTR("SCRL") : PSTR(" "), false); | ||
62 | break; | ||
63 | case 2: | ||
64 | render_galaxy(); | ||
65 | break; | ||
66 | } | ||
67 | return false; | ||
68 | } | ||
69 | #endif | ||
diff --git a/keyboards/handwired/horrortroll/k552/keymaps/default/readme.md b/keyboards/handwired/horrortroll/k552/keymaps/default/readme.md new file mode 100644 index 000000000..c8f9c1f8e --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/keymaps/default/readme.md | |||
@@ -0,0 +1,16 @@ | |||
1 | # Default layout and custom LED / OLED | ||
2 | |||
3 | Keymap is default 87 qwerty, TKL layout | ||
4 | |||
5 | It have new LED effect: | ||
6 | - Custom gradient (ported from SirTimmyTimbit code [https://github.com/SirTimmyTimbit/customizable-gradient-effect-for-drop-alt]) | ||
7 | - Diagonal (ported from pleasuretek code [https://github.com/pleasuretek/qmk_firmware]) | ||
8 | - Cool diagonal (ported from pleasuretek code [https://github.com/pleasuretek/qmk_firmware]) | ||
9 | - Knight Rider (ported from jumper149 code [https://github.com/jumper149/qmk_firmware/blob/jumper149/keyboards/dztech/dz65rgb/keymaps/jumper149/]) | ||
10 | - Random breath rainbow (based from daed code [https://github.com/daed/qmk_firmware/blob/master/keyboards/massdrop/alt/keymaps/daed] and modify by me) | ||
11 | |||
12 | And OLED Animation: | ||
13 | - Bongo Cat (ported from nwii code [https://github.com/nwii/oledbongocat] and modify image animation by me) | ||
14 | - Waveform Typing (ported from drcforbin code [https://github.com/drcforbin/keyboards] and modify to correct my TKL layout) | ||
15 | - Galaxy image when pressing FN key (original image [https://www.deviantart.com/rock-bomber/art/Gateway-668850827] and redraw then cut for 128x32 size by me) | ||
16 | - Redragon Logo when booting up | ||
diff --git a/keyboards/handwired/horrortroll/k552/keymaps/default/rgb_matrix_user.inc b/keyboards/handwired/horrortroll/k552/keymaps/default/rgb_matrix_user.inc new file mode 100644 index 000000000..38edbae99 --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/keymaps/default/rgb_matrix_user.inc | |||
@@ -0,0 +1,15 @@ | |||
1 | RGB_MATRIX_EFFECT(CUSTOM_GRADIENT) | ||
2 | RGB_MATRIX_EFFECT(DIAGONAL) | ||
3 | RGB_MATRIX_EFFECT(COOL_DIAGONAL) | ||
4 | RGB_MATRIX_EFFECT(KITT) | ||
5 | RGB_MATRIX_EFFECT(RANDOM_BREATH_RAINBOW) | ||
6 | |||
7 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
8 | |||
9 | #include "led/custom_gradient.c" | ||
10 | #include "led/diagonal.c" | ||
11 | #include "led/cool_diagonal.c" | ||
12 | #include "led/kitt.c" | ||
13 | #include "led/random_breath_rainbow.c" | ||
14 | |||
15 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS \ No newline at end of file | ||
diff --git a/keyboards/handwired/horrortroll/k552/keymaps/default/rules.mk b/keyboards/handwired/horrortroll/k552/keymaps/default/rules.mk new file mode 100644 index 000000000..6245023e8 --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/keymaps/default/rules.mk | |||
@@ -0,0 +1 @@ | |||
RGB_MATRIX_CUSTOM_USER = yes | |||
diff --git a/keyboards/handwired/horrortroll/k552/keymaps/via/config.h b/keyboards/handwired/horrortroll/k552/keymaps/via/config.h new file mode 100644 index 000000000..a36ce468b --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/keymaps/via/config.h | |||
@@ -0,0 +1,19 @@ | |||
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 | #pragma once | ||
18 | |||
19 | #define DYNAMIC_KEYMAP_LAYER_COUNT 3 | ||
diff --git a/keyboards/handwired/horrortroll/k552/keymaps/via/keymap.c b/keyboards/handwired/horrortroll/k552/keymaps/via/keymap.c new file mode 100644 index 000000000..641e0e538 --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/keymaps/via/keymap.c | |||
@@ -0,0 +1,98 @@ | |||
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 QMK_KEYBOARD_H | ||
18 | |||
19 | #include "keymap_stuff.h" | ||
20 | |||
21 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
22 | |||
23 | /* | ||
24 | ┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ | ||
25 | │Esc│ │F1 │F2 │F3 │F4 │ │F5 │F6 │F7 │F8 │ │F9 │F10│F11│F12│ │PSc│Scr│Pse│ | ||
26 | └───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ | ||
27 | ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┐ | ||
28 | │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Backsp│ │Ins│Hom│PgU│ | ||
29 | ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ | ||
30 | │ Tab │ q │ w │ e │ r │ t │ y │ u │ i │ o │ p │ [ │ ] │ \ │ │Del│End│PgD│ | ||
31 | ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┘ | ||
32 | │ Caps │ a │ s │ d │ f │ g │ h │ j │ k │ l │ ; │ ' │ Enter │ | ||
33 | ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ ┌───┐ | ||
34 | │ LShift │ z │ x │ c │ v │ b │ n │ m │ , │ . │ / │ RShift │ │ ↑ │ | ||
35 | ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ ┌───┼───┼───┐ | ||
36 | │LCrl│GUI │LAlt│ Space │RAlt│ Fn │ App│RCrl│ │ ← │ ↓ │ → │ | ||
37 | └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ └───┴───┴───┘ | ||
38 | ┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ | ||
39 | │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ | ||
40 | └───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ | ||
41 | ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┐ | ||
42 | │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ │ │ │ │ | ||
43 | ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ | ||
44 | │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ { │ } │ | │ │ │ │ │ | ||
45 | ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┘ | ||
46 | │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ : │ " │ │ | ||
47 | ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ ┌───┐ | ||
48 | │ LShift │ Z │ X │ C │ V │ B │ N │ M │ < │ > │ ? │ RShift │ │ │ | ||
49 | ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ ┌───┼───┼───┐ | ||
50 | │ │ │ │ │ │ │ │ │ │ │ │ │ | ||
51 | └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ └───┴───┴───┘ | ||
52 | */ | ||
53 | /* Row: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 */ | ||
54 | [_BASE] = LAYOUT_tkl_ansi( | ||
55 | KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUSE, | ||
56 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, | ||
57 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, | ||
58 | KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, | ||
59 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, | ||
60 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT | ||
61 | ), | ||
62 | |||
63 | /* Row: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 */ | ||
64 | [_WAVE] = LAYOUT_tkl_ansi( | ||
65 | KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUSE, | ||
66 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, | ||
67 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, | ||
68 | KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, | ||
69 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, | ||
70 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT | ||
71 | ), | ||
72 | |||
73 | /* | ||
74 | ┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ | ||
75 | │Rst│ │MeP│VoD│VoU│Mut│ │Stp│Prv│Ply│Nxt│ │Mai│Hom│Cal│Sch│ │Rod│Mod│Tog│ | ||
76 | └───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ | ||
77 | ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┐ | ||
78 | │ │ │ │ │ │ │ │ │ │ │ │Spd│Spi│ │ │C_E│ │ │ | ||
79 | ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ | ||
80 | │ │1Hd│1Hi│1Sd│1Si│1Vd│1Vi│ │ │ │ │ │ │ │ │ │ │Wve│ | ||
81 | ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┘ | ||
82 | │ │2Hd│2Hi│2Sd│2Si│2Vd│2Vi│ │ │ │ │ │ │ | ||
83 | ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ ┌───┐ | ||
84 | │ │ │Pre│Ref│Flp│ │ │ │ │ │ │ │ │Vai│ | ||
85 | ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ ┌───┼───┼───┐ | ||
86 | │ │ │ │ │ │ Fn │ │ │ │Hud│Vad│Hui│ | ||
87 | └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ └───┴───┴───┘ | ||
88 | */ | ||
89 | /* Row: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 */ | ||
90 | [_FN] = LAYOUT_tkl_ansi( | ||
91 | RESET, KC_MSEL, KC_VOLD, KC_VOLU, KC_MUTE, KC_MSTP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MAIL, KC_WHOM, KC_CALC, KC_WSCH, RGB_RMOD, RGB_MOD, RGB_TOG, | ||
92 | NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______, RGB_C_E, _______, _______, | ||
93 | _______, G1_HUD, G1_HUI, G1_SAD, G1_SAI, G1_VAD, G1_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, TG(_WAVE), | ||
94 | _______, G2_HUD, G2_HUI, G2_SAD, G2_SAI, G2_VAD, G2_VAI, _______, _______, _______, _______, _______, _______, | ||
95 | _______, G_PRE, REF_G, G_FLIP, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, | ||
96 | _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_VAD, RGB_HUI | ||
97 | ), | ||
98 | }; | ||
diff --git a/keyboards/handwired/horrortroll/k552/keymaps/via/keymap_stuff.h b/keyboards/handwired/horrortroll/k552/keymaps/via/keymap_stuff.h new file mode 100644 index 000000000..c328e03e0 --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/keymaps/via/keymap_stuff.h | |||
@@ -0,0 +1,304 @@ | |||
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 "rgb_matrix.h" | ||
18 | #include "progmem.h" | ||
19 | #include "config.h" | ||
20 | #include "eeprom.h" | ||
21 | #include <string.h> | ||
22 | #include <math.h> | ||
23 | |||
24 | #include <lib/lib8tion/lib8tion.h> | ||
25 | |||
26 | #include "oled/oled_stuff.h" | ||
27 | |||
28 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
29 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
30 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
31 | // entirely and just use numbers. | ||
32 | |||
33 | enum layer_names { | ||
34 | _BASE = 0, | ||
35 | _WAVE = 1, | ||
36 | _FN = 2 | ||
37 | }; | ||
38 | |||
39 | // For CUSTOM_GRADIENT | ||
40 | HSV gradient_0 = {205, 250, 255}; | ||
41 | HSV gradient_100 = {140, 215, 125}; | ||
42 | bool reflected_gradient = false; | ||
43 | uint8_t gp_i = 0; | ||
44 | |||
45 | typedef struct { | ||
46 | HSV gradient_0; | ||
47 | HSV gradient_1; | ||
48 | bool reflected; | ||
49 | } CUSTOM_PRESETS; | ||
50 | |||
51 | enum user_rgb_mode { | ||
52 | RGB_MODE_ALL, | ||
53 | RGB_MODE_NONE, | ||
54 | }; | ||
55 | |||
56 | typedef union { | ||
57 | uint32_t raw; | ||
58 | struct { | ||
59 | uint8_t rgb_mode :8; | ||
60 | }; | ||
61 | } user_config_t; | ||
62 | |||
63 | user_config_t user_config; | ||
64 | |||
65 | enum layer_keycodes { | ||
66 | //Custom Gradient control keycode | ||
67 | G1_HUI = SAFE_RANGE, //Custom gradient color 1 hue increase | ||
68 | G1_HUD, //Custom gradient color 1 hue decrease | ||
69 | G1_SAI, //Custom gradient color 1 saturation increase | ||
70 | G1_SAD, //Custom gradient color 1 saturation decrease | ||
71 | G1_VAI, //Custom gradient color 1 value increase | ||
72 | G1_VAD, //Custom gradient color 1 value decrease | ||
73 | G2_HUI, //Custom gradient color 2 hue increase | ||
74 | G2_HUD, //Custom gradient color 2 hue decrease | ||
75 | G2_SAI, //Custom gradient color 2 saturation increase | ||
76 | G2_SAD, //Custom gradient color 2 saturation decrease | ||
77 | G2_VAI, //Custom gradient color 2 value increase | ||
78 | G2_VAD, //Custom gradient color 2 value decrease | ||
79 | G_PRE, //Gradient presets | ||
80 | REF_G, //Toggle between linear and reflected gradient | ||
81 | G_FLIP, //Flip the gradient colors | ||
82 | |||
83 | //Custom led effect keycode | ||
84 | RGB_C_E, //Cycle user effect | ||
85 | }; | ||
86 | |||
87 | void keyboard_post_init_kb(void) { | ||
88 | user_config.raw = eeconfig_read_user(); | ||
89 | switch (user_config.rgb_mode) { | ||
90 | case RGB_MODE_ALL: | ||
91 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
92 | rgb_matrix_enable_noeeprom(); | ||
93 | break; | ||
94 | case RGB_MODE_NONE: | ||
95 | rgb_matrix_set_flags(LED_FLAG_NONE); | ||
96 | rgb_matrix_set_color_all(0, 0, 0); | ||
97 | break; | ||
98 | } | ||
99 | } | ||
100 | |||
101 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
102 | process_record_user_oled(keycode, record); | ||
103 | |||
104 | uint8_t color_adj_step = 5; | ||
105 | |||
106 | CUSTOM_PRESETS gradient_presets[] = { | ||
107 | {{41 , 255, 255}, {233, 245, 255}, false }, | ||
108 | {{45 , 245, 155}, {160, 255, 80}, false }, | ||
109 | {{173, 245, 40}, {41 , 255, 205}, true }, | ||
110 | {{32 , 255, 165}, {217, 185, 70}, false }, | ||
111 | {{240, 255, 145}, {115, 255, 245}, true }, | ||
112 | {{118, 255, 255}, {242, 255, 255}, false }, | ||
113 | {{212, 0 , 0}, {223, 235, 165}, true }, | ||
114 | {{205, 250, 255}, {140, 215, 125}, false }, | ||
115 | }; | ||
116 | |||
117 | uint8_t gp_length = sizeof(gradient_presets)/sizeof(gradient_presets[0]); | ||
118 | |||
119 | switch (keycode) { | ||
120 | case G1_HUI: | ||
121 | if (record->event.pressed) { | ||
122 | gradient_0.h += color_adj_step; | ||
123 | dprintf("Gradient 0 HSV: %d, %d, %d\n", gradient_0.h, gradient_0.s, gradient_0.v); | ||
124 | } | ||
125 | return false; | ||
126 | case G1_HUD: | ||
127 | if (record->event.pressed) { | ||
128 | gradient_0.h -= color_adj_step; | ||
129 | dprintf("Gradient 0 HSV: %d, %d, %d\n", gradient_0.h, gradient_0.s, gradient_0.v); | ||
130 | } | ||
131 | return false; | ||
132 | case G1_SAI: | ||
133 | if (record->event.pressed) { | ||
134 | gradient_0.s = (gradient_0.s + color_adj_step * 2 <= 255) ? gradient_0.s + color_adj_step * 2 : 255; | ||
135 | dprintf("Gradient 0 HSV: %d, %d, %d\n", gradient_0.h, gradient_0.s, gradient_0.v); | ||
136 | } | ||
137 | return false; | ||
138 | case G1_SAD: | ||
139 | if (record->event.pressed) { | ||
140 | gradient_0.s = (gradient_0.s - color_adj_step * 2 >= 0) ? gradient_0.s - color_adj_step * 2 : 0; | ||
141 | dprintf("Gradient 0 HSV: %d, %d, %d\n", gradient_0.h, gradient_0.s, gradient_0.v); | ||
142 | } | ||
143 | return false; | ||
144 | case G1_VAI: | ||
145 | if (record->event.pressed) { | ||
146 | gradient_0.v = (gradient_0.v + color_adj_step * 2 <= 255) ? gradient_0.v + color_adj_step * 2 : 255; | ||
147 | dprintf("Gradient 0 HSV: %d, %d, %d\n", gradient_0.h, gradient_0.s, gradient_0.v); | ||
148 | } | ||
149 | return false; | ||
150 | case G1_VAD: | ||
151 | if (record->event.pressed) { | ||
152 | gradient_0.v = (gradient_0.v - color_adj_step * 2 >= 0) ? gradient_0.v - color_adj_step * 2 : 0; | ||
153 | dprintf("Gradient 0 HSV: %d, %d, %d\n", gradient_0.h, gradient_0.s, gradient_0.v); | ||
154 | } | ||
155 | return false; | ||
156 | case G2_HUI: | ||
157 | if (record->event.pressed) { | ||
158 | gradient_100.h += color_adj_step; | ||
159 | dprintf("Gradient 100 HSV: %d, %d, %d\n", gradient_100.h, gradient_100.s, gradient_100.v); | ||
160 | } | ||
161 | return false; | ||
162 | case G2_HUD: | ||
163 | if (record->event.pressed) { | ||
164 | gradient_100.h -= color_adj_step; | ||
165 | dprintf("Gradient 100 HSV: %d, %d, %d\n", gradient_100.h, gradient_100.s, gradient_100.v); | ||
166 | } | ||
167 | return false; | ||
168 | case G2_SAI: | ||
169 | if (record->event.pressed) { | ||
170 | gradient_100.s = (gradient_100.s + color_adj_step * 2 <= 255) ? gradient_100.s + color_adj_step * 2 : 255; | ||
171 | dprintf("Gradient 100 HSV: %d, %d, %d\n", gradient_100.h, gradient_100.s, gradient_100.v); | ||
172 | } | ||
173 | return false; | ||
174 | case G2_SAD: | ||
175 | if (record->event.pressed) { | ||
176 | gradient_100.s = (gradient_100.s - color_adj_step * 2 >= 0) ? gradient_100.s - color_adj_step * 2 : 0; | ||
177 | dprintf("Gradient 100 HSV: %d, %d, %d\n", gradient_100.h, gradient_100.s, gradient_100.v); | ||
178 | } | ||
179 | return false; | ||
180 | case G2_VAI: | ||
181 | if (record->event.pressed) { | ||
182 | gradient_100.v = (gradient_100.v + color_adj_step * 2 <= 255) ? gradient_100.v + color_adj_step * 2 : 255; | ||
183 | dprintf("Gradient 100 HSV: %d, %d, %d\n", gradient_100.h, gradient_100.s, gradient_100.v); | ||
184 | } | ||
185 | return false; | ||
186 | case G2_VAD: | ||
187 | if (record->event.pressed) { | ||
188 | gradient_100.v = (gradient_100.v - color_adj_step * 2 >= 0) ? gradient_100.v - color_adj_step * 2 : 0; | ||
189 | dprintf("Gradient 100 HSV: %d, %d, %d\n", gradient_100.h, gradient_100.s, gradient_100.v); | ||
190 | } | ||
191 | return false; | ||
192 | case G_PRE: | ||
193 | if (record->event.pressed) { | ||
194 | gp_i = (gp_i + gp_length ) % gp_length; | ||
195 | |||
196 | gradient_0 = gradient_presets[gp_i].gradient_0; | ||
197 | gradient_100 = gradient_presets[gp_i].gradient_1; | ||
198 | reflected_gradient = gradient_presets[gp_i].reflected; | ||
199 | |||
200 | gp_i += 1; | ||
201 | } | ||
202 | return false; | ||
203 | case REF_G: | ||
204 | if (record->event.pressed) { | ||
205 | reflected_gradient = !reflected_gradient; | ||
206 | } | ||
207 | return false; | ||
208 | case G_FLIP: | ||
209 | if (record->event.pressed) { | ||
210 | HSV temp_color = gradient_0; | ||
211 | gradient_0 = gradient_100; | ||
212 | gradient_100 = temp_color; | ||
213 | } | ||
214 | return false; | ||
215 | case RGB_C_E: | ||
216 | if (record->event.pressed) { | ||
217 | switch (rgb_matrix_get_mode()) { | ||
218 | case RGB_MATRIX_CUSTOM_CUSTOM_GRADIENT: | ||
219 | rgb_matrix_mode(RGB_MATRIX_CUSTOM_DIAGONAL); | ||
220 | return false; | ||
221 | case RGB_MATRIX_CUSTOM_DIAGONAL: | ||
222 | rgb_matrix_mode(RGB_MATRIX_CUSTOM_COOL_DIAGONAL); | ||
223 | return false; | ||
224 | case RGB_MATRIX_CUSTOM_COOL_DIAGONAL: | ||
225 | rgb_matrix_mode(RGB_MATRIX_CUSTOM_KITT); | ||
226 | return false; | ||
227 | case RGB_MATRIX_CUSTOM_KITT: | ||
228 | rgb_matrix_mode(RGB_MATRIX_CUSTOM_RANDOM_BREATH_RAINBOW); | ||
229 | return false; | ||
230 | default: | ||
231 | rgb_matrix_mode(RGB_MATRIX_CUSTOM_CUSTOM_GRADIENT); | ||
232 | return false; | ||
233 | } | ||
234 | } | ||
235 | return false; | ||
236 | case RGB_TOG: | ||
237 | if (record->event.pressed) { | ||
238 | switch (rgb_matrix_get_flags()) { | ||
239 | case LED_FLAG_ALL: { | ||
240 | rgb_matrix_set_flags(LED_FLAG_NONE); | ||
241 | rgb_matrix_set_color_all(0, 0, 0); | ||
242 | user_config.rgb_mode = RGB_MODE_NONE; | ||
243 | } | ||
244 | break; | ||
245 | default: { | ||
246 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
247 | rgb_matrix_enable_noeeprom(); | ||
248 | user_config.rgb_mode = RGB_MODE_ALL; | ||
249 | } | ||
250 | break; | ||
251 | } | ||
252 | eeconfig_update_user(user_config.raw); | ||
253 | } | ||
254 | return false; | ||
255 | } | ||
256 | return true; | ||
257 | } | ||
258 | |||
259 | void rgb_matrix_indicators_user(void) { | ||
260 | uint8_t side_leds_left[3] = {17, 18, 19}; | ||
261 | uint8_t side_leds_right[3] = { 4, 5, 6}; | ||
262 | HSV hsv = rgb_matrix_config.hsv; | ||
263 | uint8_t time = scale16by8(g_rgb_timer, qadd8(32, 1)); | ||
264 | hsv.h = time; | ||
265 | RGB rgb = hsv_to_rgb(hsv); | ||
266 | |||
267 | if ((rgb_matrix_get_flags() & LED_FLAG_ALL)) { | ||
268 | if (host_keyboard_led_state().caps_lock) { | ||
269 | for (uint8_t i = 0; i < 3; i++) | ||
270 | { | ||
271 | rgb_matrix_set_color(side_leds_left[i], rgb.r, rgb.g, rgb.b); | ||
272 | } | ||
273 | } | ||
274 | if (host_keyboard_led_state().scroll_lock) { | ||
275 | for (uint8_t i = 0; i < 3; i++) | ||
276 | { | ||
277 | rgb_matrix_set_color(side_leds_right[i], rgb.r, rgb.g, rgb.b); | ||
278 | } | ||
279 | } | ||
280 | } else { | ||
281 | if (host_keyboard_led_state().caps_lock) { | ||
282 | for (uint8_t i = 0; i < 3; i++) | ||
283 | { | ||
284 | rgb_matrix_set_color(side_leds_left[i], rgb.r, rgb.g, rgb.b); | ||
285 | } | ||
286 | } else { | ||
287 | for (uint8_t i = 0; i < 3; i++) | ||
288 | { | ||
289 | rgb_matrix_set_color(side_leds_left[i], 0, 0, 0); | ||
290 | } | ||
291 | } | ||
292 | if (host_keyboard_led_state().scroll_lock) { | ||
293 | for (uint8_t i = 0; i < 3; i++) | ||
294 | { | ||
295 | rgb_matrix_set_color(side_leds_right[i], rgb.r, rgb.g, rgb.b); | ||
296 | } | ||
297 | } else { | ||
298 | for (uint8_t i = 0; i < 3; i++) | ||
299 | { | ||
300 | rgb_matrix_set_color(side_leds_right[i], 0, 0, 0); | ||
301 | } | ||
302 | } | ||
303 | } | ||
304 | } | ||
diff --git a/keyboards/handwired/horrortroll/k552/keymaps/via/led/cool_diagonal.c b/keyboards/handwired/horrortroll/k552/keymaps/via/led/cool_diagonal.c new file mode 100644 index 000000000..2c518a543 --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/keymaps/via/led/cool_diagonal.c | |||
@@ -0,0 +1,22 @@ | |||
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 | static HSV COOL_DIAGONAL_math(HSV hsv, uint8_t i, uint8_t time) { | ||
18 | hsv.h = (g_led_config.point[i].x / 4) - g_led_config.point[i].y - time; | ||
19 | return hsv; | ||
20 | } | ||
21 | |||
22 | bool COOL_DIAGONAL(effect_params_t* params) { return effect_runner_i(params, &COOL_DIAGONAL_math); } \ No newline at end of file | ||
diff --git a/keyboards/handwired/horrortroll/k552/keymaps/via/led/custom_gradient.c b/keyboards/handwired/horrortroll/k552/keymaps/via/led/custom_gradient.c new file mode 100644 index 000000000..49e4a242f --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/keymaps/via/led/custom_gradient.c | |||
@@ -0,0 +1,74 @@ | |||
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 | extern HSV gradient_0; | ||
18 | extern HSV gradient_100; | ||
19 | extern bool reflected_gradient; | ||
20 | |||
21 | static HSV INTERPOLATE_HSV(float step, HSV gradient_0, HSV gradient_100) { | ||
22 | uint8_t cw, ccw; | ||
23 | HSV color; | ||
24 | |||
25 | cw = (gradient_0.h >= gradient_100.h) ? 255 + gradient_100.h - gradient_0.h : gradient_100.h - gradient_0.h; // Hue range is 0 to 255. | ||
26 | ccw = (gradient_0.h >= gradient_100.h) ? gradient_0.h - gradient_100.h : 255 + gradient_0.h - gradient_100.h; | ||
27 | |||
28 | if( cw < ccw ) { // going clockwise | ||
29 | color.h = gradient_0.h + (uint8_t)(step * cw); | ||
30 | } else { // Going counter clockwise | ||
31 | color.h = gradient_0.h - (uint8_t)(step * ccw); | ||
32 | } | ||
33 | |||
34 | color.s = gradient_0.s + step * (gradient_100.s - gradient_0.s); | ||
35 | |||
36 | // Scale V with global RGB Matrix's V, so users can still control overall brightness with RGB_VAI & RGB_VAD0 | ||
37 | color.v = round((gradient_0.v + step * (gradient_100.v - gradient_0.v)) * ((float)rgb_matrix_config.hsv.v / 255)); | ||
38 | |||
39 | return color; | ||
40 | } | ||
41 | |||
42 | static HSV CUSTOM_GRADIENT_math(uint8_t led_x, uint8_t min_x, uint8_t max_x) { | ||
43 | float step = (float)led_x / (max_x - min_x); | ||
44 | float mid_gradient_pos = 0.5; | ||
45 | |||
46 | if( reflected_gradient ) { | ||
47 | if( step <= mid_gradient_pos ) { | ||
48 | return INTERPOLATE_HSV(step * (1/mid_gradient_pos), gradient_0, gradient_100); | ||
49 | } else { | ||
50 | return INTERPOLATE_HSV((step - mid_gradient_pos) * (1/(1-mid_gradient_pos)), gradient_100, gradient_0); | ||
51 | } | ||
52 | |||
53 | } else { | ||
54 | return INTERPOLATE_HSV(step, gradient_0, gradient_100); | ||
55 | } | ||
56 | } | ||
57 | |||
58 | static bool CUSTOM_GRADIENT(effect_params_t* params) { | ||
59 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | ||
60 | |||
61 | uint8_t min_x = 0; // X coordinate of the left-most LED | ||
62 | uint8_t max_x = 224; // X coordinate of the right-most LED | ||
63 | |||
64 | for (uint8_t i = led_min; i < led_max; i++) { | ||
65 | RGB_MATRIX_TEST_LED_FLAGS(); | ||
66 | |||
67 | HSV hsv_orig = CUSTOM_GRADIENT_math(g_led_config.point[i].x, min_x, max_x); | ||
68 | RGB rgb = hsv_to_rgb(hsv_orig); | ||
69 | |||
70 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); | ||
71 | } | ||
72 | |||
73 | return led_max < DRIVER_LED_TOTAL; | ||
74 | } | ||
diff --git a/keyboards/handwired/horrortroll/k552/keymaps/via/led/diagonal.c b/keyboards/handwired/horrortroll/k552/keymaps/via/led/diagonal.c new file mode 100644 index 000000000..19e3791bd --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/keymaps/via/led/diagonal.c | |||
@@ -0,0 +1,22 @@ | |||
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 | static HSV DIAGONAL_math(HSV hsv, uint8_t i, uint8_t time) { | ||
18 | hsv.h = g_led_config.point[i].x - g_led_config.point[i].y - time; | ||
19 | return hsv; | ||
20 | } | ||
21 | |||
22 | bool DIAGONAL(effect_params_t* params) { return effect_runner_i(params, &DIAGONAL_math); } | ||
diff --git a/keyboards/handwired/horrortroll/k552/keymaps/via/led/kitt.c b/keyboards/handwired/horrortroll/k552/keymaps/via/led/kitt.c new file mode 100644 index 000000000..823eb5839 --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/keymaps/via/led/kitt.c | |||
@@ -0,0 +1,68 @@ | |||
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 | // variable for startup animation | ||
18 | bool BASE_EFFECT_NOT_STARTED_YET = true; | ||
19 | uint8_t base_effect_startup_counter = 255; | ||
20 | |||
21 | uint8_t led_count = 10; | ||
22 | uint8_t led_first = 7; | ||
23 | |||
24 | static uint8_t time_to_led(uint8_t time, uint8_t led_behind) { | ||
25 | uint16_t led_time = led_count * time; | ||
26 | uint16_t step = ((2 * led_count + (led_time / 128)) - led_behind) % (2 * led_count); | ||
27 | uint8_t led; | ||
28 | |||
29 | if (step < led_count) { | ||
30 | led = step; | ||
31 | } else { | ||
32 | led = led_count - 1 - (step - led_count); | ||
33 | } | ||
34 | |||
35 | return led; | ||
36 | } | ||
37 | |||
38 | static HSV KITT_math(HSV hsv, uint8_t i, uint8_t time) { | ||
39 | |||
40 | // reset base effect startup | ||
41 | if (i == 0) { | ||
42 | BASE_EFFECT_NOT_STARTED_YET = true; | ||
43 | } | ||
44 | |||
45 | hsv.h = 0; | ||
46 | hsv.s = 255; | ||
47 | |||
48 | if (i >= led_first && i < led_first + led_count) { | ||
49 | uint8_t j = i - led_first; | ||
50 | if (j == time_to_led(time, 0)) { | ||
51 | hsv.v = hsv.v; | ||
52 | } else if (j == time_to_led(time, 1)) { | ||
53 | hsv.v = hsv.v/2; | ||
54 | } else if (j == time_to_led(time, 2)) { | ||
55 | hsv.v = hsv.v/4; | ||
56 | } else if (j == time_to_led(time, 3)) { | ||
57 | hsv.v = hsv.v/8; | ||
58 | } else { | ||
59 | hsv.v = 0; | ||
60 | } | ||
61 | } else { | ||
62 | hsv.v = 0; | ||
63 | } | ||
64 | |||
65 | return hsv; | ||
66 | } | ||
67 | |||
68 | bool KITT(effect_params_t* params) { return effect_runner_i(params, &KITT_math); } | ||
diff --git a/keyboards/handwired/horrortroll/k552/keymaps/via/led/random_breath_rainbow.c b/keyboards/handwired/horrortroll/k552/keymaps/via/led/random_breath_rainbow.c new file mode 100644 index 000000000..041417477 --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/keymaps/via/led/random_breath_rainbow.c | |||
@@ -0,0 +1,55 @@ | |||
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 | static uint8_t offset[DRIVER_LED_TOTAL]; | ||
18 | |||
19 | static void doRandom_breath_rainbow(int i, effect_params_t* params) { | ||
20 | if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) return; | ||
21 | uint16_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 6); | ||
22 | |||
23 | if (rand() * 50 == 1) { | ||
24 | if (rand() * 2 == 1) { | ||
25 | offset[i]++; | ||
26 | } | ||
27 | else { | ||
28 | offset[i]--; | ||
29 | } | ||
30 | } | ||
31 | |||
32 | //float val = (((float)sin8(time + offset[i]) / 256)/2.1) + .05; | ||
33 | HSV hsv = {0, 255, 255}; | ||
34 | hsv.h = scale16by8(g_rgb_timer + offset[i], rgb_matrix_config.speed / 4) + (offset[i]*2); | ||
35 | hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); | ||
36 | RGB rgb = rgb_matrix_hsv_to_rgb(hsv); | ||
37 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); | ||
38 | } | ||
39 | |||
40 | bool RANDOM_BREATH_RAINBOW(effect_params_t* params) { | ||
41 | |||
42 | if (!params->init) { | ||
43 | // Change one LED every tick, make sure speed is not 0 | ||
44 | doRandom_breath_rainbow(rand() % DRIVER_LED_TOTAL, params); | ||
45 | return false; | ||
46 | } | ||
47 | |||
48 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | ||
49 | |||
50 | for (uint8_t i = led_min; i < led_max; i++) { | ||
51 | doRandom_breath_rainbow(i, params); | ||
52 | } | ||
53 | |||
54 | return led_max < DRIVER_LED_TOTAL; | ||
55 | } | ||
diff --git a/keyboards/handwired/horrortroll/k552/keymaps/via/oled/oled_stuff.h b/keyboards/handwired/horrortroll/k552/keymaps/via/oled/oled_stuff.h new file mode 100644 index 000000000..9d8d62917 --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/keymaps/via/oled/oled_stuff.h | |||
@@ -0,0 +1,69 @@ | |||
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 | // OLED animation | ||
18 | #include "lib/bongocat.c" | ||
19 | #include "lib/galaxy.c" | ||
20 | #include "lib/wave.c" | ||
21 | |||
22 | #ifdef OLED_ENABLE | ||
23 | bool oled_task_user(void) { | ||
24 | led_t led_usb_state = host_keyboard_led_state(); | ||
25 | static uint8_t old_layer; | ||
26 | uint8_t layer = get_highest_layer(layer_state | default_layer_state); | ||
27 | |||
28 | if (layer != old_layer) { | ||
29 | oled_clear(); | ||
30 | } | ||
31 | |||
32 | old_layer = layer; | ||
33 | |||
34 | switch (layer) { | ||
35 | case 0: | ||
36 | render_bongocat(); | ||
37 | oled_set_cursor(14, 0); // sets cursor to (column, row) using charactar spacing (4 rows on 128x32 screen, anything more will overflow back to the top) | ||
38 | oled_write_P(PSTR("WPM:"), false); | ||
39 | oled_write(get_u8_str(get_current_wpm(), '0'), false); // writes wpm on top right corner of string | ||
40 | oled_set_cursor(17, 2); | ||
41 | oled_write_P(led_usb_state.caps_lock ? PSTR("CAPS") : PSTR(" "), false); | ||
42 | oled_set_cursor(17, 3); | ||
43 | oled_write_P(led_usb_state.scroll_lock ? PSTR("SCRL") : PSTR(" "), false); | ||
44 | break; | ||
45 | case 1: | ||
46 | // sleep if it has been long enough since we last got a char | ||
47 | if (timer_elapsed32(wave_sleep) > OLED_TIMEOUT) { | ||
48 | oled_off(); | ||
49 | } else { | ||
50 | oled_on(); | ||
51 | } | ||
52 | // time for the next frame? | ||
53 | if (timer_elapsed(wave_timer) > FRAME_TIMEOUT) { | ||
54 | wave_timer = timer_read(); | ||
55 | render_frame(); | ||
56 | } | ||
57 | |||
58 | oled_set_cursor(0, 3); | ||
59 | oled_write_P(led_usb_state.caps_lock ? PSTR("CAPS") : PSTR(" "), false); | ||
60 | oled_set_cursor(17, 3); | ||
61 | oled_write_P(led_usb_state.scroll_lock ? PSTR("SCRL") : PSTR(" "), false); | ||
62 | break; | ||
63 | case 2: | ||
64 | render_galaxy(); | ||
65 | break; | ||
66 | } | ||
67 | return false; | ||
68 | } | ||
69 | #endif | ||
diff --git a/keyboards/handwired/horrortroll/k552/keymaps/via/readme.md b/keyboards/handwired/horrortroll/k552/keymaps/via/readme.md new file mode 100644 index 000000000..c8f9c1f8e --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/keymaps/via/readme.md | |||
@@ -0,0 +1,16 @@ | |||
1 | # Default layout and custom LED / OLED | ||
2 | |||
3 | Keymap is default 87 qwerty, TKL layout | ||
4 | |||
5 | It have new LED effect: | ||
6 | - Custom gradient (ported from SirTimmyTimbit code [https://github.com/SirTimmyTimbit/customizable-gradient-effect-for-drop-alt]) | ||
7 | - Diagonal (ported from pleasuretek code [https://github.com/pleasuretek/qmk_firmware]) | ||
8 | - Cool diagonal (ported from pleasuretek code [https://github.com/pleasuretek/qmk_firmware]) | ||
9 | - Knight Rider (ported from jumper149 code [https://github.com/jumper149/qmk_firmware/blob/jumper149/keyboards/dztech/dz65rgb/keymaps/jumper149/]) | ||
10 | - Random breath rainbow (based from daed code [https://github.com/daed/qmk_firmware/blob/master/keyboards/massdrop/alt/keymaps/daed] and modify by me) | ||
11 | |||
12 | And OLED Animation: | ||
13 | - Bongo Cat (ported from nwii code [https://github.com/nwii/oledbongocat] and modify image animation by me) | ||
14 | - Waveform Typing (ported from drcforbin code [https://github.com/drcforbin/keyboards] and modify to correct my TKL layout) | ||
15 | - Galaxy image when pressing FN key (original image [https://www.deviantart.com/rock-bomber/art/Gateway-668850827] and redraw then cut for 128x32 size by me) | ||
16 | - Redragon Logo when booting up | ||
diff --git a/keyboards/handwired/horrortroll/k552/keymaps/via/rgb_matrix_user.inc b/keyboards/handwired/horrortroll/k552/keymaps/via/rgb_matrix_user.inc new file mode 100644 index 000000000..38edbae99 --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/keymaps/via/rgb_matrix_user.inc | |||
@@ -0,0 +1,15 @@ | |||
1 | RGB_MATRIX_EFFECT(CUSTOM_GRADIENT) | ||
2 | RGB_MATRIX_EFFECT(DIAGONAL) | ||
3 | RGB_MATRIX_EFFECT(COOL_DIAGONAL) | ||
4 | RGB_MATRIX_EFFECT(KITT) | ||
5 | RGB_MATRIX_EFFECT(RANDOM_BREATH_RAINBOW) | ||
6 | |||
7 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
8 | |||
9 | #include "led/custom_gradient.c" | ||
10 | #include "led/diagonal.c" | ||
11 | #include "led/cool_diagonal.c" | ||
12 | #include "led/kitt.c" | ||
13 | #include "led/random_breath_rainbow.c" | ||
14 | |||
15 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS \ No newline at end of file | ||
diff --git a/keyboards/handwired/horrortroll/k552/keymaps/via/rules.mk b/keyboards/handwired/horrortroll/k552/keymaps/via/rules.mk new file mode 100644 index 000000000..d475530c8 --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/keymaps/via/rules.mk | |||
@@ -0,0 +1,3 @@ | |||
1 | VIA_ENABLE = yes | ||
2 | |||
3 | RGB_MATRIX_CUSTOM_USER = yes | ||
diff --git a/keyboards/handwired/horrortroll/k552/ld/k552_f103.ld b/keyboards/handwired/horrortroll/k552/ld/k552_f103.ld new file mode 100644 index 000000000..7b9e75b3c --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/ld/k552_f103.ld | |||
@@ -0,0 +1,85 @@ | |||
1 | /* | ||
2 | ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio | ||
3 | |||
4 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | you may not use this file except in compliance with the License. | ||
6 | You may obtain a copy of the License at | ||
7 | |||
8 | http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | |||
10 | Unless required by applicable law or agreed to in writing, software | ||
11 | distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | See the License for the specific language governing permissions and | ||
14 | limitations under the License. | ||
15 | */ | ||
16 | |||
17 | /* | ||
18 | * STM32F103xC memory setup for use with the K552 mass-storage device bootloader. | ||
19 | */ | ||
20 | MEMORY | ||
21 | { | ||
22 | flash0 : org = 0x08002000, len = 256k - 0x2000 | ||
23 | flash1 : org = 0x00000000, len = 0 | ||
24 | flash2 : org = 0x00000000, len = 0 | ||
25 | flash3 : org = 0x00000000, len = 0 | ||
26 | flash4 : org = 0x00000000, len = 0 | ||
27 | flash5 : org = 0x00000000, len = 0 | ||
28 | flash6 : org = 0x00000000, len = 0 | ||
29 | flash7 : org = 0x00000000, len = 0 | ||
30 | ram0 : org = 0x20000000, len = 48k | ||
31 | ram1 : org = 0x00000000, len = 0 | ||
32 | ram2 : org = 0x00000000, len = 0 | ||
33 | ram3 : org = 0x00000000, len = 0 | ||
34 | ram4 : org = 0x00000000, len = 0 | ||
35 | ram5 : org = 0x00000000, len = 0 | ||
36 | ram6 : org = 0x00000000, len = 0 | ||
37 | ram7 : org = 0x00000000, len = 0 | ||
38 | } | ||
39 | |||
40 | /* For each data/text section two region are defined, a virtual region | ||
41 | and a load region (_LMA suffix).*/ | ||
42 | |||
43 | /* Flash region to be used for exception vectors.*/ | ||
44 | REGION_ALIAS("VECTORS_FLASH", flash0); | ||
45 | REGION_ALIAS("VECTORS_FLASH_LMA", flash0); | ||
46 | |||
47 | /* Flash region to be used for constructors and destructors.*/ | ||
48 | REGION_ALIAS("XTORS_FLASH", flash0); | ||
49 | REGION_ALIAS("XTORS_FLASH_LMA", flash0); | ||
50 | |||
51 | /* Flash region to be used for code text.*/ | ||
52 | REGION_ALIAS("TEXT_FLASH", flash0); | ||
53 | REGION_ALIAS("TEXT_FLASH_LMA", flash0); | ||
54 | |||
55 | /* Flash region to be used for read only data.*/ | ||
56 | REGION_ALIAS("RODATA_FLASH", flash0); | ||
57 | REGION_ALIAS("RODATA_FLASH_LMA", flash0); | ||
58 | |||
59 | /* Flash region to be used for various.*/ | ||
60 | REGION_ALIAS("VARIOUS_FLASH", flash0); | ||
61 | REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); | ||
62 | |||
63 | /* Flash region to be used for RAM(n) initialization data.*/ | ||
64 | REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); | ||
65 | |||
66 | /* RAM region to be used for Main stack. This stack accommodates the processing | ||
67 | of all exceptions and interrupts.*/ | ||
68 | REGION_ALIAS("MAIN_STACK_RAM", ram0); | ||
69 | |||
70 | /* RAM region to be used for the process stack. This is the stack used by | ||
71 | the main() function.*/ | ||
72 | REGION_ALIAS("PROCESS_STACK_RAM", ram0); | ||
73 | |||
74 | /* RAM region to be used for data segment.*/ | ||
75 | REGION_ALIAS("DATA_RAM", ram0); | ||
76 | REGION_ALIAS("DATA_RAM_LMA", flash0); | ||
77 | |||
78 | /* RAM region to be used for BSS segment.*/ | ||
79 | REGION_ALIAS("BSS_RAM", ram0); | ||
80 | |||
81 | /* RAM region to be used for the default heap.*/ | ||
82 | REGION_ALIAS("HEAP_RAM", ram0); | ||
83 | |||
84 | /* Generic rules inclusion.*/ | ||
85 | INCLUDE rules.ld | ||
diff --git a/keyboards/handwired/horrortroll/k552/lib/bongocat.c b/keyboards/handwired/horrortroll/k552/lib/bongocat.c new file mode 100644 index 000000000..fbde9c911 --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/lib/bongocat.c | |||
@@ -0,0 +1,376 @@ | |||
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 | // WPM-responsive animation stuff here | ||
18 | # define IDLE_FRAMES 5 | ||
19 | # define IDLE_SPEED 10 // below this wpm value your animation will idle | ||
20 | // #define PREP_FRAMES 1 // uncomment if >1 | ||
21 | # define TAP_FRAMES 2 | ||
22 | # define ANIM_WPM_LOWER 20 // above this wpm value typing animation to trigger | ||
23 | # define ANIM_FRAME_DURATION_MAX 450 // longest animation duration in ms | ||
24 | # define ANIM_FRAME_DURATION_MIN 100 // shortest animation duration in ms | ||
25 | # define IDLE_FRAME_DURATION 300 // how long each frame lasts in ms | ||
26 | # define ANIM_FRAME_RATIO 2.5 // how aggressively animation speeds up with wpm | ||
27 | // #define SLEEP_TIMER 60000 // should sleep after this period of 0 wpm, needs fixing | ||
28 | # define ANIM_SIZE 636 // number of bytes in array, minimize for adequate firmware size, max is 1024 | ||
29 | # define MAX(x, y) (((x) > (y)) ? (x) : (y)) // Math.max macro | ||
30 | |||
31 | uint32_t curr_anim_duration = 0; // variable animation duration | ||
32 | uint32_t bongo_timer = 0; | ||
33 | uint32_t bongo_sleep = 0; | ||
34 | uint8_t current_idle_frame = 0; | ||
35 | // uint8_t current_prep_frame = 0; // uncomment if PREP_FRAMES >1 | ||
36 | uint8_t current_tap_frame = 0; | ||
37 | |||
38 | // Code containing pixel art, contains: | ||
39 | // 5 idle frames, 1 prep frame, and 2 tap frames | ||
40 | |||
41 | // To make your own pixel art: | ||
42 | // save a png/jpeg of an 128x32 image (resource: https://www.pixilart.com/draw ) | ||
43 | // follow this guide up to and including "CONVERT YOUR IMAGE" https://docs.splitkb.com/hc/en-us/articles/360013811280-How-do-I-convert-an-image-for-use-on-an-OLED-display- | ||
44 | // replace numbers in brackets with your own | ||
45 | // if you start getting errors when compiling make sure you didn't accedentally delete a bracket | ||
46 | static void render_bongocat(void) { | ||
47 | static const char PROGMEM idle[IDLE_FRAMES][ANIM_SIZE] = { | ||
48 | { | ||
49 | //Idle 1 - 128x32 | ||
50 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xce, 0x9c, 0xf8, 0xfc, 0xfe, 0x80, 0xe0, 0x20, 0x00, | ||
51 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
52 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xc0, 0xc0, 0xe0, 0xe0, 0xf0, | ||
53 | 0xf8, 0xfc, 0xfe, 0xff, 0xfe, 0xfc, 0xf8, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xc0, 0xc0, 0xc0, 0x80, | ||
54 | 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
55 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
56 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
57 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
58 | 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x38, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0x31, 0x00, 0x08, | ||
59 | 0x10, 0x10, 0x10, 0x10, 0x20, 0x20, 0x20, 0x20, 0x40, 0x40, 0x40, 0x40, 0x80, 0x80, 0x80, 0x80, | ||
60 | 0xc0, 0xe0, 0xf0, 0xf8, 0xf8, 0xfc, 0xfc, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xcf, 0xff, | ||
61 | 0xff, 0xbf, 0x7f, 0x7f, 0xbf, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, | ||
62 | 0xff, 0xfe, 0xfe, 0xfc, 0xfc, 0xfc, 0xfc, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, | ||
63 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
64 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
65 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
66 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, 0x0f, 0x0f, 0x0f, 0x01, 0x00, 0x00, 0x00, | ||
67 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0x30, 0x38, 0x2c, 0x04, 0x64, 0xf8, 0xfe, 0xff, | ||
68 | 0xff, 0xff, 0xff, 0xff, 0x7f, 0xbf, 0x8f, 0x27, 0x27, 0x27, 0xc7, 0xc7, 0x4f, 0x4f, 0x8f, 0x8f, | ||
69 | 0x9f, 0x9f, 0x1f, 0x1f, 0x3f, 0x3e, 0x3e, 0x3f, 0x7f, 0x7f, 0x7f, 0x7f, 0xfc, 0xfc, 0xff, 0xff, | ||
70 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xf8, 0xe0, 0x00, 0x00, | ||
71 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
72 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
73 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
74 | 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0x60, 0x30, 0x10, 0x18, 0x08, 0x08, 0x08, 0x18, 0x10, 0x30, | ||
75 | 0x60, 0x40, 0xc0, 0x86, 0x87, 0x85, 0xc4, 0x49, 0x69, 0x3e, 0x0e, 0x13, 0x11, 0x12, 0x12, 0x3d, | ||
76 | 0x2d, 0x25, 0x26, 0x44, 0x68, 0x78, 0x58, 0x9d, 0x97, 0x93, 0xe3, 0x62, 0x34, 0x3c, 0x2c, 0x26, | ||
77 | 0xc7, 0xc5, 0x69, 0x39, 0x19, 0x1d, 0x36, 0xa2, 0xe2, 0x62, 0x24, 0x18, 0x3c, 0x7e, 0x7f, 0x7f, | ||
78 | 0x7f, 0xbf, 0x3f, 0x1f, 0x1f, 0x8f, 0xe7, 0x63, 0x27, 0x27, 0x47, 0x47, 0xcf, 0xcf, 0x0f, 0x08, | ||
79 | 0x10, 0x10, 0x10, 0x10, 0x20, 0x20, 0x20, 0x20, 0x40, 0x40, 0x40, 0x40, 0x80, 0x80, 0x80, 0x80, | ||
80 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
81 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | ||
82 | }, | ||
83 | { | ||
84 | //Idle 2 - 128x32 | ||
85 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xce, 0x9c, 0xf8, 0xfc, 0xfe, 0x80, 0xe0, 0x20, 0x00, | ||
86 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
87 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xc0, 0xe0, 0xf0, | ||
88 | 0xf8, 0xfc, 0xfe, 0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0xc0, 0xc0, 0x80, 0x80, 0x00, 0x00, | ||
89 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
90 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
91 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
92 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
93 | 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x38, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0x31, 0x00, 0x08, | ||
94 | 0x10, 0x10, 0x10, 0x10, 0x20, 0x20, 0x20, 0x20, 0x40, 0x40, 0x40, 0x40, 0x80, 0x80, 0x80, 0x80, | ||
95 | 0xc0, 0xe0, 0xe0, 0xf0, 0xf0, 0xf8, 0xf8, 0xfc, 0xfc, 0xfe, 0xff, 0xff, 0xff, 0x9f, 0x9f, 0xff, | ||
96 | 0xff, 0x7f, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, | ||
97 | 0xff, 0xfe, 0xfe, 0xfc, 0xfc, 0xfc, 0xfc, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, | ||
98 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
99 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
100 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
101 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, 0x0f, 0x0f, 0x0f, 0x01, 0x00, 0x00, 0x00, | ||
102 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0x30, 0x38, 0x2c, 0x04, 0x64, 0xf8, 0xfe, 0xff, | ||
103 | 0xff, 0xff, 0xff, 0xff, 0x7f, 0xbf, 0x8f, 0x27, 0x27, 0x27, 0xc7, 0xc7, 0x4f, 0x4f, 0x8f, 0x8f, | ||
104 | 0x9f, 0x9f, 0x1e, 0x1e, 0x3f, 0x3d, 0x3d, 0x3e, 0x7f, 0x7f, 0x7f, 0x7f, 0xf9, 0xf9, 0xff, 0xff, | ||
105 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xf0, 0xc0, 0x00, 0x00, | ||
106 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
107 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
108 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
109 | 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0x60, 0x30, 0x10, 0x18, 0x08, 0x08, 0x08, 0x18, 0x10, 0x30, | ||
110 | 0x60, 0x40, 0xc0, 0x86, 0x87, 0x85, 0xc4, 0x49, 0x69, 0x3e, 0x0e, 0x13, 0x11, 0x12, 0x12, 0x3d, | ||
111 | 0x2d, 0x25, 0x26, 0x44, 0x68, 0x78, 0x58, 0x9d, 0x97, 0x93, 0xe3, 0x62, 0x34, 0x3c, 0x2c, 0x26, | ||
112 | 0xc7, 0xc5, 0x69, 0x39, 0x19, 0x1d, 0x36, 0xa2, 0xe2, 0x62, 0x24, 0x18, 0x3c, 0x7e, 0x7f, 0x7f, | ||
113 | 0x7f, 0xbf, 0x3f, 0x1f, 0x1f, 0x8f, 0xe7, 0x63, 0x27, 0x27, 0x47, 0x47, 0xcf, 0xcf, 0x0f, 0x08, | ||
114 | 0x10, 0x10, 0x10, 0x10, 0x20, 0x20, 0x20, 0x20, 0x40, 0x40, 0x40, 0x40, 0x80, 0x80, 0x80, 0x80, | ||
115 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
116 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | ||
117 | }, | ||
118 | { | ||
119 | //Idle 3 - 128x32 | ||
120 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xce, 0x9c, 0xf8, 0xfc, 0xfe, 0x80, 0xe0, 0x20, 0x00, | ||
121 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
122 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xc0, 0xe0, | ||
123 | 0xf0, 0xf8, 0xfc, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0xc0, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, | ||
124 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
125 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
126 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
127 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
128 | 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x38, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0x31, 0x00, 0x08, | ||
129 | 0x10, 0x10, 0x10, 0x10, 0x20, 0x20, 0x20, 0x20, 0x40, 0x40, 0x40, 0x40, 0x80, 0x80, 0x80, 0x80, | ||
130 | 0xc0, 0xe0, 0xe0, 0xf0, 0xf0, 0xf8, 0xf8, 0xfc, 0xfc, 0xfe, 0xff, 0xff, 0xff, 0x9f, 0x9f, 0xff, | ||
131 | 0xff, 0x7f, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, | ||
132 | 0xfe, 0xfc, 0xfc, 0xf8, 0xf8, 0xf8, 0xf8, 0xfc, 0xfc, 0xfe, 0xfe, 0xfe, 0x7e, 0x00, 0x00, 0x00, | ||
133 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
134 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
135 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
136 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, 0x0f, 0x0f, 0x0f, 0x01, 0x00, 0x00, 0x00, | ||
137 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0x30, 0x38, 0x2c, 0x04, 0x64, 0xf8, 0xfe, 0xff, | ||
138 | 0xff, 0xff, 0xff, 0xff, 0x7f, 0xbf, 0x8f, 0x27, 0x27, 0x27, 0xc7, 0xc7, 0x4f, 0x4f, 0x8f, 0x8f, | ||
139 | 0x9f, 0x9f, 0x1e, 0x1e, 0x3f, 0x3d, 0x3d, 0x3e, 0x7f, 0x7f, 0x7f, 0x7f, 0xf9, 0xf9, 0xff, 0xff, | ||
140 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xf0, 0xc0, 0x00, 0x00, | ||
141 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
142 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
143 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
144 | 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0x60, 0x30, 0x10, 0x18, 0x08, 0x08, 0x08, 0x18, 0x10, 0x30, | ||
145 | 0x60, 0x40, 0xc0, 0x86, 0x87, 0x85, 0xc4, 0x49, 0x69, 0x3e, 0x0e, 0x13, 0x11, 0x12, 0x12, 0x3d, | ||
146 | 0x2d, 0x25, 0x26, 0x44, 0x68, 0x78, 0x58, 0x9d, 0x97, 0x93, 0xe3, 0x62, 0x34, 0x3c, 0x2c, 0x26, | ||
147 | 0xc7, 0xc5, 0x69, 0x39, 0x19, 0x1d, 0x36, 0xa2, 0xe2, 0x62, 0x24, 0x18, 0x3c, 0x7e, 0x7f, 0x7f, | ||
148 | 0x7f, 0xbf, 0x3f, 0x1f, 0x1f, 0x8f, 0xe7, 0x63, 0x27, 0x27, 0x47, 0x47, 0xcf, 0xcf, 0x0f, 0x08, | ||
149 | 0x10, 0x10, 0x10, 0x10, 0x20, 0x20, 0x20, 0x20, 0x40, 0x40, 0x40, 0x40, 0x80, 0x80, 0x80, 0x80, | ||
150 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
151 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | ||
152 | }, | ||
153 | { | ||
154 | //Idle 4 - 128x32 | ||
155 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xce, 0x9c, 0xf8, 0xfc, 0xfe, 0x80, 0xe0, 0x20, 0x00, | ||
156 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
157 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xc0, 0xe0, | ||
158 | 0xf0, 0xf8, 0xfc, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0xc0, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, | ||
159 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
160 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
161 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
162 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
163 | 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x38, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0x31, 0x00, 0x08, | ||
164 | 0x10, 0x10, 0x10, 0x10, 0x20, 0x20, 0x20, 0x20, 0x40, 0x40, 0x40, 0x40, 0x80, 0x80, 0x80, 0x80, | ||
165 | 0xc0, 0xe0, 0xf0, 0xf8, 0xf8, 0xfc, 0xfc, 0xfc, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0xcf, 0xcf, 0xff, | ||
166 | 0xff, 0xbf, 0x7f, 0x7f, 0xbf, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, | ||
167 | 0xfe, 0xfc, 0xfc, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xfc, 0xfc, 0xfc, 0xfc, 0x3c, 0x1c, 0x00, 0x00, | ||
168 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
169 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
170 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
171 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, 0x0f, 0x0f, 0x0f, 0x01, 0x00, 0x00, 0x00, | ||
172 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0x30, 0x38, 0x2c, 0x04, 0x64, 0xf8, 0xfe, 0xff, | ||
173 | 0xff, 0xff, 0xff, 0xff, 0x7f, 0xbf, 0x8f, 0x27, 0x27, 0x27, 0xc7, 0xc7, 0x4f, 0x4f, 0x8f, 0x8f, | ||
174 | 0x9f, 0x9f, 0x1f, 0x1f, 0x3f, 0x3e, 0x3e, 0x3f, 0x7f, 0x7f, 0x7f, 0x7f, 0xfc, 0xfc, 0xff, 0xff, | ||
175 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xf8, 0xe0, 0x00, 0x00, | ||
176 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
177 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
178 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
179 | 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0x60, 0x30, 0x10, 0x18, 0x08, 0x08, 0x08, 0x18, 0x10, 0x30, | ||
180 | 0x60, 0x40, 0xc0, 0x86, 0x87, 0x85, 0xc4, 0x49, 0x69, 0x3e, 0x0e, 0x13, 0x11, 0x12, 0x12, 0x3d, | ||
181 | 0x2d, 0x25, 0x26, 0x44, 0x68, 0x78, 0x58, 0x9d, 0x97, 0x93, 0xe3, 0x62, 0x34, 0x3c, 0x2c, 0x26, | ||
182 | 0xc7, 0xc5, 0x69, 0x39, 0x19, 0x1d, 0x36, 0xa2, 0xe2, 0x62, 0x24, 0x18, 0x3c, 0x7e, 0x7f, 0x7f, | ||
183 | 0x7f, 0xbf, 0x3f, 0x1f, 0x1f, 0x8f, 0xe7, 0x63, 0x27, 0x27, 0x47, 0x47, 0xcf, 0xcf, 0x0f, 0x08, | ||
184 | 0x10, 0x10, 0x10, 0x10, 0x20, 0x20, 0x20, 0x20, 0x40, 0x40, 0x40, 0x40, 0x80, 0x80, 0x80, 0x80, | ||
185 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
186 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | ||
187 | }, | ||
188 | { | ||
189 | //Idle 5 - 128x32 | ||
190 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xce, 0x9c, 0xf8, 0xfc, 0xfe, 0x80, 0xe0, 0x20, 0x00, | ||
191 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
192 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xc0, 0xc0, 0xe0, 0xe0, 0xf0, | ||
193 | 0xf8, 0xfc, 0xfe, 0xff, 0xfe, 0xfc, 0xf8, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xc0, 0xc0, 0xc0, 0x80, | ||
194 | 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
195 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
196 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
197 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
198 | 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x38, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0x31, 0x00, 0x08, | ||
199 | 0x10, 0x10, 0x10, 0x10, 0x20, 0x20, 0x20, 0x20, 0x40, 0x40, 0x40, 0x40, 0x80, 0x80, 0x80, 0x80, | ||
200 | 0xc0, 0xe0, 0xf0, 0xf8, 0xf8, 0xfc, 0xfc, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xcf, 0xff, | ||
201 | 0xff, 0xbf, 0x7f, 0x7f, 0xbf, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, | ||
202 | 0xff, 0xfe, 0xfe, 0xfc, 0xfc, 0xfe, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x0f, 0x06, 0x00, | ||
203 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
204 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
205 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
206 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, 0x0f, 0x0f, 0x0f, 0x01, 0x00, 0x00, 0x00, | ||
207 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0x30, 0x38, 0x2c, 0x04, 0x64, 0xf8, 0xfe, 0xff, | ||
208 | 0xff, 0xff, 0xff, 0xff, 0x7f, 0xbf, 0x8f, 0x27, 0x27, 0x27, 0xc7, 0xc7, 0x4f, 0x4f, 0x8f, 0x8f, | ||
209 | 0x9f, 0x9f, 0x1f, 0x1f, 0x3f, 0x3e, 0x3e, 0x3f, 0x7f, 0x7f, 0x7f, 0x7f, 0xfc, 0xfc, 0xff, 0xff, | ||
210 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xf8, 0xe0, 0x00, 0x00, | ||
211 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
212 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
213 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
214 | 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0x60, 0x30, 0x10, 0x18, 0x08, 0x08, 0x08, 0x18, 0x10, 0x30, | ||
215 | 0x60, 0x40, 0xc0, 0x86, 0x87, 0x85, 0xc4, 0x49, 0x69, 0x3e, 0x0e, 0x13, 0x11, 0x12, 0x12, 0x3d, | ||
216 | 0x2d, 0x25, 0x26, 0x44, 0x68, 0x78, 0x58, 0x9d, 0x97, 0x93, 0xe3, 0x62, 0x34, 0x3c, 0x2c, 0x26, | ||
217 | 0xc7, 0xc5, 0x69, 0x39, 0x19, 0x1d, 0x36, 0xa2, 0xe2, 0x62, 0x24, 0x18, 0x3c, 0x7e, 0x7f, 0x7f, | ||
218 | 0x7f, 0xbf, 0x3f, 0x1f, 0x1f, 0x8f, 0xe7, 0x63, 0x27, 0x27, 0x47, 0x47, 0xcf, 0xcf, 0x0f, 0x08, | ||
219 | 0x10, 0x10, 0x10, 0x10, 0x20, 0x20, 0x20, 0x20, 0x40, 0x40, 0x40, 0x40, 0x80, 0x80, 0x80, 0x80, | ||
220 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
221 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | ||
222 | } | ||
223 | }; | ||
224 | |||
225 | static const char PROGMEM prep[][ANIM_SIZE] = { | ||
226 | { | ||
227 | //Prepare - 128x32 | ||
228 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xce, 0x9c, 0xf8, 0xfc, 0xfe, 0x80, 0xe0, 0x20, 0x00, | ||
229 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
230 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xc0, 0xc0, 0xe0, 0xe0, 0xf0, | ||
231 | 0xf0, 0xf8, 0xfc, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xe0, 0xc0, 0xc0, 0x80, 0x80, 0x80, 0x00, 0x00, | ||
232 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
233 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
234 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
235 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
236 | 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x38, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0x31, 0x00, 0x08, | ||
237 | 0x10, 0x10, 0x10, 0x10, 0x20, 0x20, 0x20, 0x20, 0x40, 0x40, 0x40, 0x40, 0x80, 0x80, 0xf0, 0xf8, | ||
238 | 0xdc, 0x36, 0x3e, 0xee, 0xfc, 0xe0, 0x9c, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xcf, 0xff, | ||
239 | 0xff, 0xbf, 0x7f, 0x7f, 0xbf, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, | ||
240 | 0xff, 0x7e, 0xbe, 0xbc, 0xbc, 0x7c, 0xfc, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, | ||
241 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
242 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
243 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
244 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, 0x0f, 0x0f, 0x0f, 0x01, 0x00, 0x00, 0x00, | ||
245 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0x30, 0x38, 0x2c, 0x44, 0xc4, 0xc4, 0x68, 0x78, | ||
246 | 0x59, 0x89, 0x91, 0x91, 0xd3, 0xf3, 0xa3, 0x23, 0x27, 0x27, 0xc7, 0xc7, 0x4f, 0x4f, 0x8f, 0x8f, | ||
247 | 0x9f, 0x9f, 0x1f, 0x1f, 0x3f, 0x3e, 0x3e, 0x3f, 0x7f, 0x7f, 0x7f, 0x7f, 0xfc, 0xfc, 0xff, 0x81, | ||
248 | 0xfa, 0xff, 0xe6, 0xe7, 0xfd, 0xff, 0xfc, 0xf3, 0xff, 0xff, 0xff, 0xfe, 0xf8, 0xe0, 0x00, 0x00, | ||
249 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
250 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
251 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
252 | 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0x60, 0x30, 0x10, 0x18, 0x08, 0x08, 0x08, 0x18, 0x10, 0x30, | ||
253 | 0x60, 0x40, 0xc0, 0x86, 0x87, 0x85, 0xc4, 0x49, 0x69, 0x3e, 0x0e, 0x13, 0x11, 0x13, 0x12, 0x3c, | ||
254 | 0x2c, 0x26, 0x27, 0x45, 0x68, 0x78, 0x58, 0x9d, 0x97, 0x93, 0xe3, 0x62, 0x34, 0x3c, 0x2c, 0x26, | ||
255 | 0xc7, 0xc5, 0x69, 0x39, 0x19, 0x1d, 0x36, 0xa2, 0xe2, 0x62, 0x34, 0x3c, 0x2c, 0x44, 0xc8, 0xc8, | ||
256 | 0xe9, 0xb9, 0x11, 0x11, 0x13, 0x93, 0xe3, 0x63, 0x27, 0x27, 0x47, 0x47, 0xcf, 0xcf, 0x0f, 0x08, | ||
257 | 0x10, 0x10, 0x10, 0x10, 0x20, 0x20, 0x20, 0x20, 0x40, 0x40, 0x40, 0x40, 0x80, 0x80, 0x80, 0x80, | ||
258 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
259 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | ||
260 | } | ||
261 | }; | ||
262 | |||
263 | static const char PROGMEM tap[TAP_FRAMES][ANIM_SIZE] = { | ||
264 | { | ||
265 | //Tap left - 128x32 | ||
266 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xce, 0x9c, 0xf8, 0xfc, 0xfe, 0x80, 0xe0, 0x20, 0x00, | ||
267 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
268 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xc0, 0xc0, 0xe0, 0xe0, 0xf0, | ||
269 | 0xf0, 0xf8, 0xfc, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xe0, 0xc0, 0xc0, 0x80, 0x80, 0x80, 0x00, 0x00, | ||
270 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
271 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
272 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
273 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
274 | 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x38, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0x31, 0x00, 0x08, | ||
275 | 0x10, 0x10, 0x10, 0x10, 0x20, 0x20, 0x20, 0x20, 0x40, 0x40, 0x40, 0x40, 0x80, 0x80, 0xf0, 0xf8, | ||
276 | 0xdc, 0x36, 0x3e, 0xee, 0xfc, 0xe0, 0x9c, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xcf, 0xff, | ||
277 | 0xff, 0xbf, 0x7f, 0x7f, 0xbf, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, | ||
278 | 0xff, 0xfe, 0xfe, 0xfc, 0xfc, 0xfc, 0xfc, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, | ||
279 | 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
280 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
281 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
282 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, 0x0f, 0x0f, 0x0f, 0x01, 0x00, 0x00, 0x00, | ||
283 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0x30, 0x38, 0x2c, 0x44, 0xc4, 0xc4, 0x68, 0x78, | ||
284 | 0x59, 0x89, 0x91, 0x91, 0xd3, 0xf3, 0xa3, 0x23, 0x27, 0x27, 0xc7, 0xc7, 0x4f, 0x4f, 0x8f, 0x8f, | ||
285 | 0x9f, 0x9f, 0x1f, 0x1f, 0x3f, 0x3e, 0x3e, 0x3f, 0x7f, 0x7f, 0x7f, 0x7f, 0xfc, 0xfc, 0xff, 0xff, | ||
286 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xf8, 0xe0, 0x00, 0x00, | ||
287 | 0x3f, 0x1f, 0x07, 0x83, 0xc0, 0xe0, 0xe0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
288 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
289 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
290 | 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0x60, 0x30, 0x10, 0x18, 0x08, 0x08, 0x08, 0x18, 0x10, 0x30, | ||
291 | 0x60, 0x40, 0xc0, 0x86, 0x87, 0x85, 0xc4, 0x49, 0x69, 0x3e, 0x0e, 0x13, 0x11, 0x13, 0x12, 0x3c, | ||
292 | 0x2c, 0x26, 0x27, 0x45, 0x68, 0x78, 0x58, 0x9d, 0x97, 0x93, 0xe3, 0x62, 0x34, 0x3c, 0x2c, 0x26, | ||
293 | 0xc7, 0xc5, 0x69, 0x39, 0x19, 0x1d, 0x36, 0xa2, 0xe2, 0x62, 0x24, 0x18, 0x3c, 0x7e, 0x7f, 0x7f, | ||
294 | 0x7f, 0xbf, 0x3f, 0x1f, 0x1f, 0x8f, 0xe7, 0x63, 0x27, 0x27, 0x47, 0x47, 0xcf, 0xcf, 0x0f, 0x08, | ||
295 | 0x10, 0x10, 0x11, 0x11, 0x21, 0x23, 0x23, 0x21, 0x40, 0x40, 0x40, 0x40, 0x80, 0x80, 0x80, 0x80, | ||
296 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
297 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | ||
298 | }, | ||
299 | { | ||
300 | //Tap right - 128x32 | ||
301 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xce, 0x9c, 0xf8, 0xfc, 0xfe, 0x80, 0xe0, 0x20, 0x00, | ||
302 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
303 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xc0, 0xc0, 0xe0, 0xe0, 0xf0, | ||
304 | 0xf0, 0xf8, 0xfc, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xe0, 0xc0, 0xc0, 0x80, 0x80, 0x80, 0x00, 0x00, | ||
305 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
306 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
307 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
308 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
309 | 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x38, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0x31, 0x00, 0x08, | ||
310 | 0x10, 0x10, 0x10, 0x10, 0xa0, 0xa0, 0x20, 0x20, 0x40, 0x46, 0x4f, 0x5f, 0x9f, 0x9c, 0x90, 0x80, | ||
311 | 0xc0, 0xe0, 0xf0, 0xf8, 0xf8, 0xfc, 0xfc, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xcf, 0xff, | ||
312 | 0xff, 0xbf, 0x7f, 0x7f, 0xbf, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, | ||
313 | 0xff, 0x7e, 0xbe, 0xbc, 0xbc, 0x7c, 0xfc, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, | ||
314 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
315 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
316 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
317 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, 0x0f, 0x0f, 0x0f, 0x01, 0x00, 0x00, 0x00, | ||
318 | 0x00, 0x00, 0x00, 0x07, 0x0f, 0x8f, 0xc7, 0xe3, 0x31, 0x38, 0x2c, 0x04, 0x64, 0xf8, 0xfe, 0xff, | ||
319 | 0xff, 0xff, 0xff, 0xff, 0x7f, 0xbf, 0x8f, 0x27, 0x27, 0x27, 0xc7, 0xc7, 0x4f, 0x4f, 0x8f, 0x8f, | ||
320 | 0x9f, 0x9f, 0x1f, 0x1f, 0x3f, 0x3e, 0x3e, 0x3f, 0x7f, 0x7f, 0x7f, 0x7f, 0xfc, 0xfc, 0xff, 0x81, | ||
321 | 0xfa, 0xff, 0xe6, 0xe7, 0xfd, 0xff, 0xfc, 0xf3, 0xff, 0xff, 0xff, 0xfe, 0xf8, 0xe0, 0x00, 0x00, | ||
322 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
323 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
324 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
325 | 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0x60, 0x30, 0x10, 0x18, 0x08, 0x08, 0x08, 0x18, 0x10, 0x30, | ||
326 | 0x60, 0x40, 0xc0, 0x86, 0x87, 0x85, 0xc4, 0x49, 0x69, 0x3e, 0x0e, 0x13, 0x11, 0x12, 0x12, 0x3d, | ||
327 | 0x2d, 0x25, 0x26, 0x44, 0x68, 0x78, 0x58, 0x9d, 0x97, 0x93, 0xe3, 0x62, 0x34, 0x3c, 0x2c, 0x26, | ||
328 | 0xc7, 0xc5, 0x69, 0x39, 0x19, 0x1d, 0x36, 0xa2, 0xe2, 0x62, 0x34, 0x3c, 0x2c, 0x44, 0xc8, 0xc8, | ||
329 | 0xe9, 0xb9, 0x11, 0x11, 0x13, 0x93, 0xe3, 0x63, 0x27, 0x27, 0x47, 0x47, 0xcf, 0xcf, 0x0f, 0x08, | ||
330 | 0x10, 0x10, 0x10, 0x10, 0x20, 0x20, 0x20, 0x20, 0x40, 0x40, 0x40, 0x40, 0x80, 0x80, 0x80, 0x80, | ||
331 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
332 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | ||
333 | }, | ||
334 | }; | ||
335 | |||
336 | // assumes 1 frame prep stage | ||
337 | void animation_phase(void) { | ||
338 | if (get_current_wpm() <= IDLE_SPEED) { | ||
339 | current_idle_frame = (current_idle_frame + 1) % IDLE_FRAMES; | ||
340 | oled_write_raw_P(idle[abs((IDLE_FRAMES - 1) - current_idle_frame)], ANIM_SIZE); | ||
341 | } | ||
342 | |||
343 | if (get_current_wpm() > IDLE_SPEED && get_current_wpm() < ANIM_WPM_LOWER) { | ||
344 | // oled_write_raw_P(prep[abs((PREP_FRAMES-1)-current_prep_frame)], ANIM_SIZE); // uncomment if IDLE_FRAMES >1 | ||
345 | oled_write_raw_P(prep[0], ANIM_SIZE); // remove if IDLE_FRAMES >1 | ||
346 | } | ||
347 | |||
348 | if (get_current_wpm() >= ANIM_WPM_LOWER) { | ||
349 | current_tap_frame = (current_tap_frame + 1) % TAP_FRAMES; | ||
350 | oled_write_raw_P(tap[abs((TAP_FRAMES - 1) - current_tap_frame)], ANIM_SIZE); | ||
351 | } | ||
352 | } | ||
353 | |||
354 | // variable animation duration. Don't want this value to get near zero as it'll bug out. | ||
355 | curr_anim_duration = MAX(ANIM_FRAME_DURATION_MIN, ANIM_FRAME_DURATION_MAX - ANIM_FRAME_RATIO * get_current_wpm()); | ||
356 | |||
357 | if (get_current_wpm() > ANIM_WPM_LOWER) { | ||
358 | oled_on(); // not essential but turns on animation OLED with any alpha keypress | ||
359 | |||
360 | if (timer_elapsed32(bongo_timer) > curr_anim_duration) { | ||
361 | bongo_timer = timer_read32(); | ||
362 | animation_phase(); | ||
363 | } | ||
364 | |||
365 | bongo_sleep = timer_read32(); | ||
366 | } else { | ||
367 | if (timer_elapsed32(bongo_sleep) > OLED_TIMEOUT) { | ||
368 | oled_off(); | ||
369 | } else { | ||
370 | if (timer_elapsed32(bongo_timer) > IDLE_FRAME_DURATION) { | ||
371 | bongo_timer = timer_read32(); | ||
372 | animation_phase(); | ||
373 | } | ||
374 | } | ||
375 | } | ||
376 | } | ||
diff --git a/keyboards/handwired/horrortroll/k552/lib/galaxy.c b/keyboards/handwired/horrortroll/k552/lib/galaxy.c new file mode 100644 index 000000000..5cc340dde --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/lib/galaxy.c | |||
@@ -0,0 +1,58 @@ | |||
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 | # define ANIM_SIZE 636 // number of bytes in array, minimize for adequate firmware size, max is 1024 | ||
18 | |||
19 | static void render_galaxy(void) { | ||
20 | static const char PROGMEM galaxy[][ANIM_SIZE] = { | ||
21 | { | ||
22 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x80, 0xc8, 0xe8, 0x49, 0x72, | ||
23 | 0x7e, 0x4b, 0x82, 0x05, 0xa2, 0x55, 0x0a, 0x11, 0x2a, 0x44, 0xaa, 0x11, 0xaa, 0x44, 0x2a, 0x10, | ||
24 | 0x20, 0x42, 0x02, 0x80, 0xc4, 0x92, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
25 | 0x02, 0x05, 0x02, 0x05, 0x03, 0x06, 0x81, 0xfe, 0x81, 0x1c, 0x1e, 0x08, 0x00, 0x00, 0x00, 0x80, | ||
26 | 0x00, 0x10, 0x65, 0xcd, 0x63, 0xce, 0x2b, 0x2b, 0x8e, 0x9c, 0x2c, 0x78, 0xf3, 0x58, 0xc0, 0xe8, | ||
27 | 0xe0, 0xf9, 0x88, 0x68, 0xa1, 0x00, 0x01, 0x03, 0x8f, 0x0f, 0x1f, 0x2f, 0xdf, 0x7f, 0x7e, 0xff, | ||
28 | 0x79, 0x2f, 0xff, 0xdf, 0x5f, 0xbf, 0xff, 0x7f, 0xff, 0x9e, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xf7, | ||
29 | 0xde, 0xfd, 0xfe, 0x50, 0xa8, 0x50, 0x02, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, | ||
30 | 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x42, 0xe4, 0xf0, 0xfe, 0xf0, 0xe1, 0x41, 0x47, 0x49, 0xab, | ||
31 | 0x14, 0x48, 0x22, 0x55, 0x0a, 0x05, 0x20, 0x55, 0x88, 0x54, 0xa2, 0x14, 0x08, 0x00, 0x48, 0x22, | ||
32 | 0x90, 0x20, 0x00, 0x40, 0xa8, 0x70, 0x86, 0x5d, 0x60, 0x04, 0x08, 0x00, 0x04, 0x00, 0x04, 0x04, | ||
33 | 0x04, 0x04, 0x84, 0x84, 0x0e, 0x1f, 0x3f, 0xff, 0x3f, 0x1f, 0x6e, 0xe4, 0xe4, 0xd4, 0xa4, 0xd4, | ||
34 | 0xa5, 0xd9, 0xad, 0xde, 0xfd, 0xf9, 0xfd, 0xf4, 0x08, 0xf0, 0x40, 0x40, 0x00, 0xc1, 0x01, 0x0b, | ||
35 | 0x9f, 0x4f, 0xbf, 0x7f, 0xff, 0xff, 0xfa, 0xc0, 0xea, 0x84, 0xaa, 0x84, 0x00, 0x05, 0x00, 0x01, | ||
36 | 0xc5, 0x7c, 0x2d, 0x57, 0x28, 0x53, 0x20, 0x11, 0x2b, 0x9d, 0x1e, 0x2f, 0x57, 0x2f, 0xdf, 0x3f, | ||
37 | 0xff, 0x7f, 0xff, 0x7f, 0xbf, 0x3f, 0x52, 0x04, 0x0a, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
38 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0f, 0x31, 0x60, 0x00, 0x00, 0x00, 0x00, | ||
39 | 0x01, 0x0a, 0x11, 0x2a, 0x44, 0xa8, 0x00, 0x80, 0x00, 0x01, 0x00, 0x04, 0x19, 0x58, 0xf6, 0xf5, | ||
40 | 0xf8, 0xd5, 0x58, 0xe1, 0x6e, 0xb4, 0x02, 0x80, 0x04, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
41 | 0x00, 0x03, 0x07, 0xa7, 0xa3, 0x00, 0x00, 0xaf, 0x80, 0x00, 0x04, 0x01, 0x03, 0x83, 0x73, 0x05, | ||
42 | 0xd3, 0xff, 0x7f, 0xbf, 0x7f, 0xbf, 0xdf, 0xff, 0xfb, 0xf5, 0xe9, 0xac, 0x97, 0x1e, 0xae, 0xf0, | ||
43 | 0x82, 0xc1, 0x42, 0xc5, 0x50, 0xef, 0x9b, 0x1f, 0x9f, 0x6f, 0x59, 0x80, 0x18, 0xe0, 0x60, 0xf1, | ||
44 | 0x56, 0x23, 0x61, 0x22, 0x11, 0x02, 0x01, 0x00, 0x00, 0x80, 0x80, 0x10, 0x08, 0x1a, 0xfd, 0x02, | ||
45 | 0xa9, 0x71, 0x3f, 0x16, 0x07, 0x02, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
46 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, | ||
47 | 0x00, 0x00, 0x00, 0x00, 0x05, 0x0a, 0x11, 0x0a, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, | ||
48 | 0xff, 0xff, 0xbf, 0xea, 0xed, 0x7a, 0x05, 0x02, 0x06, 0x00, 0x0c, 0x00, 0x09, 0x2e, 0x80, 0x30, | ||
49 | 0x02, 0x04, 0x82, 0x8a, 0x0d, 0xb8, 0x10, 0xf1, 0xe0, 0xe0, 0x80, 0xe0, 0x40, 0x00, 0x54, 0xa8, | ||
50 | 0x41, 0x82, 0x01, 0x00, 0x01, 0x00, 0x41, 0x88, 0x55, 0x23, 0x55, 0x8b, 0x57, 0xaf, 0xdf, 0xff, | ||
51 | 0xfe, 0xfe, 0xff, 0xfe, 0xfe, 0xfc, 0xbf, 0x4b, 0x8c, 0x07, 0x0f, 0x1f, 0x0c, 0xaa, 0x10, 0x00, | ||
52 | 0x00, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x04, 0x04, 0x01, 0x80, | ||
53 | 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x04, 0x0e, 0x04, 0x00 | ||
54 | } | ||
55 | }; | ||
56 | |||
57 | oled_write_raw_P(galaxy[0], ANIM_SIZE); | ||
58 | } \ No newline at end of file | ||
diff --git a/keyboards/handwired/horrortroll/k552/lib/glcdfont.c b/keyboards/handwired/horrortroll/k552/lib/glcdfont.c new file mode 100644 index 000000000..23bfd92d7 --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/lib/glcdfont.c | |||
@@ -0,0 +1,248 @@ | |||
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 | // This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0. | ||
18 | // See gfxfont.h for newer custom bitmap font info. | ||
19 | |||
20 | #include "progmem.h" | ||
21 | |||
22 | // Standard ASCII 5x7 font | ||
23 | const unsigned char font[] PROGMEM = { | ||
24 | 0x07, 0x08, 0x7F, 0x08, 0x07, 0x00, | ||
25 | 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, | ||
26 | 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, | ||
27 | 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, | ||
28 | 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, | ||
29 | 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, | ||
30 | 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, | ||
31 | 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, | ||
32 | 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, | ||
33 | 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, | ||
34 | 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, | ||
35 | 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, | ||
36 | 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, | ||
37 | 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, | ||
38 | 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, | ||
39 | 0x2A, 0x1C, 0x77, 0x1C, 0x2A, 0x00, | ||
40 | 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, | ||
41 | 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, | ||
42 | 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, | ||
43 | 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, | ||
44 | 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, | ||
45 | 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, | ||
46 | 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, | ||
47 | 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, | ||
48 | 0x08, 0x04, 0x3E, 0x04, 0x08, 0x00, | ||
49 | 0x08, 0x10, 0x3E, 0x10, 0x08, 0x00, | ||
50 | 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, | ||
51 | 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, | ||
52 | 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, | ||
53 | 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, | ||
54 | 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, | ||
55 | 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, | ||
56 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
57 | 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, | ||
58 | 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, | ||
59 | 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, | ||
60 | 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, | ||
61 | 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, | ||
62 | 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, | ||
63 | 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, | ||
64 | 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, | ||
65 | 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, | ||
66 | 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, | ||
67 | 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, | ||
68 | 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, | ||
69 | 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, | ||
70 | 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, | ||
71 | 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, | ||
72 | 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, | ||
73 | 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, | ||
74 | 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, | ||
75 | 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, | ||
76 | 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, | ||
77 | 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, | ||
78 | 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, | ||
79 | 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, | ||
80 | 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, | ||
81 | 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, | ||
82 | 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, | ||
83 | 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, | ||
84 | 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, | ||
85 | 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, | ||
86 | 0x41, 0x22, 0x14, 0x08, 0x00, 0x00, | ||
87 | 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, | ||
88 | 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, | ||
89 | 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, | ||
90 | 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, | ||
91 | 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, | ||
92 | 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, | ||
93 | 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, | ||
94 | 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, | ||
95 | 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, | ||
96 | 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, | ||
97 | 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, | ||
98 | 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, | ||
99 | 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, | ||
100 | 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, | ||
101 | 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, | ||
102 | 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, | ||
103 | 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, | ||
104 | 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, | ||
105 | 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, | ||
106 | 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, | ||
107 | 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, | ||
108 | 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, | ||
109 | 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, | ||
110 | 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, | ||
111 | 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, | ||
112 | 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, | ||
113 | 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, | ||
114 | 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, | ||
115 | 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, | ||
116 | 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, | ||
117 | 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, | ||
118 | 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, | ||
119 | 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, | ||
120 | 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, | ||
121 | 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, | ||
122 | 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, | ||
123 | 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, | ||
124 | 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, | ||
125 | 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, | ||
126 | 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, | ||
127 | 0x18, 0xA4, 0xA4, 0x9C, 0x78, 0x00, | ||
128 | 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, | ||
129 | 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, | ||
130 | 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, | ||
131 | 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, | ||
132 | 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, | ||
133 | 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, | ||
134 | 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, | ||
135 | 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, | ||
136 | 0xFC, 0x18, 0x24, 0x24, 0x18, 0x00, | ||
137 | 0x18, 0x24, 0x24, 0x18, 0xFC, 0x00, | ||
138 | 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, | ||
139 | 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, | ||
140 | 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, | ||
141 | 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, | ||
142 | 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, | ||
143 | 0x3C, 0x40, 0x38, 0x40, 0x3C, 0x00, | ||
144 | 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, | ||
145 | 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, | ||
146 | 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, | ||
147 | 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, | ||
148 | 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, | ||
149 | 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, | ||
150 | 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, | ||
151 | 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, | ||
152 | 0x10, 0x38, 0x10, 0x10, 0x1C, 0x00, | ||
153 | 0x0C, 0x7A, 0x41, 0x7A, 0x0C, 0x00, | ||
154 | 0x18, 0x2F, 0x41, 0x2F, 0x18, 0x00, | ||
155 | 0x22, 0x72, 0x22, 0x27, 0x22, 0x00, | ||
156 | 0x08, 0x1C, 0x08, 0x08, 0x08, 0x00, | ||
157 | 0x08, 0x08, 0x38, 0x20, 0x28, 0x28, | ||
158 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
159 | 0x00, 0x2A, 0x2A, 0x2A, 0x00, 0x00, | ||
160 | 0x4E, 0x46, 0x4A, 0x50, 0x2F, 0x00, | ||
161 | 0x3E, 0x45, 0x55, 0x51, 0x3E, 0x00, | ||
162 | 0x48, 0x50, 0x7E, 0x50, 0x48, 0x00, | ||
163 | 0x3E, 0x49, 0x71, 0x49, 0x3E, 0x00, | ||
164 | 0x10, 0x22, 0x4F, 0x20, 0x10, 0x00, | ||
165 | 0x0E, 0x06, 0x0A, 0x10, 0x20, 0x00, | ||
166 | 0x20, 0x10, 0x0A, 0x06, 0x0E, 0x00, | ||
167 | 0x08, 0x08, 0x08, 0x1C, 0x08, 0x00, | ||
168 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
169 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
170 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
171 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
172 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
173 | 0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, | ||
174 | 0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, | ||
175 | 0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, | ||
176 | 0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, | ||
177 | 0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, | ||
178 | 0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, | ||
179 | 0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, | ||
180 | 0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, | ||
181 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
182 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
183 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
184 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
185 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
186 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
187 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
188 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
189 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
190 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
191 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
192 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
193 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
194 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
195 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
196 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
197 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
198 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
199 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
200 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
201 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
202 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
203 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
204 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
205 | 0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, | ||
206 | 0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, | ||
207 | 0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, | ||
208 | 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, | ||
209 | 0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, | ||
210 | 0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, | ||
211 | 0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, | ||
212 | 0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, | ||
213 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
214 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
215 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
216 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
217 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
218 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
219 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
220 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
221 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
222 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
223 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
224 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
225 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
226 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
227 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
228 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
229 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
230 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
231 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
232 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
233 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
234 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
235 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
236 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
237 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
238 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
239 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
240 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
241 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
242 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
243 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
244 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
245 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
246 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
247 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
248 | }; | ||
diff --git a/keyboards/handwired/horrortroll/k552/lib/logo.c b/keyboards/handwired/horrortroll/k552/lib/logo.c new file mode 100644 index 000000000..2e05555af --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/lib/logo.c | |||
@@ -0,0 +1,58 @@ | |||
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 | # define ANIM_SIZE 636 // number of bytes in array, minimize for adequate firmware size, max is 1024 | ||
18 | |||
19 | static void render_logo(void) { | ||
20 | static const char PROGMEM redragon[][ANIM_SIZE] = { | ||
21 | { | ||
22 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xc0, 0xc0, 0x80, | ||
23 | 0x80, 0xc0, 0xe0, 0x80, 0xc0, 0xe0, 0x30, 0x8c, 0x83, 0xc0, 0x60, 0x18, 0x04, 0x00, 0x01, 0x03, | ||
24 | 0x0e, 0x3e, 0xfe, 0xfc, 0xfc, 0xf8, 0xf0, 0xf0, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
25 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
26 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
27 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
28 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
29 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
30 | 0x00, 0x00, 0x10, 0xf0, 0xf0, 0xf0, 0xf8, 0xf8, 0xfc, 0xf6, 0xf3, 0x31, 0xfc, 0xff, 0xff, 0x3f, | ||
31 | 0x9f, 0x5f, 0x5f, 0x5f, 0xcf, 0xcf, 0xcf, 0xcb, 0xc9, 0x8c, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, | ||
32 | 0x00, 0x00, 0x01, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xf8, 0xe0, 0x80, | ||
33 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0xf0, 0xe0, 0x60, 0x60, 0xc0, 0x80, 0x00, 0x00, | ||
34 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
35 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
36 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
37 | 0x00, 0x00, 0x40, 0xc0, 0xc0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x10, 0xf0, 0xf0, 0xf0, 0x00, 0x00, | ||
38 | 0x00, 0x00, 0x00, 0x00, 0x03, 0x0f, 0x00, 0x01, 0x00, 0x00, 0x80, 0x00, 0x03, 0xcf, 0xff, 0x0c, | ||
39 | 0x02, 0x00, 0x80, 0x80, 0xc0, 0xe0, 0xf9, 0xff, 0xff, 0xff, 0xff, 0x1c, 0x00, 0x00, 0x00, 0x00, | ||
40 | 0x03, 0xfe, 0xf8, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x3f, 0x7f, 0xff, 0xff, | ||
41 | 0xfc, 0x80, 0x00, 0x00, 0x00, 0x00, 0x10, 0x20, 0xff, 0xff, 0x20, 0x60, 0xd9, 0x9f, 0x0f, 0x00, | ||
42 | 0x01, 0xff, 0xff, 0x23, 0x21, 0x21, 0x73, 0x00, 0xff, 0xff, 0x03, 0x22, 0x1e, 0xfc, 0xf8, 0x41, | ||
43 | 0xff, 0xff, 0xe3, 0xb2, 0x3e, 0x1c, 0x00, 0xe0, 0xfe, 0x7f, 0x43, 0x4f, 0x7d, 0xf0, 0x80, 0x70, | ||
44 | 0xfc, 0x9e, 0x22, 0x03, 0x43, 0x43, 0xc6, 0xcc, 0x80, 0x78, 0xfc, 0x06, 0x23, 0x22, 0x06, 0x9c, | ||
45 | 0xf8, 0x40, 0x20, 0xff, 0xff, 0xff, 0x07, 0x1f, 0x7c, 0xf8, 0xe0, 0xff, 0xff, 0xff, 0x00, 0x00, | ||
46 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xf1, 0xf9, 0xfd, 0xff, 0xfe, | ||
47 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x97, 0x87, 0xc1, 0xe3, 0xf0, 0x78, 0x7e, 0x7f, 0x38, | ||
48 | 0x3e, 0x3f, 0x9f, 0x6f, 0x3f, 0x1f, 0x07, 0x00, 0x03, 0x7f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x03, | ||
49 | 0x0f, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0e, 0x0f, 0x0f, 0x08, 0x00, 0x01, 0x03, 0x0f, 0x1e, | ||
50 | 0x3c, 0x77, 0x67, 0x44, 0x04, 0x04, 0x04, 0x02, 0x07, 0x07, 0x06, 0x06, 0x03, 0x03, 0x01, 0x04, | ||
51 | 0x07, 0x07, 0x00, 0x03, 0x07, 0x04, 0x06, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x06, | ||
52 | 0x05, 0x03, 0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x00, 0x00, 0x03, 0x07, 0x06, 0x06, 0x06, 0x07, | ||
53 | 0x01, 0x00, 0x04, 0x07, 0x07, 0x07, 0x04, 0x00, 0x00, 0x01, 0x03, 0x0f, 0x3f, 0xff, 0x00, 0x00 | ||
54 | } | ||
55 | }; | ||
56 | |||
57 | oled_write_raw_P(redragon[0], ANIM_SIZE); | ||
58 | } | ||
diff --git a/keyboards/handwired/horrortroll/k552/lib/wave.c b/keyboards/handwired/horrortroll/k552/lib/wave.c new file mode 100644 index 000000000..79b4e0ced --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/lib/wave.c | |||
@@ -0,0 +1,133 @@ | |||
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 | extern const unsigned char font[] PROGMEM; | ||
18 | |||
19 | #define ROW_1 OLED_DISPLAY_WIDTH | ||
20 | #define ROW_2 (OLED_DISPLAY_WIDTH * 2) | ||
21 | |||
22 | static uint32_t wave_sleep = 0; | ||
23 | |||
24 | #define FRAME_TIMEOUT (1000/24) | ||
25 | |||
26 | static uint16_t wave_timer = 0; | ||
27 | |||
28 | static uint8_t next_bar_val = 0; | ||
29 | static uint8_t next_log_byte[OLED_FONT_WIDTH] = {0}; | ||
30 | static uint8_t line1[OLED_DISPLAY_WIDTH] = {0}; | ||
31 | static uint8_t line2[OLED_DISPLAY_WIDTH] = {0}; | ||
32 | |||
33 | static const uint8_t PROGMEM bar_lut[8] = {0, 16, 24, 56, 60, 124, 126, 255}; | ||
34 | |||
35 | #define BAR_KEY_WEIGHT 128 | ||
36 | #define BAR_KEY_DECAY_MAX 18 | ||
37 | |||
38 | static uint8_t bar_key_decay = BAR_KEY_DECAY_MAX; | ||
39 | |||
40 | // clang-format off | ||
41 | static const char PROGMEM code_to_name[0xFF] = { | ||
42 | // 0 1 2 3 4 5 6 7 8 9 A B C D E F | ||
43 | ' ', ' ', ' ', ' ', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', // 0x | ||
44 | 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', // 1x | ||
45 | '3', '4', '5', '6', '7', '8', '9', '0', 128, 136, 132, 131, 22, '-', '=', '[', // 2x | ||
46 | ']','\\', '#', ';','\'', '`', ',', '.', '/', 130, 7, 7, 7, 7, 7, 7, // 3x | ||
47 | 7, 7, 7, 7, 7, 7, 137, 138, 139, 140, 141, 30, 143, 142, 31, 26, // 4x | ||
48 | 27, 25, 24, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 5x | ||
49 | ' ', ' ', ' ', ' ', ' ', 135, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 6x | ||
50 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 7x | ||
51 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 8x | ||
52 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 9x | ||
53 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Ax | ||
54 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Bx | ||
55 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Cx | ||
56 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Dx | ||
57 | 15, 129, 133, 4, 15, 129, 133, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Ex | ||
58 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' // Fx | ||
59 | }; | ||
60 | // clang-format on | ||
61 | |||
62 | void add_keylog(uint16_t keycode) { | ||
63 | if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || | ||
64 | (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX) || | ||
65 | (keycode >= QK_MODS && keycode <= QK_MODS_MAX)) { | ||
66 | keycode = keycode & 0xFF; | ||
67 | } else if (keycode > 0xFF) { | ||
68 | keycode = 0; | ||
69 | } | ||
70 | |||
71 | if (keycode < (sizeof(code_to_name) / sizeof(char))) { | ||
72 | char log_char = pgm_read_byte(&code_to_name[keycode]); | ||
73 | |||
74 | for (uint8_t j = 0; j < OLED_FONT_WIDTH; j++) { | ||
75 | const uint8_t glyph_line = pgm_read_byte(&font[log_char * OLED_FONT_WIDTH + j]); | ||
76 | next_log_byte[j] = glyph_line; | ||
77 | } | ||
78 | } | ||
79 | } | ||
80 | |||
81 | bool process_record_user_oled(uint16_t keycode, keyrecord_t *record) { | ||
82 | if (record->event.pressed) { | ||
83 | wave_sleep = timer_read32(); | ||
84 | add_keylog(keycode); | ||
85 | |||
86 | uint8_t t = next_bar_val + BAR_KEY_WEIGHT; | ||
87 | |||
88 | if (t < next_bar_val) { | ||
89 | next_bar_val = 255; | ||
90 | } else { | ||
91 | next_bar_val = t; | ||
92 | } | ||
93 | |||
94 | bar_key_decay = BAR_KEY_DECAY_MAX; | ||
95 | } | ||
96 | |||
97 | return true; | ||
98 | } | ||
99 | |||
100 | void render_layer_name(void) { | ||
101 | oled_write_P(PSTR("LAYER: WAVE"), false); | ||
102 | } | ||
103 | |||
104 | void render_frame(void) { | ||
105 | // rotate line 1, and stick in the next byte of the next char, | ||
106 | // then rotate the next char buffer | ||
107 | memmove(line1+1, line1, OLED_DISPLAY_WIDTH - 1); | ||
108 | line1[0] = next_log_byte[OLED_FONT_WIDTH - 1]; | ||
109 | memmove(next_log_byte+1, next_log_byte, OLED_FONT_WIDTH - 1); | ||
110 | next_log_byte[0] = 0; | ||
111 | |||
112 | // rotate line 2, sticking in the next display value | ||
113 | uint8_t disp_val = pgm_read_byte(&bar_lut[next_bar_val / 32]); | ||
114 | memmove(line2+1, line2, OLED_DISPLAY_WIDTH - 1); | ||
115 | line2[0] = disp_val; | ||
116 | |||
117 | // draw both bars | ||
118 | for (uint8_t i = 0; i < OLED_DISPLAY_WIDTH; i++) { | ||
119 | oled_write_raw_byte(line1[i], ROW_1 + i); | ||
120 | oled_write_raw_byte(line2[i], ROW_2 + i); | ||
121 | } | ||
122 | |||
123 | // decay the next bar value | ||
124 | if (next_bar_val > bar_key_decay) { | ||
125 | next_bar_val -= bar_key_decay; | ||
126 | } else { | ||
127 | next_bar_val = 0; | ||
128 | } | ||
129 | |||
130 | if (bar_key_decay > 1) { | ||
131 | bar_key_decay -= 1; | ||
132 | } | ||
133 | } | ||
diff --git a/keyboards/handwired/horrortroll/k552/mcuconf.h b/keyboards/handwired/horrortroll/k552/mcuconf.h new file mode 100644 index 000000000..c2c0e9a2f --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/mcuconf.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* Copyright 2020 QMK | ||
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 | /* | ||
18 | * This file was auto-generated by: | ||
19 | * `qmk chibios-confmigrate -i keyboards/wolfmarkclub/wm1/mcuconf.h -r platforms/chibios/STM32_F103_STM32DUINO/configs/mcuconf.h` | ||
20 | */ | ||
21 | |||
22 | #pragma once | ||
23 | |||
24 | #include_next <mcuconf.h> | ||
25 | |||
26 | #undef STM32_I2C_USE_I2C2 | ||
27 | #define STM32_I2C_USE_I2C2 TRUE | ||
diff --git a/keyboards/handwired/horrortroll/k552/readme.md b/keyboards/handwired/horrortroll/k552/readme.md new file mode 100644 index 000000000..f1b30afae --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/readme.md | |||
@@ -0,0 +1,22 @@ | |||
1 | # Redragon K552 Kumara | ||
2 | |||
3 |  | ||
4 | |||
5 | A handwired K552 Kumara. Built using STM32F103RCT6 Mini | ||
6 | |||
7 | * Keyboard Maintainer: [HorrorTroll](https://github.com/HorrorTroll) | ||
8 | * Hardware Supported: Redragon K552 Kumara and STM32F103RCT6 Mini | ||
9 | |||
10 | Make example for this keyboard (after setting up your build environment): | ||
11 | |||
12 | make handwired/horrortroll/k552:default | ||
13 | |||
14 | See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). | ||
15 | |||
16 | ## Bootloader | ||
17 | |||
18 | Enter the bootloader in 3 ways: | ||
19 | |||
20 | * **Bootmagic reset**: Hold down the key at (4,6) in the matrix (B key) and plug in the keyboard | ||
21 | * **Physical reset button**: Briefly press the button on the back of the PCB | ||
22 | * **Keycode in layout**: Press the key mapped to `RESET` if it is available | ||
diff --git a/keyboards/handwired/horrortroll/k552/rules.mk b/keyboards/handwired/horrortroll/k552/rules.mk new file mode 100644 index 000000000..5df510cd4 --- /dev/null +++ b/keyboards/handwired/horrortroll/k552/rules.mk | |||
@@ -0,0 +1,33 @@ | |||
1 | # MCU name | ||
2 | MCU = STM32F103 | ||
3 | |||
4 | MCU_LDSCRIPT = k552_f103 | ||
5 | BOARD = k552 | ||
6 | |||
7 | # Bootloader selection | ||
8 | BOOTLOADER = stm32duino | ||
9 | |||
10 | # Build Options | ||
11 | # change yes to no to disable | ||
12 | # | ||
13 | BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite | ||
14 | MOUSEKEY_ENABLE = no # Mouse keys | ||
15 | EXTRAKEY_ENABLE = yes # Audio control and System control | ||
16 | CONSOLE_ENABLE = no # Console for debug | ||
17 | COMMAND_ENABLE = no # Commands for debug and configuration | ||
18 | NKRO_ENABLE = yes # Enable N-Key Rollover | ||
19 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
20 | RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow | ||
21 | AUDIO_ENABLE = no # Audio output | ||
22 | NO_USB_STARTUP_CHECK = yes | ||
23 | |||
24 | # RGB Matrix enabled | ||
25 | RGB_MATRIX_ENABLE = yes | ||
26 | RGB_MATRIX_DRIVER = WS2812 | ||
27 | |||
28 | # OLED enabled | ||
29 | OLED_ENABLE = yes | ||
30 | OLED_DRIVER = SSD1306 | ||
31 | WPM_ENABLE = yes | ||
32 | |||
33 | LAYOUTS = tkl_ansi | ||