aboutsummaryrefslogtreecommitdiff
path: root/users/drashna/drashna.c
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2020-03-31 16:26:43 -0700
committerGitHub <noreply@github.com>2020-03-31 16:26:43 -0700
commitc67e30459390982f4f1b47f46c62322f1fe9ba87 (patch)
treed3504649cb692e58823bc7589d1a032256d9b0c1 /users/drashna/drashna.c
parent8c80475fcc568e04f637ae973086b65a31b5254d (diff)
downloadqmk_firmware-c67e30459390982f4f1b47f46c62322f1fe9ba87.tar.gz
qmk_firmware-c67e30459390982f4f1b47f46c62322f1fe9ba87.zip
[Keymap] Drashna's Cleanup and RGB Divide (#8506)
* Enable External EEPROM on Planck Rev6 * Update KC_MAKE macro to use qmk cli util * Disable additional gradients for rgb matrix * Update analog code for newer methods * Update ergodox layout * Disable Grave Escape * Cleanup OLED code a bit * Remove old unicode code * Seperate RGB Matrix code from RGB Light code in userspace * Massive overhaul an generalization of personal OLED code Now lets hope I NEVER get a keyboard using a 128x32 in a normal orientation. * Super tiny cleanup * Enable Diablo layer on kyria * clang format pass * Additional OLED cleanup
Diffstat (limited to 'users/drashna/drashna.c')
-rw-r--r--users/drashna/drashna.c35
1 files changed, 12 insertions, 23 deletions
diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c
index 1a4ee9b41..ba19d4803 100644
--- a/users/drashna/drashna.c
+++ b/users/drashna/drashna.c
@@ -18,12 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
18#include "drashna.h" 18#include "drashna.h"
19 19
20userspace_config_t userspace_config; 20userspace_config_t userspace_config;
21#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE))
22# define DRASHNA_UNICODE_MODE UC_WIN
23#else
24// set to 2 for UC_WIN, set to 4 for UC_WINC
25# define DRASHNA_UNICODE_MODE 2
26#endif
27 21
28bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed) { 22bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed) {
29 static uint16_t this_timer; 23 static uint16_t this_timer;
@@ -93,19 +87,17 @@ void matrix_init_user(void) {
93 DDRB &= ~(1 << 0); 87 DDRB &= ~(1 << 0);
94 PORTB &= ~(1 << 0); 88 PORTB &= ~(1 << 0);
95#endif 89#endif
96
97#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE))
98 set_unicode_input_mode(DRASHNA_UNICODE_MODE);
99 get_unicode_input_mode();
100#endif // UNICODE_ENABLE
101 matrix_init_keymap(); 90 matrix_init_keymap();
102} 91}
103 92
104__attribute__((weak)) void keyboard_post_init_keymap(void) {} 93__attribute__((weak)) void keyboard_post_init_keymap(void) {}
105 94
106void keyboard_post_init_user(void) { 95void keyboard_post_init_user(void) {
107#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) 96#if defined(RGBLIGHT_ENABLE)
108 keyboard_post_init_rgb(); 97 keyboard_post_init_rgb_light();
98#endif
99#if defined(RGB_MATRIX_ENABLE)
100 keyboard_post_init_rgb_matrix();
109#endif 101#endif
110 keyboard_post_init_keymap(); 102 keyboard_post_init_keymap();
111} 103}
@@ -155,9 +147,12 @@ void matrix_scan_user(void) {
155 run_diablo_macro_check(); 147 run_diablo_macro_check();
156#endif // TAP_DANCE_ENABLE 148#endif // TAP_DANCE_ENABLE
157 149
158#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) 150#if defined(RGBLIGHT_ENABLE)
159 matrix_scan_rgb(); 151 matrix_scan_rgb_light();
160#endif // RGBLIGHT_ENABLE 152#endif // RGBLIGHT_ENABLE
153#if defined(RGB_MATRIX_ENABLE)
154 matrix_scan_rgb_matrix();
155#endif
161 156
162 matrix_scan_keymap(); 157 matrix_scan_keymap();
163} 158}
@@ -168,8 +163,8 @@ __attribute__((weak)) layer_state_t layer_state_set_keymap(layer_state_t state)
168// Then runs keymap's layer change check 163// Then runs keymap's layer change check
169layer_state_t layer_state_set_user(layer_state_t state) { 164layer_state_t layer_state_set_user(layer_state_t state) {
170 state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); 165 state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST);
171#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) 166#if defined(RGBLIGHT_ENABLE)
172 state = layer_state_set_rgb(state); 167 state = layer_state_set_rgb_light(state);
173#endif // RGBLIGHT_ENABLE 168#endif // RGBLIGHT_ENABLE
174 return layer_state_set_keymap(state); 169 return layer_state_set_keymap(state);
175} 170}
@@ -200,12 +195,6 @@ void eeconfig_init_user(void) {
200 userspace_config.raw = 0; 195 userspace_config.raw = 0;
201 userspace_config.rgb_layer_change = true; 196 userspace_config.rgb_layer_change = true;
202 eeconfig_update_user(userspace_config.raw); 197 eeconfig_update_user(userspace_config.raw);
203#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE))
204 set_unicode_input_mode(DRASHNA_UNICODE_MODE);
205 get_unicode_input_mode();
206#else
207 eeprom_update_byte(EECONFIG_UNICODEMODE, DRASHNA_UNICODE_MODE);
208#endif
209 eeconfig_init_keymap(); 198 eeconfig_init_keymap();
210 keyboard_init(); 199 keyboard_init();
211} 200}