diff options
author | Drashna Jaelre <drashna@live.com> | 2019-03-15 08:57:44 -0700 |
---|---|---|
committer | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2019-03-15 08:57:44 -0700 |
commit | 493fbb3dc1423e0d42e57a6dc7ba38b880b37eb5 (patch) | |
tree | d351bb45b24f55eb355b5724f97b0942214fd781 /layouts/community/ortho_4x12/drashna | |
parent | e0a03bfa6c148da2936b27a2285f1928c5574ac0 (diff) | |
download | qmk_firmware-493fbb3dc1423e0d42e57a6dc7ba38b880b37eb5.tar.gz qmk_firmware-493fbb3dc1423e0d42e57a6dc7ba38b880b37eb5.zip |
[Keymap] Update to drashna keymaps: Conform to QMK Standards Edition (#5377)
* Use correct functions for dip switch code
* Some planck cleanup
* Hopefully fix RGB Sleeping with RGB Matrix
* Add rgbmatrix extern
* Add numpad 5x6 layout
* RGB Tweaks
* Add RGB startup animation
* Minor RGB Fixes
* Turn off RBG on planck
* Enable separate storage of EEPROM
* Update Macro pad
* Add BJohnson Keymap and minor darshna tweaks
* Clean up rgb and other code for new numpad
* Remove clicky hachy thing
* Update my code to use built in MOD_MASK defines
* Fix up modifier calls
* Tweak to KC_MAKE
* Tweak to KC_MAKE
* Add Semi-colon to numpad
* Preprocess out rgb matrix stuff if not enabled
* Formatting of KC_MAKE
* Add stuff for matrix and light rgb coexistance
* Fix bad spelling
* Change where layer indication shows based on rgblight status
* Force set mods in KC_MAKE
* Optimize CRKBD
Diffstat (limited to 'layouts/community/ortho_4x12/drashna')
-rw-r--r-- | layouts/community/ortho_4x12/drashna/config.h | 10 | ||||
-rw-r--r-- | layouts/community/ortho_4x12/drashna/keymap.c | 39 | ||||
-rw-r--r-- | layouts/community/ortho_4x12/drashna/rules.mk | 2 |
3 files changed, 30 insertions, 21 deletions
diff --git a/layouts/community/ortho_4x12/drashna/config.h b/layouts/community/ortho_4x12/drashna/config.h index 55862aec3..f648d1127 100644 --- a/layouts/community/ortho_4x12/drashna/config.h +++ b/layouts/community/ortho_4x12/drashna/config.h | |||
@@ -2,9 +2,9 @@ | |||
2 | 2 | ||
3 | 3 | ||
4 | #if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) | 4 | #if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) |
5 | #define RGB_DI_PIN D3 | 5 | #define RGB_DI_PIN B3 |
6 | #define RGBLED_NUM 16 // Number of LEDs | 6 | #define RGBLED_NUM 13 // Number of LEDs |
7 | 7 | #define RGBLIGHT_ANIMATIONS | |
8 | #define RGBLIGHT_HUE_STEP 12 | 8 | #define RGBLIGHT_HUE_STEP 12 |
9 | #define RGBLIGHT_SAT_STEP 12 | 9 | #define RGBLIGHT_SAT_STEP 12 |
10 | #define RGBLIGHT_VAL_STEP 12 | 10 | #define RGBLIGHT_VAL_STEP 12 |
@@ -17,10 +17,10 @@ | |||
17 | #define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) | 17 | #define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) |
18 | // #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened) | 18 | // #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened) |
19 | // #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects | 19 | // #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects |
20 | // #define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended | 20 | #define RGB_DISABLE_WHEN_USB_SUSPENDED true// turn off effects when suspended |
21 | // #define RGB_MATRIX_SKIP_FRAMES 1 // number of frames to skip when displaying animations (0 is full effect) if not defined defaults to 1 | 21 | // #define RGB_MATRIX_SKIP_FRAMES 1 // number of frames to skip when displaying animations (0 is full effect) if not defined defaults to 1 |
22 | // #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 | 22 | // #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 |
23 | // #define EECONFIG_RGB_MATRIX (uint32_t *)16 | 23 | #define EECONFIG_RGB_MATRIX (uint32_t *)15 |
24 | #endif | 24 | #endif |
25 | 25 | ||
26 | #if defined(KEYBOARD_lets_split_rev2) | 26 | #if defined(KEYBOARD_lets_split_rev2) |
diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c index f5ead81da..28da1b204 100644 --- a/layouts/community/ortho_4x12/drashna/keymap.c +++ b/layouts/community/ortho_4x12/drashna/keymap.c | |||
@@ -19,7 +19,12 @@ | |||
19 | 19 | ||
20 | #ifdef RGB_MATRIX_ENABLE | 20 | #ifdef RGB_MATRIX_ENABLE |
21 | extern bool g_suspend_state; | 21 | extern bool g_suspend_state; |
22 | extern rgb_config_t rgb_matrix_config; | ||
22 | #endif | 23 | #endif |
24 | #ifdef RGBLIGHT_ENABLE | ||
25 | extern rgblight_config_t rgblight_config; | ||
26 | #endif | ||
27 | |||
23 | 28 | ||
24 | #ifdef BACKLIGHT_ENABLE | 29 | #ifdef BACKLIGHT_ENABLE |
25 | enum planck_keycodes { | 30 | enum planck_keycodes { |
@@ -162,13 +167,13 @@ bool music_mask_user(uint16_t keycode) { | |||
162 | 167 | ||
163 | #ifdef RGB_MATRIX_ENABLE | 168 | #ifdef RGB_MATRIX_ENABLE |
164 | 169 | ||
165 | void suspend_power_down_keymap(void) | 170 | void suspend_power_down_keymap(void) { |
166 | { | ||
167 | rgb_matrix_set_suspend_state(true); | 171 | rgb_matrix_set_suspend_state(true); |
172 | rgb_matrix_config.enable = false; | ||
168 | } | 173 | } |
169 | 174 | ||
170 | void suspend_wakeup_init_keymap(void) | 175 | void suspend_wakeup_init_keymap(void) { |
171 | { | 176 | rgb_matrix_config.enable = true; |
172 | rgb_matrix_set_suspend_state(false); | 177 | rgb_matrix_set_suspend_state(false); |
173 | } | 178 | } |
174 | 179 | ||
@@ -188,7 +193,14 @@ void rgb_matrix_indicators_user(void) { | |||
188 | uint8_t this_mod = get_mods(); | 193 | uint8_t this_mod = get_mods(); |
189 | uint8_t this_led = host_keyboard_leds(); | 194 | uint8_t this_led = host_keyboard_leds(); |
190 | uint8_t this_osm = get_oneshot_mods(); | 195 | uint8_t this_osm = get_oneshot_mods(); |
191 | if (!g_suspend_state) { | 196 | |
197 | if (!g_suspend_state && userspace_config.rgb_layer_change && | ||
198 | #if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE) | ||
199 | (!rgblight_config.enable && rgb_matrix_config.enable) | ||
200 | #else | ||
201 | rgb_matrix_config.enable | ||
202 | #endif | ||
203 | ) { | ||
192 | switch (biton32(layer_state)) { | 204 | switch (biton32(layer_state)) { |
193 | case _RAISE: | 205 | case _RAISE: |
194 | rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, false); break; | 206 | rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, false); break; |
@@ -228,27 +240,26 @@ void rgb_matrix_indicators_user(void) { | |||
228 | case _WORKMAN: | 240 | case _WORKMAN: |
229 | rgb_matrix_set_color(42, 0xD9, 0xA5, 0x21); break; | 241 | rgb_matrix_set_color(42, 0xD9, 0xA5, 0x21); break; |
230 | } | 242 | } |
231 | 243 | if ( (this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1<<USB_LED_CAPS_LOCK)) { | |
232 | if (this_mod & MODS_SHIFT_MASK || this_led & (1<<USB_LED_CAPS_LOCK) || this_osm & MODS_SHIFT_MASK) { | ||
233 | rgb_matrix_set_color(24, 0x00, 0xFF, 0x00); | 244 | rgb_matrix_set_color(24, 0x00, 0xFF, 0x00); |
234 | rgb_matrix_set_color(36, 0x00, 0xFF, 0x00); | 245 | rgb_matrix_set_color(36, 0x00, 0xFF, 0x00); |
235 | } | 246 | } |
236 | if (this_mod & MODS_CTRL_MASK || this_osm & MODS_CTRL_MASK) { | 247 | if ( (this_mod | this_osm) & MOD_MASK_CTRL) { |
237 | rgb_matrix_set_color(25, 0xFF, 0x00, 0x00); | 248 | rgb_matrix_set_color(25, 0xFF, 0x00, 0x00); |
238 | rgb_matrix_set_color(34, 0xFF, 0x00, 0x00); | 249 | rgb_matrix_set_color(34, 0xFF, 0x00, 0x00); |
239 | rgb_matrix_set_color(37, 0xFF, 0x00, 0x00); | 250 | rgb_matrix_set_color(37, 0xFF, 0x00, 0x00); |
240 | 251 | ||
241 | } | 252 | } |
242 | if (this_mod & MODS_GUI_MASK || this_osm & MODS_GUI_MASK) { | 253 | if ( (this_mod | this_osm) & MOD_MASK_GUI) { |
243 | rgb_matrix_set_color(39, 0xFF, 0xD9, 0x00); | 254 | rgb_matrix_set_color(39, 0xFF, 0xD9, 0x00); |
244 | } | 255 | } |
245 | if (this_mod & MODS_ALT_MASK || this_osm & MODS_ALT_MASK) { | 256 | if ( (this_mod | this_osm) & MOD_MASK_ALT) { |
246 | rgb_matrix_set_color(38, 0x00, 0x00, 0xFF); | 257 | rgb_matrix_set_color(38, 0x00, 0x00, 0xFF); |
247 | } | 258 | } |
248 | } | 259 | } |
249 | 260 | ||
250 | void matrix_init_keymap(void) { | 261 | void matrix_init_keymap(void) { |
251 | rgblight_mode(RGB_MATRIX_MULTISPLASH); | 262 | // rgblight_mode(RGB_MATRIX_MULTISPLASH); |
252 | } | 263 | } |
253 | #else //RGB_MATRIX_INIT | 264 | #else //RGB_MATRIX_INIT |
254 | 265 | ||
@@ -290,15 +301,13 @@ void encoder_update(bool clockwise) { | |||
290 | #endif // ENCODER_ENABLE | 301 | #endif // ENCODER_ENABLE |
291 | 302 | ||
292 | #ifdef KEYBOARD_planck_rev6 | 303 | #ifdef KEYBOARD_planck_rev6 |
293 | extern audio_config_t audio_config; | ||
294 | |||
295 | void dip_update(uint8_t index, bool active) { | 304 | void dip_update(uint8_t index, bool active) { |
296 | switch (index) { | 305 | switch (index) { |
297 | case 0: | 306 | case 0: |
298 | audio_config.enable = active; | 307 | if(active) { audio_on(); } else { audio_off(); } |
299 | break; | 308 | break; |
300 | case 1: | 309 | case 1: |
301 | audio_config.clicky_enable = active; | 310 | if(active) { clicky_on(); } else { clicky_off(); } |
302 | break; | 311 | break; |
303 | case 2: | 312 | case 2: |
304 | keymap_config.swap_lalt_lgui = keymap_config.swap_ralt_rgui = active; | 313 | keymap_config.swap_lalt_lgui = keymap_config.swap_ralt_rgui = active; |
diff --git a/layouts/community/ortho_4x12/drashna/rules.mk b/layouts/community/ortho_4x12/drashna/rules.mk index a5429b8ff..f88043267 100644 --- a/layouts/community/ortho_4x12/drashna/rules.mk +++ b/layouts/community/ortho_4x12/drashna/rules.mk | |||
@@ -12,7 +12,7 @@ ifeq (,$(findstring planck/rev6,$(KEYBOARD))) # Make sure it's NOT the Planck Re | |||
12 | endif | 12 | endif |
13 | ifneq (,$(findstring planck/light,$(KEYBOARD))) # Make sure it IS the Planck Light | 13 | ifneq (,$(findstring planck/light,$(KEYBOARD))) # Make sure it IS the Planck Light |
14 | RGB_MATRIX_ENABLE = yes | 14 | RGB_MATRIX_ENABLE = yes |
15 | RGBLIGHT_ENABLE = no | 15 | RGBLIGHT_ENABLE = yes |
16 | endif | 16 | endif |
17 | 17 | ||
18 | ifeq ($(strip $(PROTOCOL)), VUSB) | 18 | ifeq ($(strip $(PROTOCOL)), VUSB) |