diff options
| author | Drashna Jaelre <drashna@live.com> | 2019-05-06 22:34:09 -0700 |
|---|---|---|
| committer | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2019-05-06 22:34:09 -0700 |
| commit | f3d5b1091d364468cd9f5510aef9e723d8542279 (patch) | |
| tree | 762b8f562b1e96e42657f872fd4b04c8efaaa829 /layouts | |
| parent | 7a751f114114bf3b78d5d8fc8bedf2b42b665dba (diff) | |
| download | qmk_firmware-f3d5b1091d364468cd9f5510aef9e723d8542279.tar.gz qmk_firmware-f3d5b1091d364468cd9f5510aef9e723d8542279.zip | |
[Keymap] RGB Changes for Drashna Keyboards (#5803)
* Disable a bunch of reactive modes
* Enable rgb matrix for Corne Keyboard
* Convert CRKBD to rgb matrix
* Add Gergo keyboard layout
* Make Diablo 3 tap dance better
* Add basic support for Planck EZ
* Fix RGB Matrix stuff
* Fix keycodes for Planck EZ
* Update CRKBD OLED stuff
* Fix typo for sleep on ergodox glow
* Improve my gergo layout
* Scrolling OLED key logger!
* Change gergo layout
* Hnadle unicode keycodes if unicode is disabled
* Disable COMMAND/CONSOLE for gergo
* Fix right side control
* Re-enable LTO for all platforms
Since I got updated arm gcc binaries that no longer error out on lto
* Update formatting to match newer community standards
Poor 2 space
* Re-alight startup animation to use new HUE range
* Streamline gitlab ci scripts
* Disabled Space Cadet
* Add support for breathing table
* Enable new LTO Option
And clean up defines that will now be repeatitive
* Remove vscode settings
* Additional formatting cleanup of config.h files
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/community/ergodox/drashna/config.h | 9 | ||||
| -rw-r--r-- | layouts/community/ergodox/drashna/keymap.c | 300 | ||||
| -rw-r--r-- | layouts/community/ergodox/drashna/rules.mk | 23 | ||||
| -rw-r--r-- | layouts/community/ergodox/drashna_glow/config.h | 15 | ||||
| -rw-r--r-- | layouts/community/numpad_5x6/drashna/config.h | 19 | ||||
| -rw-r--r-- | layouts/community/ortho_4x12/drashna/config.h | 59 | ||||
| -rw-r--r-- | layouts/community/ortho_4x12/drashna/keymap.c | 312 | ||||
| -rw-r--r-- | layouts/community/ortho_4x12/drashna/rules.mk | 25 | ||||
| -rw-r--r-- | layouts/community/ortho_5x12/drashna/config.h | 29 |
9 files changed, 419 insertions, 372 deletions
diff --git a/layouts/community/ergodox/drashna/config.h b/layouts/community/ergodox/drashna/config.h index 7b2ad4fa1..7feaf6f25 100644 --- a/layouts/community/ergodox/drashna/config.h +++ b/layouts/community/ergodox/drashna/config.h | |||
| @@ -1,12 +1,11 @@ | |||
| 1 | #pragma once | 1 | #pragma once |
| 2 | 2 | ||
| 3 | #ifdef RGBLIGHT_ENABLE | 3 | #ifdef RGBLIGHT_ENABLE |
| 4 | #undef RGBLIGHT_SAT_STEP | 4 | # undef RGBLIGHT_SAT_STEP |
| 5 | #define RGBLIGHT_SAT_STEP 12 | 5 | # define RGBLIGHT_SAT_STEP 12 |
| 6 | 6 | ||
| 7 | #define RGBLIGHT_EFFECT_KNIGHT_LENGTH 3 | 7 | # define RGBLIGHT_EFFECT_KNIGHT_LENGTH 3 |
| 8 | #define RGBLIGHT_EFFECT_SNAKE_LENGTH 3 | 8 | # define RGBLIGHT_EFFECT_SNAKE_LENGTH 3 |
| 9 | #define RGBLIGHT_EFFECT_BREATHE_CENTER 1 | ||
| 10 | #endif // RGBLIGHT_ENABLE | 9 | #endif // RGBLIGHT_ENABLE |
| 11 | 10 | ||
| 12 | 11 | ||
diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index 26c2e3304..eeb21501b 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c | |||
| @@ -20,6 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 20 | #ifdef UNICODEMAP_ENABLE | 20 | #ifdef UNICODEMAP_ENABLE |
| 21 | #include "drashna_unicode.h" | 21 | #include "drashna_unicode.h" |
| 22 | #endif // UNICODEMAP_ENABLE | 22 | #endif // UNICODEMAP_ENABLE |
| 23 | #ifndef UNICODE_ENABLE | ||
| 24 | # define UC(x) KC_NO | ||
| 25 | #endif | ||
| 23 | 26 | ||
| 24 | #ifdef RGB_MATRIX_ENABLE | 27 | #ifdef RGB_MATRIX_ENABLE |
| 25 | extern bool g_suspend_state; | 28 | extern bool g_suspend_state; |
| @@ -28,7 +31,7 @@ extern rgb_config_t rgb_matrix_config; | |||
| 28 | extern userspace_config_t userspace_config; | 31 | extern userspace_config_t userspace_config; |
| 29 | 32 | ||
| 30 | enum more_custom_keycodes { | 33 | enum more_custom_keycodes { |
| 31 | KC_SWAP_NUM = NEW_SAFE_RANGE | 34 | KC_SWAP_NUM = NEW_SAFE_RANGE |
| 32 | }; | 35 | }; |
| 33 | 36 | ||
| 34 | //define layer change stuff for underglow indicator | 37 | //define layer change stuff for underglow indicator |
| @@ -43,7 +46,7 @@ bool skip_leds = false; | |||
| 43 | KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS, \ | 46 | KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS, \ |
| 44 | KC_TAB, K01, K02, K03, K04, K05, TG(_DIABLO), TG(_DIABLO), K06, K07, K08, K09, K0A, KC_BSLS, \ | 47 | KC_TAB, K01, K02, K03, K04, K05, TG(_DIABLO), TG(_DIABLO), K06, K07, K08, K09, K0A, KC_BSLS, \ |
| 45 | KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ | 48 | KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ |
| 46 | KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), TG(_GAMEPAD), K26, K27, K28, K29, CTL_T(K2A), KC_MRSF, \ | 49 | KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), TG(_GAMEPAD), K26, K27, K28, K29, RCTL_T(K2A), KC_MRSF, \ |
| 47 | KC_GRV, OS_MEH, OS_HYPR, KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC(0x2E2E), \ | 50 | KC_GRV, OS_MEH, OS_HYPR, KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC(0x2E2E), \ |
| 48 | OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \ | 51 | OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \ |
| 49 | KC_APP, KC_MENU, \ | 52 | KC_APP, KC_MENU, \ |
| @@ -305,87 +308,88 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 305 | 308 | ||
| 306 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | 309 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { |
| 307 | 310 | ||
| 308 | switch (keycode) { | 311 | switch (keycode) { |
| 309 | case KC_1: | 312 | case KC_1: |
| 310 | if (IS_LAYER_ON(_GAMEPAD) && userspace_config.swapped_numbers) { | 313 | if (IS_LAYER_ON(_GAMEPAD) && userspace_config.swapped_numbers) { |
| 311 | if (record->event.pressed) { | 314 | if (record->event.pressed) { |
| 312 | register_code(KC_2); | 315 | register_code(KC_2); |
| 313 | } else { | 316 | } else { |
| 314 | unregister_code(KC_2); | 317 | unregister_code(KC_2); |
| 315 | } | 318 | } |
| 316 | return false; | 319 | return false; |
| 317 | } | 320 | } |
| 318 | break; | 321 | break; |
| 319 | case KC_2: | 322 | case KC_2: |
| 320 | if (IS_LAYER_ON(_GAMEPAD) && userspace_config.swapped_numbers) { | 323 | if (IS_LAYER_ON(_GAMEPAD) && userspace_config.swapped_numbers) { |
| 321 | if (record->event.pressed) { | 324 | if (record->event.pressed) { |
| 322 | register_code(KC_1); | 325 | register_code(KC_1); |
| 323 | } else { | 326 | } else { |
| 324 | unregister_code(KC_1); | 327 | unregister_code(KC_1); |
| 325 | } | 328 | } |
| 326 | return false; | 329 | return false; |
| 327 | } | 330 | } |
| 328 | break; | 331 | break; |
| 329 | case KC_SWAP_NUM: | 332 | case KC_SWAP_NUM: |
| 330 | if (record->event.pressed) { | 333 | if (record->event.pressed) { |
| 331 | userspace_config.swapped_numbers ^= 1; | 334 | userspace_config.swapped_numbers ^= 1; |
| 332 | eeconfig_update_user(userspace_config.raw); | 335 | eeconfig_update_user(userspace_config.raw); |
| 333 | } | 336 | } |
| 334 | } | 337 | break; |
| 335 | //switch (keycode) { | 338 | } |
| 336 | // case KC_P00: | 339 | //switch (keycode) { |
| 337 | // if (!record->event.pressed) { | 340 | // case KC_P00: |
| 338 | // register_code(KC_KP_0); | 341 | // if (!record->event.pressed) { |
| 339 | // unregister_code(KC_KP_0); | 342 | // register_code(KC_KP_0); |
| 340 | // register_code(KC_KP_0); | 343 | // unregister_code(KC_KP_0); |
| 341 | // unregister_code(KC_KP_0); | 344 | // register_code(KC_KP_0); |
| 342 | // } | 345 | // unregister_code(KC_KP_0); |
| 343 | // return false; | 346 | // } |
| 344 | // break; | 347 | // return false; |
| 345 | //} | 348 | // break; |
| 346 | return true; | 349 | //} |
| 350 | return true; | ||
| 347 | } | 351 | } |
| 348 | 352 | ||
| 349 | void matrix_scan_keymap(void) { // runs frequently to update info | 353 | void matrix_scan_keymap(void) { // runs frequently to update info |
| 350 | uint8_t modifiers = get_mods(); | 354 | uint8_t modifiers = get_mods(); |
| 351 | uint8_t led_usb_state = host_keyboard_leds(); | 355 | uint8_t led_usb_state = host_keyboard_leds(); |
| 352 | uint8_t one_shot = get_oneshot_mods(); | 356 | uint8_t one_shot = get_oneshot_mods(); |
| 353 | 357 | ||
| 354 | if (!skip_leds) { | 358 | if (!skip_leds) { |
| 355 | ergodox_board_led_off(); | 359 | ergodox_board_led_off(); |
| 356 | ergodox_right_led_1_off(); | 360 | ergodox_right_led_1_off(); |
| 357 | ergodox_right_led_2_off(); | 361 | ergodox_right_led_2_off(); |
| 358 | ergodox_right_led_3_off(); | 362 | ergodox_right_led_3_off(); |
| 359 | 363 | ||
| 360 | // Since we're not using the LEDs here for layer indication anymore, | 364 | // Since we're not using the LEDs here for layer indication anymore, |
| 361 | // then lets use them for modifier indicators. Shame we don't have 4... | 365 | // then lets use them for modifier indicators. Shame we don't have 4... |
| 362 | // Also, no "else", since we want to know each, independently. | 366 | // Also, no "else", since we want to know each, independently. |
| 363 | if ( ( modifiers | one_shot ) & MOD_MASK_SHIFT || led_usb_state & (1<<USB_LED_CAPS_LOCK) ) { | 367 | if ( ( modifiers | one_shot ) & MOD_MASK_SHIFT || led_usb_state & (1<<USB_LED_CAPS_LOCK) ) { |
| 364 | ergodox_right_led_2_on(); | 368 | ergodox_right_led_2_on(); |
| 365 | ergodox_right_led_2_set( 50 ); | 369 | ergodox_right_led_2_set( 50 ); |
| 366 | } | 370 | } |
| 367 | if ( ( modifiers | one_shot ) & MOD_MASK_CTRL) { | 371 | if ( ( modifiers | one_shot ) & MOD_MASK_CTRL) { |
| 368 | ergodox_right_led_1_on(); | 372 | ergodox_right_led_1_on(); |
| 369 | ergodox_right_led_1_set( 10 ); | 373 | ergodox_right_led_1_set( 10 ); |
| 370 | } | 374 | } |
| 371 | if ( ( modifiers | one_shot ) & MOD_MASK_ALT) { | 375 | if ( ( modifiers | one_shot ) & MOD_MASK_ALT) { |
| 372 | ergodox_right_led_3_on(); | 376 | ergodox_right_led_3_on(); |
| 373 | ergodox_right_led_3_set( 10 ); | 377 | ergodox_right_led_3_set( 10 ); |
| 374 | } | 378 | } |
| 375 | 379 | ||
| 376 | } | 380 | } |
| 377 | 381 | ||
| 378 | }; | 382 | } |
| 379 | 383 | ||
| 380 | 384 | ||
| 381 | bool indicator_is_this_led_used_keyboard(uint8_t index) { | 385 | bool indicator_is_this_led_used_keyboard(uint8_t index) { |
| 382 | switch (index) { | 386 | switch (index) { |
| 383 | case 13 ... 14: | 387 | case 13 ... 14: |
| 384 | return true; | 388 | return true; |
| 385 | break; | 389 | break; |
| 386 | default: | 390 | default: |
| 387 | return false; | 391 | return false; |
| 388 | } | 392 | } |
| 389 | } | 393 | } |
| 390 | 394 | ||
| 391 | 395 | ||
| @@ -393,101 +397,81 @@ bool indicator_is_this_led_used_keyboard(uint8_t index) { | |||
| 393 | 397 | ||
| 394 | void suspend_power_down_keymap(void) { | 398 | void suspend_power_down_keymap(void) { |
| 395 | rgb_matrix_set_suspend_state(true); | 399 | rgb_matrix_set_suspend_state(true); |
| 396 | rgb_matrix_config.enable = false; | ||
| 397 | } | 400 | } |
| 398 | 401 | ||
| 399 | void suspend_wakeup_init_keymap(void) { | 402 | void suspend_wakeup_init_keymap(void) { |
| 400 | rgb_matrix_config.enable = true; | ||
| 401 | rgb_matrix_set_suspend_state(false); | 403 | rgb_matrix_set_suspend_state(false); |
| 402 | } | 404 | } |
| 403 | 405 | ||
| 404 | void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue) { | 406 | void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue) { |
| 405 | rgb_led led; | 407 | rgb_led led; |
| 406 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { | 408 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { |
| 407 | led = g_rgb_leds[i]; | 409 | led = g_rgb_leds[i]; |
| 408 | if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { | 410 | if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { |
| 409 | rgb_matrix_set_color( i, red, green, blue ); | 411 | rgb_matrix_set_color( i, red, green, blue ); |
| 412 | } | ||
| 410 | } | 413 | } |
| 411 | } | ||
| 412 | } | 414 | } |
| 413 | 415 | ||
| 414 | void rgb_matrix_indicators_user(void) { | 416 | void rgb_matrix_indicators_user(void) { |
| 415 | if (g_suspend_state || !rgb_matrix_config.enable || !userspace_config.rgb_layer_change) { return; } | 417 | if ( userspace_config.rgb_layer_change && |
| 416 | 418 | #ifdef RGB_DISABLE_WHEN_USB_SUSPENDED | |
| 417 | switch (biton32(layer_state)) { | 419 | !g_suspend_state && |
| 418 | case _MODS: | ||
| 419 | rgb_matrix_layer_helper(0xFF, 0xFF, 0x00); break; | ||
| 420 | case _GAMEPAD: | ||
| 421 | rgb_matrix_layer_helper(0xFF, 0x80, 0x00); | ||
| 422 | rgb_matrix_set_color(32, 0x00, 0xFF, 0x00); // Q | ||
| 423 | rgb_matrix_set_color(31, 0x00, 0xFF, 0xFF); // W | ||
| 424 | rgb_matrix_set_color(30, 0xFF, 0x00, 0x00); // E | ||
| 425 | rgb_matrix_set_color(29, 0xFF, 0x80, 0x00); // R | ||
| 426 | rgb_matrix_set_color(37, 0x00, 0xFF, 0xFF); // A | ||
| 427 | rgb_matrix_set_color(36, 0x00, 0xFF, 0xFF); // S | ||
| 428 | rgb_matrix_set_color(35, 0x00, 0xFF, 0xFF); // D | ||
| 429 | rgb_matrix_set_color(34, 0x7A, 0x00, 0xFF); // F | ||
| 430 | |||
| 431 | rgb_matrix_set_color(27, 0xFF, 0xFF, 0xFF); // 1 | ||
| 432 | rgb_matrix_set_color(26, 0x00, 0xFF, 0x00); // 2 | ||
| 433 | rgb_matrix_set_color(25, 0x7A, 0x00, 0xFF); // 3 | ||
| 434 | |||
| 435 | break; | ||
| 436 | case _DIABLO: | ||
| 437 | rgb_matrix_layer_helper(0xFF, 0x00, 0x00); break; | ||
| 438 | case _RAISE: | ||
| 439 | rgb_matrix_layer_helper(0xFF, 0xFF, 0x00); break; | ||
| 440 | case _LOWER: | ||
| 441 | rgb_matrix_layer_helper(0x00, 0xFF, 0x00); break; | ||
| 442 | case _ADJUST: | ||
| 443 | rgb_matrix_layer_helper(0xFF, 0x00, 0x00); break; | ||
| 444 | default: | ||
| 445 | switch (biton32(default_layer_state)) { | ||
| 446 | case _QWERTY: | ||
| 447 | rgb_matrix_layer_helper(0x00, 0xFF, 0xFF); break; | ||
| 448 | case _COLEMAK: | ||
| 449 | rgb_matrix_layer_helper(0xFF, 0x00, 0xFF); break; | ||
| 450 | case _DVORAK: | ||
| 451 | rgb_matrix_layer_helper(0x00, 0xFF, 0x00); break; | ||
| 452 | case _WORKMAN: | ||
| 453 | rgb_matrix_layer_helper(0xD9, 0xA5, 0x21); break; | ||
| 454 | case _NORMAN: | ||
| 455 | rgb_matrix_layer_helper(0xFF, 0x7C, 0x4D); break; | ||
| 456 | case _MALTRON: | ||
| 457 | rgb_matrix_layer_helper(0xFF, 0xFF, 0x00); break; | ||
| 458 | case _EUCALYN: | ||
| 459 | rgb_matrix_layer_helper(0xFF, 0x80, 0xBF); break; | ||
| 460 | case _CARPLAX: | ||
| 461 | rgb_matrix_layer_helper(0x00, 0x00, 0xFF); break; | ||
| 462 | } | ||
| 463 | } | ||
| 464 | #if 0 | ||
| 465 | if (this_mod & MOD_MASK_SHIFT || this_led & (1<<USB_LED_CAPS_LOCK) || this_osm & MOD_MASK_SHIFT) { | ||
| 466 | rgb_matrix_set_color(24, 0x00, 0xFF, 0x00); | ||
| 467 | rgb_matrix_set_color(36, 0x00, 0xFF, 0x00); | ||
| 468 | } | ||
| 469 | if (this_mod & MOD_MASK_CTRL || this_osm & MOD_MASK_CTRL) { | ||
| 470 | rgb_matrix_set_color(25, 0xFF, 0x00, 0x00); | ||
| 471 | rgb_matrix_set_color(34, 0xFF, 0x00, 0x00); | ||
| 472 | rgb_matrix_set_color(37, 0xFF, 0x00, 0x00); | ||
| 473 | |||
| 474 | } | ||
| 475 | if (this_mod & MOD_MASK_GUI || this_osm & MOD_MASK_GUI) { | ||
| 476 | rgb_matrix_set_color(39, 0xFF, 0xD9, 0x00); | ||
| 477 | } | ||
| 478 | if (this_mod & MOD_MASK_ALT || this_osm & MOD_MASK_ALT) { | ||
| 479 | rgb_matrix_set_color(38, 0x00, 0x00, 0xFF); | ||
| 480 | } | ||
| 481 | #endif | 420 | #endif |
| 482 | } | 421 | #if defined(RGBLIGHT_ENABLE) |
| 483 | 422 | (!rgblight_config.enable && rgb_matrix_config.enable) | |
| 484 | void matrix_init_keymap(void) { | 423 | #else |
| 485 | #if 0 | 424 | rgb_matrix_config.enable |
| 486 | #ifdef RGB_MATRIX_KEYPRESSES | ||
| 487 | rgblight_mode(RGB_MATRIX_MULTISPLASH); | ||
| 488 | #else | ||
| 489 | rgblight_mode(RGB_MATRIX_RAINBOW_MOVING_CHEVRON); | ||
| 490 | #endif | ||
| 491 | #endif | 425 | #endif |
| 426 | ) { | ||
| 427 | switch (biton32(layer_state)) { | ||
| 428 | case _MODS: | ||
| 429 | rgb_matrix_layer_helper(0xFF, 0xFF, 0x00); break; | ||
| 430 | case _GAMEPAD: | ||
| 431 | rgb_matrix_layer_helper(0xFF, 0x80, 0x00); | ||
| 432 | rgb_matrix_set_color(32, 0x00, 0xFF, 0x00); // Q | ||
| 433 | rgb_matrix_set_color(31, 0x00, 0xFF, 0xFF); // W | ||
| 434 | rgb_matrix_set_color(30, 0xFF, 0x00, 0x00); // E | ||
| 435 | rgb_matrix_set_color(29, 0xFF, 0x80, 0x00); // R | ||
| 436 | rgb_matrix_set_color(37, 0x00, 0xFF, 0xFF); // A | ||
| 437 | rgb_matrix_set_color(36, 0x00, 0xFF, 0xFF); // S | ||
| 438 | rgb_matrix_set_color(35, 0x00, 0xFF, 0xFF); // D | ||
| 439 | rgb_matrix_set_color(34, 0x7A, 0x00, 0xFF); // F | ||
| 440 | |||
| 441 | rgb_matrix_set_color(27, 0xFF, 0xFF, 0xFF); // 1 | ||
| 442 | rgb_matrix_set_color(26, 0x00, 0xFF, 0x00); // 2 | ||
| 443 | rgb_matrix_set_color(25, 0x7A, 0x00, 0xFF); // 3 | ||
| 444 | |||
| 445 | break; | ||
| 446 | case _DIABLO: | ||
| 447 | rgb_matrix_layer_helper(0xFF, 0x00, 0x00); break; | ||
| 448 | case _RAISE: | ||
| 449 | rgb_matrix_layer_helper(0xFF, 0xFF, 0x00); break; | ||
| 450 | case _LOWER: | ||
| 451 | rgb_matrix_layer_helper(0x00, 0xFF, 0x00); break; | ||
| 452 | case _ADJUST: | ||
| 453 | rgb_matrix_layer_helper(0xFF, 0x00, 0x00); break; | ||
| 454 | default: | ||
| 455 | switch (biton32(default_layer_state)) { | ||
| 456 | case _QWERTY: | ||
| 457 | rgb_matrix_layer_helper(0x00, 0xFF, 0xFF); break; | ||
| 458 | case _COLEMAK: | ||
| 459 | rgb_matrix_layer_helper(0xFF, 0x00, 0xFF); break; | ||
| 460 | case _DVORAK: | ||
| 461 | rgb_matrix_layer_helper(0x00, 0xFF, 0x00); break; | ||
| 462 | case _WORKMAN: | ||
| 463 | rgb_matrix_layer_helper(0xD9, 0xA5, 0x21); break; | ||
| 464 | case _NORMAN: | ||
| 465 | rgb_matrix_layer_helper(0xFF, 0x7C, 0x4D); break; | ||
| 466 | case _MALTRON: | ||
| 467 | rgb_matrix_layer_helper(0xFF, 0xFF, 0x00); break; | ||
| 468 | case _EUCALYN: | ||
| 469 | rgb_matrix_layer_helper(0xFF, 0x80, 0xBF); break; | ||
| 470 | case _CARPLAX: | ||
| 471 | rgb_matrix_layer_helper(0x00, 0x00, 0xFF); break; | ||
| 472 | } | ||
| 473 | } | ||
| 474 | } | ||
| 492 | } | 475 | } |
| 476 | |||
| 493 | #endif //RGB_MATRIX_INIT | 477 | #endif //RGB_MATRIX_INIT |
diff --git a/layouts/community/ergodox/drashna/rules.mk b/layouts/community/ergodox/drashna/rules.mk index ee231321e..f0628d9da 100644 --- a/layouts/community/ergodox/drashna/rules.mk +++ b/layouts/community/ergodox/drashna/rules.mk | |||
| @@ -1,19 +1,20 @@ | |||
| 1 | TAP_DANCE_ENABLE = yes | 1 | TAP_DANCE_ENABLE = yes |
| 2 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | 2 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend |
| 3 | COMMAND_ENABLE = no # Commands for debug and configuration | 3 | COMMAND_ENABLE = no # Commands for debug and configuration |
| 4 | SPACE_CADET_ENABLE = no | ||
| 4 | ifneq (,$(findstring ergodox_ez,$(KEYBOARD))) | 5 | ifneq (,$(findstring ergodox_ez,$(KEYBOARD))) |
| 5 | RGBLIGHT_ENABLE = yes | 6 | RGBLIGHT_ENABLE = yes |
| 6 | RGB_MATRIX_ENABLE = no | 7 | RGB_MATRIX_ENABLE = no |
| 7 | endif | 8 | endif |
| 8 | CONSOLE_ENABLE = no | 9 | CONSOLE_ENABLE = no |
| 9 | BOOTMAGIC_ENABLE = yes | 10 | BOOTMAGIC_ENABLE = yes |
| 10 | 11 | ||
| 11 | UNICODE_ENABLE = yes | 12 | UNICODE_ENABLE = yes |
| 12 | UNICDOEMAP_ENABLE = no | 13 | UNICDOEMAP_ENABLE = no |
| 13 | 14 | ||
| 14 | MACROS_ENABLED = no | 15 | MACROS_ENABLED = no |
| 15 | RGBLIGHT_TWINKLE = no | 16 | RGBLIGHT_TWINKLE = no |
| 16 | INDICATOR_LIGHTS = no | 17 | INDICATOR_LIGHTS = no |
| 17 | RGBLIGHT_STARTUP_ANIMATION = yes | 18 | RGBLIGHT_STARTUP_ANIMATION = yes |
| 18 | 19 | ||
| 19 | DEBOUNCE_TYPE = eager_pk | 20 | DEBOUNCE_TYPE = eager_pk |
diff --git a/layouts/community/ergodox/drashna_glow/config.h b/layouts/community/ergodox/drashna_glow/config.h index e2d959426..5eb1c6d0f 100644 --- a/layouts/community/ergodox/drashna_glow/config.h +++ b/layouts/community/ergodox/drashna_glow/config.h | |||
| @@ -6,10 +6,21 @@ | |||
| 6 | #define PRODUCT DrashnaDox - Hacked ErgoDox EZ Glow | 6 | #define PRODUCT DrashnaDox - Hacked ErgoDox EZ Glow |
| 7 | 7 | ||
| 8 | #ifdef RGB_MATRIX_ENABLE | 8 | #ifdef RGB_MATRIX_ENABLE |
| 9 | #define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) | 9 | # define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) |
| 10 | // #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened) | 10 | // #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened) |
| 11 | // #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects | 11 | // #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects |
| 12 | #define RGB_DISABLE_WHEN_USB_SUSPENDED true// turn off effects when suspended | 12 | # define RGB_DISABLE_WHEN_USB_SUSPENDED true// turn off effects when suspended |
| 13 | // #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 | 13 | // #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 |
| 14 | // #define EECONFIG_RGB_MATRIX (uint32_t *)16 | 14 | // #define EECONFIG_RGB_MATRIX (uint32_t *)16 |
| 15 | |||
| 16 | # define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN | ||
| 17 | # define DISABLE_RGB_MATRIX_CYCLE_ALL | ||
| 18 | # define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON | ||
| 19 | # define DISABLE_RGB_MATRIX_DUAL_BEACON | ||
| 20 | # define DISABLE_RGB_MATRIX_RAINBOW_BEACON | ||
| 21 | # define DISABLE_RGB_MATRIX_DIGITAL_RAIN | ||
| 22 | # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE | ||
| 23 | # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS | ||
| 24 | # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS | ||
| 25 | |||
| 15 | #endif | 26 | #endif |
diff --git a/layouts/community/numpad_5x6/drashna/config.h b/layouts/community/numpad_5x6/drashna/config.h index e3a70694a..2fc5ab658 100644 --- a/layouts/community/numpad_5x6/drashna/config.h +++ b/layouts/community/numpad_5x6/drashna/config.h | |||
| @@ -3,18 +3,17 @@ | |||
| 3 | // #define B6_AUDIO | 3 | // #define B6_AUDIO |
| 4 | 4 | ||
| 5 | #if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) | 5 | #if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) |
| 6 | #define RGB_DI_PIN B1 | 6 | # define RGB_DI_PIN B1 |
| 7 | #define RGBLED_NUM 16 // Number of LEDs | 7 | # define RGBLED_NUM 16 // Number of LEDs |
| 8 | 8 | ||
| 9 | #define RGBLIGHT_HUE_STEP 12 | 9 | # define RGBLIGHT_HUE_STEP 12 |
| 10 | #define RGBLIGHT_SAT_STEP 12 | 10 | # define RGBLIGHT_SAT_STEP 12 |
| 11 | #define RGBLIGHT_VAL_STEP 12 | 11 | # define RGBLIGHT_VAL_STEP 12 |
| 12 | #define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 | 12 | # define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 |
| 13 | #define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 | 13 | # define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 |
| 14 | #define RGBLIGHT_EFFECT_BREATHE_CENTER 1 | ||
| 15 | #endif // RGBLIGHT_ENABLE | 14 | #endif // RGBLIGHT_ENABLE |
| 16 | 15 | ||
| 17 | #if defined(KEYBOARD_primekb_prime_m) | 16 | #if defined(KEYBOARD_primekb_prime_m) |
| 18 | #undef PRODUCT | 17 | # undef PRODUCT |
| 19 | #define PRODUCT Drashna Hacked Prime_M Macro Pad | 18 | # define PRODUCT Drashna Hacked Prime_M Macro Pad |
| 20 | #endif | 19 | #endif |
diff --git a/layouts/community/ortho_4x12/drashna/config.h b/layouts/community/ortho_4x12/drashna/config.h index f8e12f33d..475afd213 100644 --- a/layouts/community/ortho_4x12/drashna/config.h +++ b/layouts/community/ortho_4x12/drashna/config.h | |||
| @@ -2,49 +2,52 @@ | |||
| 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 B3 | 5 | # define RGB_DI_PIN B3 |
| 6 | #define RGBLED_NUM 13 // Number of LEDs | 6 | # define RGBLED_NUM 13 // Number of LEDs |
| 7 | #define RGBLIGHT_ANIMATIONS | 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 |
| 11 | #define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 | 11 | # define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 |
| 12 | #define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 | 12 | # define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 |
| 13 | #define RGBLIGHT_EFFECT_BREATHE_CENTER 1 | 13 | # ifdef RGB_MATRIX_ENABLE |
| 14 | # define RGBLIGHT_DISABLE_KEYCODES | ||
| 15 | # endif | ||
| 14 | #endif // RGBLIGHT_ENABLE | 16 | #endif // RGBLIGHT_ENABLE |
| 15 | 17 | ||
| 16 | #ifdef RGB_MATRIX_ENABLE | 18 | #ifdef RGB_MATRIX_ENABLE |
| 17 | #define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) | 19 | # 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) | 20 | // #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened) |
| 19 | // #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects | 21 | // #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects |
| 20 | #define RGB_DISABLE_WHEN_USB_SUSPENDED true// turn off effects when suspended | ||
| 21 | // #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 |
| 22 | #define EECONFIG_RGB_MATRIX (uint32_t *)15 | 23 | # define RGB_DISABLE_WHEN_USB_SUSPENDED true// turn off effects when suspended |
| 24 | # ifndef KEYBOARD_planck_ez | ||
| 25 | # define EECONFIG_RGB_MATRIX (uint32_t *)15 | ||
| 26 | # endif | ||
| 23 | #endif | 27 | #endif |
| 24 | 28 | ||
| 25 | #if defined(KEYBOARD_lets_split_rev2) | 29 | #if defined(KEYBOARD_lets_split_rev2) |
| 26 | #define USE_SERIAL | 30 | # define USE_SERIAL |
| 27 | #undef USE_I2C | 31 | # undef USE_I2C |
| 28 | 32 | # define EE_HANDS | |
| 29 | #define EE_HANDS | ||
| 30 | #endif | 33 | #endif |
| 31 | 34 | ||
| 32 | #if !defined(KEYBOARD_planck_light) | 35 | #if !defined(KEYBOARD_planck_light) |
| 33 | #ifdef RGBLIGHT_ENABLE | 36 | # ifdef RGBLIGHT_ENABLE |
| 34 | #define NO_MUSIC_MODE | 37 | # define NO_MUSIC_MODE |
| 35 | #endif // RGBLIGHT_ENABLE | 38 | # endif // RGBLIGHT_ENABLE |
| 36 | #endif // KEYBOARD_planck_light | 39 | #endif // KEYBOARD_planck_light |
| 37 | 40 | ||
| 38 | 41 | ||
| 39 | #if defined(KEYBOARD_planck) | 42 | #if defined(KEYBOARD_planck) |
| 40 | #undef PRODUCT | 43 | # undef PRODUCT |
| 41 | #if defined(KEYBOARD_planck_light) | 44 | # if defined(KEYBOARD_planck_light) |
| 42 | #define PRODUCT Drashna Hacked RGB Beacon (Planck Light) | 45 | # define PRODUCT Drashna Hacked RGB Beacon (Planck Light) |
| 43 | #elif defined(KEYBOARD_planck_rev6) | 46 | # elif defined(KEYBOARD_planck_rev6) |
| 44 | #define PRODUCT Drashna Hacked Planck Rev6 | 47 | # define PRODUCT Drashna Hacked Planck Rev6 |
| 45 | #elif defined(KEYBOARD_planck_EZ) | 48 | # elif defined(KEYBOARD_planck_EZ) |
| 46 | #define PRODUCT Drashna Hacked Planck EZ | 49 | # define PRODUCT Drashna Hacked Planck EZ |
| 47 | #endif | 50 | # endif |
| 48 | #endif | 51 | #endif |
| 49 | 52 | ||
| 50 | /* | 53 | /* |
| @@ -58,7 +61,7 @@ | |||
| 58 | - MIDI notes can be sent when in Music mode is on | 61 | - MIDI notes can be sent when in Music mode is on |
| 59 | */ | 62 | */ |
| 60 | 63 | ||
| 61 | #define MIDI_BASIC | 64 | // #define MIDI_BASIC |
| 62 | 65 | ||
| 63 | /* enable advanced MIDI features: | 66 | /* enable advanced MIDI features: |
| 64 | - MIDI notes can be added to the keymap | 67 | - MIDI notes can be added to the keymap |
diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c index f82b4e7da..5eef2e023 100644 --- a/layouts/community/ortho_4x12/drashna/keymap.c +++ b/layouts/community/ortho_4x12/drashna/keymap.c | |||
| @@ -34,6 +34,18 @@ enum planck_keycodes { | |||
| 34 | #define BACKLIT OSM(MOD_LSFT) | 34 | #define BACKLIT OSM(MOD_LSFT) |
| 35 | #endif | 35 | #endif |
| 36 | 36 | ||
| 37 | #ifdef KEYBOARD_planck_ez | ||
| 38 | # define PLNK_1 BK_LWER | ||
| 39 | # define PLNK_2 SP_LWER | ||
| 40 | # define PLNK_3 KC_NO | ||
| 41 | # define PLNK_4 ET_RAIS | ||
| 42 | #else | ||
| 43 | # define PLNK_1 SP_LWER | ||
| 44 | # define PLNK_2 BK_LWER | ||
| 45 | # define PLNK_3 DL_RAIS | ||
| 46 | # define PLNK_4 ET_RAIS | ||
| 47 | #endif | ||
| 48 | |||
| 37 | #define LAYOUT_ortho_4x12_base( \ | 49 | #define LAYOUT_ortho_4x12_base( \ |
| 38 | K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ | 50 | K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ |
| 39 | K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ | 51 | K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ |
| @@ -42,8 +54,8 @@ enum planck_keycodes { | |||
| 42 | LAYOUT_ortho_4x12_wrapper( \ | 54 | LAYOUT_ortho_4x12_wrapper( \ |
| 43 | KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ | 55 | KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ |
| 44 | KC_TAB, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ | 56 | KC_TAB, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ |
| 45 | KC_MLSF, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, CTL_T(K2A), KC_ENT, \ | 57 | KC_MLSF, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), KC_ENT, \ |
| 46 | BACKLIT, OS_LCTL, OS_LALT, OS_LGUI, SP_LWER, BK_LWER, DL_RAIS, ET_RAIS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ | 58 | BACKLIT, OS_LCTL, OS_LALT, OS_LGUI, PLNK_1, PLNK_2, PLNK_3, PLNK_4, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ |
| 47 | ) | 59 | ) |
| 48 | #define LAYOUT_ortho_4x12_base_wrapper(...) LAYOUT_ortho_4x12_base(__VA_ARGS__) | 60 | #define LAYOUT_ortho_4x12_base_wrapper(...) LAYOUT_ortho_4x12_base(__VA_ARGS__) |
| 49 | 61 | ||
| @@ -130,128 +142,132 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 130 | 142 | ||
| 131 | 143 | ||
| 132 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | 144 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { |
| 133 | switch (keycode) { | 145 | switch (keycode) { |
| 134 | 146 | #ifdef BACKLIGHT_ENABLE | |
| 135 | #ifdef BACKLIGHT_ENABLE | 147 | case BACKLIT: |
| 136 | case BACKLIT: | 148 | if (record->event.pressed) { |
| 137 | if (record->event.pressed) { | 149 | register_code(KC_RSFT); |
| 138 | register_code(KC_RSFT); | 150 | #ifdef BACKLIGHT_ENABLE |
| 139 | #ifdef BACKLIGHT_ENABLE | 151 | backlight_step(); |
| 140 | backlight_step(); | 152 | #endif |
| 141 | #endif | 153 | } else { |
| 142 | } else { | 154 | unregister_code(KC_RSFT); |
| 143 | unregister_code(KC_RSFT); | 155 | } |
| 144 | } | 156 | return false; |
| 145 | return false; | 157 | break; |
| 146 | break; | ||
| 147 | #endif | 158 | #endif |
| 148 | } | 159 | } |
| 149 | return true; | 160 | return true; |
| 150 | } | 161 | } |
| 151 | 162 | ||
| 152 | bool music_mask_user(uint16_t keycode) { | 163 | bool music_mask_user(uint16_t keycode) { |
| 153 | switch (keycode) { | 164 | switch (keycode) { |
| 154 | case RAISE: | 165 | case RAISE: |
| 155 | case LOWER: | 166 | case LOWER: |
| 156 | case BK_LWER: | 167 | case BK_LWER: |
| 157 | case SP_LWER: | 168 | case SP_LWER: |
| 158 | case DL_RAIS: | 169 | case DL_RAIS: |
| 159 | case ET_RAIS: | 170 | case ET_RAIS: |
| 160 | return false; | 171 | return false; |
| 161 | default: | 172 | default: |
| 162 | return true; | 173 | return true; |
| 163 | } | 174 | } |
| 164 | } | 175 | } |
| 165 | 176 | ||
| 166 | #ifdef RGB_MATRIX_ENABLE | 177 | #ifdef RGB_MATRIX_ENABLE |
| 167 | 178 | ||
| 168 | void suspend_power_down_keymap(void) { | 179 | void suspend_power_down_keymap(void) { |
| 169 | rgb_matrix_set_suspend_state(true); | 180 | rgb_matrix_set_suspend_state(true); |
| 170 | rgb_matrix_config.enable = false; | ||
| 171 | } | 181 | } |
| 172 | 182 | ||
| 173 | void suspend_wakeup_init_keymap(void) { | 183 | void suspend_wakeup_init_keymap(void) { |
| 174 | rgb_matrix_config.enable = true; | ||
| 175 | rgb_matrix_set_suspend_state(false); | 184 | rgb_matrix_set_suspend_state(false); |
| 176 | } | 185 | } |
| 177 | 186 | ||
| 178 | void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { | 187 | void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue) { |
| 179 | rgb_led led; | 188 | rgb_led led; |
| 180 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { | 189 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { |
| 181 | led = g_rgb_leds[i]; | 190 | led = g_rgb_leds[i]; |
| 182 | if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { | 191 | if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { |
| 183 | rgb_matrix_set_color( i, red, green, blue ); | 192 | rgb_matrix_set_color( i, red, green, blue ); |
| 193 | } | ||
| 184 | } | 194 | } |
| 185 | } | ||
| 186 | } | 195 | } |
| 187 | 196 | ||
| 188 | void rgb_matrix_indicators_user(void) { | 197 | void rgb_matrix_indicators_user(void) { |
| 189 | uint8_t this_mod = get_mods(); | 198 | uint8_t this_mod = get_mods(); |
| 190 | uint8_t this_led = host_keyboard_leds(); | 199 | uint8_t this_led = host_keyboard_leds(); |
| 191 | uint8_t this_osm = get_oneshot_mods(); | 200 | uint8_t this_osm = get_oneshot_mods(); |
| 192 | 201 | bool is_ez; | |
| 193 | if (!g_suspend_state && userspace_config.rgb_layer_change && | 202 | #ifdef KEYBOARD_planck_ez |
| 194 | #if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE) | 203 | is_ez = true; |
| 195 | (!rgblight_config.enable && rgb_matrix_config.enable) | 204 | #endif |
| 205 | |||
| 206 | if ( userspace_config.rgb_layer_change && | ||
| 207 | #ifdef RGB_DISABLE_WHEN_USB_SUSPENDED | ||
| 208 | !g_suspend_state && | ||
| 209 | #endif | ||
| 210 | #if defined(RGBLIGHT_ENABLE) | ||
| 211 | (!rgblight_config.enable && rgb_matrix_config.enable) | ||
| 196 | #else | 212 | #else |
| 197 | rgb_matrix_config.enable | 213 | rgb_matrix_config.enable |
| 198 | #endif | 214 | #endif |
| 199 | ) { | 215 | ) { |
| 200 | switch (biton32(layer_state)) { | 216 | switch (biton32(layer_state)) { |
| 201 | case _RAISE: | 217 | case _RAISE: |
| 202 | rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, false); break; | 218 | rgb_matrix_layer_helper(0xFF, 0xFF, 0x00); break; |
| 203 | case _LOWER: | 219 | case _LOWER: |
| 204 | rgb_matrix_layer_helper(0x00, 0xFF, 0x00, false); break; | 220 | rgb_matrix_layer_helper(0x00, 0xFF, 0x00); break; |
| 205 | case _ADJUST: | 221 | case _ADJUST: |
| 206 | rgb_matrix_layer_helper(0xFF, 0x00, 0x00, false); break; | 222 | rgb_matrix_layer_helper(0xFF, 0x00, 0x00); break; |
| 207 | default: | 223 | default: |
| 208 | switch (biton32(default_layer_state)) { | 224 | switch (biton32(default_layer_state)) { |
| 209 | case _QWERTY: | 225 | case _QWERTY: |
| 210 | rgb_matrix_layer_helper(0x00, 0xFF, 0xFF, true); break; | 226 | rgb_matrix_layer_helper(0x00, 0xFF, 0xFF); break; |
| 211 | case _COLEMAK: | 227 | case _COLEMAK: |
| 212 | rgb_matrix_layer_helper(0xFF, 0x00, 0xFF, true); break; | 228 | rgb_matrix_layer_helper(0xFF, 0x00, 0xFF); break; |
| 213 | case _DVORAK: | 229 | case _DVORAK: |
| 214 | rgb_matrix_layer_helper(0x00, 0xFF, 0x00, true); break; | 230 | rgb_matrix_layer_helper(0x00, 0xFF, 0x00); break; |
| 215 | case _WORKMAN: | 231 | case _WORKMAN: |
| 216 | rgb_matrix_layer_helper(0xD9, 0xA5, 0x21, true); break; | 232 | rgb_matrix_layer_helper(0xD9, 0xA5, 0x21); break; |
| 217 | case _NORMAN: | 233 | case _NORMAN: |
| 218 | rgb_matrix_layer_helper(0xFF, 0x7C, 0x4D, true); break; | 234 | rgb_matrix_layer_helper(0xFF, 0x7C, 0x4D); break; |
| 219 | case _MALTRON: | 235 | case _MALTRON: |
| 220 | rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, true); break; | 236 | rgb_matrix_layer_helper(0xFF, 0xFF, 0x00); break; |
| 221 | case _EUCALYN: | 237 | case _EUCALYN: |
| 222 | rgb_matrix_layer_helper(0xFF, 0x80, 0xBF, true); break; | 238 | rgb_matrix_layer_helper(0xFF, 0x80, 0xBF); break; |
| 223 | case _CARPLAX: | 239 | case _CARPLAX: |
| 224 | rgb_matrix_layer_helper(0x00, 0x00, 0xFF, true); break; | 240 | rgb_matrix_layer_helper(0x00, 0x00, 0xFF); break; |
| 241 | } | ||
| 225 | } | 242 | } |
| 226 | } | 243 | } |
| 227 | } | 244 | |
| 228 | 245 | switch (biton32(default_layer_state)) { | |
| 229 | switch (biton32(default_layer_state)) { | 246 | case _QWERTY: |
| 230 | case _QWERTY: | 247 | rgb_matrix_set_color(is_ez ? 41 : 42, 0x00, 0xFF, 0xFF); break; |
| 231 | rgb_matrix_set_color(42, 0x00, 0xFF, 0xFF); break; | 248 | case _COLEMAK: |
| 232 | case _COLEMAK: | 249 | rgb_matrix_set_color(is_ez ? 41 : 42, 0xFF, 0x00, 0xFF); break; |
| 233 | rgb_matrix_set_color(42, 0xFF, 0x00, 0xFF); break; | 250 | case _DVORAK: |
| 234 | case _DVORAK: | 251 | rgb_matrix_set_color(is_ez ? 41 : 42, 0x00, 0xFF, 0x00); break; |
| 235 | rgb_matrix_set_color(42, 0x00, 0xFF, 0x00); break; | 252 | case _WORKMAN: |
| 236 | case _WORKMAN: | 253 | rgb_matrix_set_color(is_ez ? 41 : 42, 0xD9, 0xA5, 0x21); break; |
| 237 | rgb_matrix_set_color(42, 0xD9, 0xA5, 0x21); break; | 254 | } |
| 238 | } | 255 | if ( (this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1<<USB_LED_CAPS_LOCK)) { |
| 239 | if ( (this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1<<USB_LED_CAPS_LOCK)) { | 256 | rgb_matrix_set_color(24, 0x00, 0xFF, 0x00); |
| 240 | rgb_matrix_set_color(24, 0x00, 0xFF, 0x00); | 257 | rgb_matrix_set_color(36, 0x00, 0xFF, 0x00); |
| 241 | rgb_matrix_set_color(36, 0x00, 0xFF, 0x00); | 258 | } |
| 242 | } | 259 | if ( (this_mod | this_osm) & MOD_MASK_CTRL) { |
| 243 | if ( (this_mod | this_osm) & MOD_MASK_CTRL) { | 260 | rgb_matrix_set_color(25, 0xFF, 0x00, 0x00); |
| 244 | rgb_matrix_set_color(25, 0xFF, 0x00, 0x00); | 261 | rgb_matrix_set_color(34, 0xFF, 0x00, 0x00); |
| 245 | rgb_matrix_set_color(34, 0xFF, 0x00, 0x00); | 262 | rgb_matrix_set_color(37, 0xFF, 0x00, 0x00); |
| 246 | rgb_matrix_set_color(37, 0xFF, 0x00, 0x00); | 263 | |
| 247 | 264 | } | |
| 248 | } | 265 | if ( (this_mod | this_osm) & MOD_MASK_GUI) { |
| 249 | if ( (this_mod | this_osm) & MOD_MASK_GUI) { | 266 | rgb_matrix_set_color(39, 0xFF, 0xD9, 0x00); |
| 250 | rgb_matrix_set_color(39, 0xFF, 0xD9, 0x00); | 267 | } |
| 251 | } | 268 | if ( (this_mod | this_osm) & MOD_MASK_ALT) { |
| 252 | if ( (this_mod | this_osm) & MOD_MASK_ALT) { | 269 | rgb_matrix_set_color(38, 0x00, 0x00, 0xFF); |
| 253 | rgb_matrix_set_color(38, 0x00, 0x00, 0xFF); | 270 | } |
| 254 | } | ||
| 255 | } | 271 | } |
| 256 | 272 | ||
| 257 | void matrix_init_keymap(void) { | 273 | void matrix_init_keymap(void) { |
| @@ -260,57 +276,81 @@ void matrix_init_keymap(void) { | |||
| 260 | #else //RGB_MATRIX_INIT | 276 | #else //RGB_MATRIX_INIT |
| 261 | 277 | ||
| 262 | void matrix_init_keymap(void) { | 278 | void matrix_init_keymap(void) { |
| 263 | #if !defined(CONVERT_TO_PROTON_C) && !defined(KEYBOARD_planck) | 279 | #if !defined(CONVERT_TO_PROTON_C) && !defined(KEYBOARD_planck) |
| 264 | setPinOutput(D5); | 280 | setPinOutput(D5); |
| 265 | writePinHigh(D5); | 281 | writePinHigh(D5); |
| 266 | 282 | ||
| 267 | setPinOutput(B0); | 283 | setPinOutput(B0); |
| 268 | writePinHigh(B0); | 284 | writePinHigh(B0); |
| 269 | #endif | 285 | #endif |
| 270 | } | 286 | } |
| 271 | #endif //RGB_MATRIX_INIT | 287 | #endif //RGB_MATRIX_INIT |
| 272 | 288 | ||
| 273 | #ifdef ENCODER_ENABLE | 289 | #ifdef ENCODER_ENABLE |
| 274 | void encoder_update(bool clockwise) { | 290 | void encoder_update(bool clockwise) { |
| 275 | switch (biton32(layer_state)) { | 291 | switch (biton32(layer_state)) { |
| 276 | case _RAISE: | 292 | case _RAISE: |
| 277 | clockwise ? tap_code(KC_VOLD) : tap_code(KC_VOLU); | 293 | clockwise ? tap_code(KC_VOLD) : tap_code(KC_VOLU); |
| 278 | break; | 294 | break; |
| 279 | case _LOWER: | 295 | case _LOWER: |
| 280 | #ifdef RGB_MATRIX_ENABLE | 296 | #ifdef RGB_MATRIX_ENABLE |
| 281 | clockwise ? rgb_matrix_step() : rgblight_step_reverse(); | 297 | clockwise ? rgb_matrix_step() : rgblight_step_reverse(); |
| 282 | #else | 298 | #else |
| 283 | clockwise ? tap_code(KC_PGDN) : tap_code(KC_PGUP); | 299 | clockwise ? tap_code(KC_PGDN) : tap_code(KC_PGUP); |
| 284 | #endif | 300 | #endif |
| 285 | case _ADJUST: | 301 | break; |
| 286 | #ifdef AUDIO_CLICKY | 302 | case _ADJUST: |
| 287 | clockwise ? clicky_freq_up() : clicky_freq_down(); | 303 | #ifdef AUDIO_CLICKY |
| 288 | #endif | 304 | clockwise ? clicky_freq_up() : clicky_freq_down(); |
| 289 | break; | 305 | #endif |
| 290 | default: | 306 | break; |
| 291 | clockwise ? tap_code(KC_DOWN) : tap_code(KC_UP); | 307 | default: |
| 292 | } | 308 | clockwise ? tap_code(KC_DOWN) : tap_code(KC_UP); |
| 293 | #ifdef AUDIO_CLICKY | 309 | } |
| 310 | #ifdef AUDIO_CLICKY | ||
| 294 | clicky_play(); | 311 | clicky_play(); |
| 295 | #endif | 312 | #endif |
| 296 | } | 313 | } |
| 297 | #endif // ENCODER_ENABLE | 314 | #endif // ENCODER_ENABLE |
| 298 | 315 | ||
| 299 | #ifdef KEYBOARD_planck_rev6 | 316 | #ifdef KEYBOARD_planck_rev6 |
| 300 | void dip_update(uint8_t index, bool active) { | 317 | void dip_update(uint8_t index, bool active) { |
| 301 | switch (index) { | 318 | switch (index) { |
| 302 | case 0: | 319 | case 0: |
| 303 | if(active) { audio_on(); } else { audio_off(); } | 320 | if(active) { audio_on(); } else { audio_off(); } |
| 304 | break; | 321 | break; |
| 305 | case 1: | 322 | case 1: |
| 306 | if(active) { clicky_on(); } else { clicky_off(); } | 323 | if(active) { clicky_on(); } else { clicky_off(); } |
| 307 | break; | 324 | break; |
| 308 | case 2: | 325 | case 2: |
| 309 | keymap_config.swap_lalt_lgui = keymap_config.swap_ralt_rgui = active; | 326 | keymap_config.swap_lalt_lgui = keymap_config.swap_ralt_rgui = active; |
| 310 | break; | 327 | break; |
| 311 | case 3: | 328 | case 3: |
| 312 | userspace_config.nuke_switch = active; | 329 | userspace_config.nuke_switch = active; |
| 313 | break; | 330 | break; |
| 314 | } | 331 | } |
| 315 | } | 332 | } |
| 316 | #endif // KEYBOARD_planck_rev6 | 333 | #endif // KEYBOARD_planck_rev6 |
| 334 | |||
| 335 | #ifdef KEYBOARD_planck_ez | ||
| 336 | uint32_t layer_state_set_keymap(uint32_t state) { | ||
| 337 | |||
| 338 | palClearPad(GPIOB, 8); | ||
| 339 | palClearPad(GPIOB, 9); | ||
| 340 | switch (biton32(state)) { | ||
| 341 | case _LOWER: | ||
| 342 | palSetPad(GPIOB, 9); | ||
| 343 | break; | ||
| 344 | case _RAISE: | ||
| 345 | palSetPad(GPIOB, 8); | ||
| 346 | break; | ||
| 347 | case _ADJUST: | ||
| 348 | palSetPad(GPIOB, 9); | ||
| 349 | palSetPad(GPIOB, 8); | ||
| 350 | break; | ||
| 351 | default: | ||
| 352 | break; | ||
| 353 | } | ||
| 354 | return state; | ||
| 355 | } | ||
| 356 | #endif | ||
diff --git a/layouts/community/ortho_4x12/drashna/rules.mk b/layouts/community/ortho_4x12/drashna/rules.mk index 89acba9eb..351201e2f 100644 --- a/layouts/community/ortho_4x12/drashna/rules.mk +++ b/layouts/community/ortho_4x12/drashna/rules.mk | |||
| @@ -5,16 +5,27 @@ CONSOLE_ENABLE = no # Console for debug(+400) | |||
| 5 | COMMAND_ENABLE = no # Commands for debug and configuration | 5 | COMMAND_ENABLE = no # Commands for debug and configuration |
| 6 | TAP_DANCE_ENABLE = no | 6 | TAP_DANCE_ENABLE = no |
| 7 | AUDIO_ENABLE = yes | 7 | AUDIO_ENABLE = yes |
| 8 | SPACE_CADET_ENABLE = no | ||
| 9 | |||
| 8 | ifeq (,$(findstring planck/rev6,$(KEYBOARD))) # Make sure it's NOT the Planck Rev6 | 10 | ifeq (,$(findstring planck/rev6,$(KEYBOARD))) # Make sure it's NOT the Planck Rev6 |
| 9 | RGBLIGHT_ENABLE = yes | 11 | RGBLIGHT_ENABLE = yes |
| 10 | INDICATOR_LIGHTS = yes | 12 | INDICATOR_LIGHTS = yes |
| 11 | RGBLIGHT_TWINKLE = yes | 13 | RGBLIGHT_TWINKLE = yes |
| 12 | RGBLIGHT_STARTUP_ANIMATION = yes | 14 | RGBLIGHT_STARTUP_ANIMATION = yes |
| 13 | endif | 15 | endif |
| 14 | ifneq (,$(findstring planck/light,$(KEYBOARD))) # Make sure it IS the Planck Light | 16 | ifneq (,$(findstring planck/light,$(KEYBOARD))) # Make sure it IS the Planck Light |
| 15 | RGB_MATRIX_ENABLE = yes | 17 | RGB_MATRIX_ENABLE = yes |
| 16 | RGBLIGHT_ENABLE = no | 18 | RGBLIGHT_ENABLE = no |
| 17 | RGBLIGHT_STARTUP_ANIMATION = no | 19 | RGBLIGHT_STARTUP_ANIMATION = no |
| 20 | endif | ||
| 21 | ifneq (,$(findstring planck/ez,$(KEYBOARD))) # Make sure it IS the Planck Light | ||
| 22 | RGBLIGHT_ENABLE = no | ||
| 23 | # SERIAL_LINK_ENABLE = yes | ||
| 24 | ENCODER_ENABLE = no | ||
| 25 | RGB_MATRIX_ENABLE = IS31FL3737 | ||
| 26 | INDICATOR_LIGHTS = yes | ||
| 27 | RGBLIGHT_TWINKLE = yes | ||
| 28 | RGBLIGHT_STARTUP_ANIMATION = yes | ||
| 18 | endif | 29 | endif |
| 19 | 30 | ||
| 20 | ifeq ($(strip $(PROTOCOL)), VUSB) | 31 | ifeq ($(strip $(PROTOCOL)), VUSB) |
diff --git a/layouts/community/ortho_5x12/drashna/config.h b/layouts/community/ortho_5x12/drashna/config.h index 480bf658c..123c284a2 100644 --- a/layouts/community/ortho_5x12/drashna/config.h +++ b/layouts/community/ortho_5x12/drashna/config.h | |||
| @@ -3,20 +3,19 @@ | |||
| 3 | 3 | ||
| 4 | /* ws2812 RGB LED */ | 4 | /* ws2812 RGB LED */ |
| 5 | #if defined(KEYBOARD_fractal) | 5 | #if defined(KEYBOARD_fractal) |
| 6 | #define RGB_DI_PIN D2 | 6 | # define RGB_DI_PIN D2 |
| 7 | #undef RGBLED_NUM | 7 | # undef RGBLED_NUM |
| 8 | #define RGBLIGHT_ANIMATIONS | 8 | # define RGBLIGHT_ANIMATIONS |
| 9 | #define RGBLED_NUM 29 // Number of LEDs | 9 | # define RGBLED_NUM 29 // Number of LEDs |
| 10 | #undef RGBLIGHT_HUE_STEP | 10 | # undef RGBLIGHT_HUE_STEP |
| 11 | #define RGBLIGHT_HUE_STEP 8 | 11 | # define RGBLIGHT_HUE_STEP 8 |
| 12 | #undef RGBLIGHT_SAT_STEP | 12 | # undef RGBLIGHT_SAT_STEP |
| 13 | #define RGBLIGHT_SAT_STEP 8 | 13 | # define RGBLIGHT_SAT_STEP 8 |
| 14 | #undef RGBLIGHT_VAL_STEP | 14 | # undef RGBLIGHT_VAL_STEP |
| 15 | #define RGBLIGHT_VAL_STEP 8 | 15 | # define RGBLIGHT_VAL_STEP 8 |
| 16 | #define RGBLIGHT_LIMIT_VAL 175 | 16 | # define RGBLIGHT_LIMIT_VAL 175 |
| 17 | #define RGBLIGHT_SLEEP | 17 | # define RGBLIGHT_SLEEP |
| 18 | |||
| 19 | #define RGBLIGHT_EFFECT_KNIGHT_OFFSET 3 | ||
| 20 | #define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 14 | ||
| 21 | 18 | ||
| 19 | # define RGBLIGHT_EFFECT_KNIGHT_OFFSET 3 | ||
| 20 | # define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 14 | ||
| 22 | #endif | 21 | #endif |
