diff options
22 files changed, 246 insertions, 91 deletions
diff --git a/keyboards/crkbd/keymaps/drashna/keymap.c b/keyboards/crkbd/keymaps/drashna/keymap.c index 0a9ff24ff..91f0ebfa2 100644 --- a/keyboards/crkbd/keymaps/drashna/keymap.c +++ b/keyboards/crkbd/keymaps/drashna/keymap.c | |||
| @@ -187,10 +187,10 @@ const char* read_modifier_state(void) { | |||
| 187 | uint8_t one_shot = get_oneshot_mods(); | 187 | uint8_t one_shot = get_oneshot_mods(); |
| 188 | 188 | ||
| 189 | snprintf(modifier_state_str, sizeof(modifier_state_str), "Mods:%s %s %s %s", | 189 | snprintf(modifier_state_str, sizeof(modifier_state_str), "Mods:%s %s %s %s", |
| 190 | (modifiers & MODS_CTRL_MASK || one_shot & MODS_CTRL_MASK) ? "CTL" : " ", | 190 | (modifiers & MOD_MASK_CTRL || one_shot & MOD_MASK_CTRL) ? "CTL" : " ", |
| 191 | (modifiers & MODS_GUI_MASK || one_shot & MODS_GUI_MASK) ? "GUI" : " ", | 191 | (modifiers & MOD_MASK_GUI || one_shot & MOD_MASK_GUI) ? "GUI" : " ", |
| 192 | (modifiers & MODS_ALT_MASK || one_shot & MODS_ALT_MASK) ? "ALT" : " ", | 192 | (modifiers & MOD_MASK_ALT || one_shot & MOD_MASK_ALT) ? "ALT" : " ", |
| 193 | (modifiers & MODS_SHIFT_MASK || one_shot & MODS_SHIFT_MASK) ? "SFT" : " " | 193 | (modifiers & MOD_MASK_SHIFT || one_shot & MOD_MASK_SHIFT) ? "SFT" : " " |
| 194 | ); | 194 | ); |
| 195 | 195 | ||
| 196 | return modifier_state_str; | 196 | return modifier_state_str; |
| @@ -252,7 +252,7 @@ void matrix_render_user(struct CharacterMatrix *matrix) { | |||
| 252 | // matrix_write_ln(matrix, read_keylog()); | 252 | // matrix_write_ln(matrix, read_keylog()); |
| 253 | matrix_write_ln(matrix, read_keylogs()); | 253 | matrix_write_ln(matrix, read_keylogs()); |
| 254 | // matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); | 254 | // matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); |
| 255 | matrix_write(matrix, read_host_led_state()); | 255 | // matrix_write(matrix, read_host_led_state()); |
| 256 | //matrix_write_ln(matrix, read_timelog()); | 256 | //matrix_write_ln(matrix, read_timelog()); |
| 257 | } else { | 257 | } else { |
| 258 | matrix_write(matrix, read_logo()); | 258 | matrix_write(matrix, read_logo()); |
diff --git a/keyboards/crkbd/keymaps/drashna/rules.mk b/keyboards/crkbd/keymaps/drashna/rules.mk index 4b70f66f7..540534978 100644 --- a/keyboards/crkbd/keymaps/drashna/rules.mk +++ b/keyboards/crkbd/keymaps/drashna/rules.mk | |||
| @@ -24,8 +24,8 @@ BOOTLOADER = qmk-dfu | |||
| 24 | 24 | ||
| 25 | # If you want to change the display of OLED, you need to change here | 25 | # If you want to change the display of OLED, you need to change here |
| 26 | SRC += ./lib/glcdfont.c \ | 26 | SRC += ./lib/glcdfont.c \ |
| 27 | ./lib/rgb_state_reader.c \ | ||
| 28 | ./lib/logo_reader.c \ | 27 | ./lib/logo_reader.c \ |
| 28 | # ./lib/rgb_state_reader.c \ | ||
| 29 | # ./lib/keylogger.c \ | 29 | # ./lib/keylogger.c \ |
| 30 | # ./lib/host_led_state_reader.c \ | 30 | # ./lib/host_led_state_reader.c \ |
| 31 | # ./lib/mode_icon_reader.c \ | 31 | # ./lib/mode_icon_reader.c \ |
diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index e0100de8f..428706e2d 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c | |||
| @@ -360,15 +360,15 @@ void matrix_scan_keymap(void) { // runs frequently to update info | |||
| 360 | // Since we're not using the LEDs here for layer indication anymore, | 360 | // 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... | 361 | // then lets use them for modifier indicators. Shame we don't have 4... |
| 362 | // Also, no "else", since we want to know each, independently. | 362 | // Also, no "else", since we want to know each, independently. |
| 363 | if (modifiers & MODS_SHIFT_MASK || led_usb_state & (1<<USB_LED_CAPS_LOCK) || one_shot & MODS_SHIFT_MASK) { | 363 | if ( ( modifiers | one_shot ) & MOD_MASK_SHIFT || led_usb_state & (1<<USB_LED_CAPS_LOCK) ) { |
| 364 | ergodox_right_led_2_on(); | 364 | ergodox_right_led_2_on(); |
| 365 | ergodox_right_led_2_set( 50 ); | 365 | ergodox_right_led_2_set( 50 ); |
| 366 | } | 366 | } |
| 367 | if (modifiers & MODS_CTRL_MASK || one_shot & MODS_CTRL_MASK) { | 367 | if ( ( modifiers | one_shot ) & MOD_MASK_CTRL) { |
| 368 | ergodox_right_led_1_on(); | 368 | ergodox_right_led_1_on(); |
| 369 | ergodox_right_led_1_set( 10 ); | 369 | ergodox_right_led_1_set( 10 ); |
| 370 | } | 370 | } |
| 371 | if (modifiers & MODS_ALT_MASK || one_shot & MODS_ALT_MASK) { | 371 | if ( ( modifiers | one_shot ) & MOD_MASK_ALT) { |
| 372 | ergodox_right_led_3_on(); | 372 | ergodox_right_led_3_on(); |
| 373 | ergodox_right_led_3_set( 10 ); | 373 | ergodox_right_led_3_set( 10 ); |
| 374 | } | 374 | } |
| @@ -414,7 +414,7 @@ void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue) { | |||
| 414 | } | 414 | } |
| 415 | 415 | ||
| 416 | void rgb_matrix_indicators_user(void) { | 416 | void rgb_matrix_indicators_user(void) { |
| 417 | if (g_suspend_state || !rgb_matrix_config.enable || !userspace_config.rgb_layer_change) return; | 417 | if (g_suspend_state || !rgb_matrix_config.enable || !userspace_config.rgb_layer_change) { return; } |
| 418 | 418 | ||
| 419 | switch (biton32(layer_state)) { | 419 | switch (biton32(layer_state)) { |
| 420 | case _MODS: | 420 | case _MODS: |
| @@ -464,20 +464,20 @@ void rgb_matrix_indicators_user(void) { | |||
| 464 | } | 464 | } |
| 465 | } | 465 | } |
| 466 | #if 0 | 466 | #if 0 |
| 467 | if (this_mod & MODS_SHIFT_MASK || this_led & (1<<USB_LED_CAPS_LOCK) || this_osm & MODS_SHIFT_MASK) { | 467 | if (this_mod & MOD_MASK_SHIFT || this_led & (1<<USB_LED_CAPS_LOCK) || this_osm & MOD_MASK_SHIFT) { |
| 468 | rgb_matrix_set_color(24, 0x00, 0xFF, 0x00); | 468 | rgb_matrix_set_color(24, 0x00, 0xFF, 0x00); |
| 469 | rgb_matrix_set_color(36, 0x00, 0xFF, 0x00); | 469 | rgb_matrix_set_color(36, 0x00, 0xFF, 0x00); |
| 470 | } | 470 | } |
| 471 | if (this_mod & MODS_CTRL_MASK || this_osm & MODS_CTRL_MASK) { | 471 | if (this_mod & MOD_MASK_CTRL || this_osm & MOD_MASK_CTRL) { |
| 472 | rgb_matrix_set_color(25, 0xFF, 0x00, 0x00); | 472 | rgb_matrix_set_color(25, 0xFF, 0x00, 0x00); |
| 473 | rgb_matrix_set_color(34, 0xFF, 0x00, 0x00); | 473 | rgb_matrix_set_color(34, 0xFF, 0x00, 0x00); |
| 474 | rgb_matrix_set_color(37, 0xFF, 0x00, 0x00); | 474 | rgb_matrix_set_color(37, 0xFF, 0x00, 0x00); |
| 475 | 475 | ||
| 476 | } | 476 | } |
| 477 | if (this_mod & MODS_GUI_MASK || this_osm & MODS_GUI_MASK) { | 477 | if (this_mod & MOD_MASK_GUI || this_osm & MOD_MASK_GUI) { |
| 478 | rgb_matrix_set_color(39, 0xFF, 0xD9, 0x00); | 478 | rgb_matrix_set_color(39, 0xFF, 0xD9, 0x00); |
| 479 | } | 479 | } |
| 480 | if (this_mod & MODS_ALT_MASK || this_osm & MODS_ALT_MASK) { | 480 | if (this_mod & MOD_MASK_ALT || this_osm & MOD_MASK_ALT) { |
| 481 | rgb_matrix_set_color(38, 0x00, 0x00, 0xFF); | 481 | rgb_matrix_set_color(38, 0x00, 0x00, 0xFF); |
| 482 | } | 482 | } |
| 483 | #endif | 483 | #endif |
diff --git a/layouts/community/ergodox/drashna_glow/config.h b/layouts/community/ergodox/drashna_glow/config.h index 197acbc4a..cdca5ba4b 100644 --- a/layouts/community/ergodox/drashna_glow/config.h +++ b/layouts/community/ergodox/drashna_glow/config.h | |||
| @@ -8,4 +8,15 @@ | |||
| 8 | #undef DEBOUNCE | 8 | #undef DEBOUNCE |
| 9 | #define DEBOUNCE 5 | 9 | #define DEBOUNCE 5 |
| 10 | 10 | ||
| 11 | #ifdef RGB_MATRIX_ENABLE | ||
| 11 | // #define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) | 12 | // #define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) |
| 13 | // #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened) | ||
| 14 | // #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects | ||
| 15 | #define RGB_DISABLE_WHEN_USB_SUSPENDED true// turn off effects when suspended | ||
| 16 | // #define RGB_MATRIX_SKIP_FRAMES 1 // number of frames to skip when displaying animations (0 is full effect) if not defined defaults to 1 | ||
| 17 | // #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 | ||
| 18 | // #define EECONFIG_RGB_MATRIX (uint32_t *)16 | ||
| 19 | #endif | ||
| 20 | |||
| 21 | #undef DEBOUNCE | ||
| 22 | #define DEBOUNCE 1 | ||
diff --git a/layouts/community/ergodox/drashna_glow/keymap.c b/layouts/community/ergodox/drashna_glow/keymap.c index f2fb66545..854555567 100644 --- a/layouts/community/ergodox/drashna_glow/keymap.c +++ b/layouts/community/ergodox/drashna_glow/keymap.c | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | /* placeholder file */ | 1 | /* placeholder file */ |
| 2 | #include QMK_KEYBOARD_H | 2 | #include QMK_KEYBOARD_H |
| 3 | 3 | ||
| 4 | #ifdef RGB_MATRIX_ENABLE | ||
| 4 | const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { | 5 | const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { |
| 5 | 6 | ||
| 6 | /*{row | col << 4} | 7 | /*{row | col << 4} |
| @@ -65,3 +66,5 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { | |||
| 65 | {{4|(8<<4)}, {24.9*1, 16*2}, 1}, // LED 23 | 66 | {{4|(8<<4)}, {24.9*1, 16*2}, 1}, // LED 23 |
| 66 | {{4|(9<<4)}, {24.9*0, 16*2}, 1}, // LED 24 | 67 | {{4|(9<<4)}, {24.9*0, 16*2}, 1}, // LED 24 |
| 67 | }; | 68 | }; |
| 69 | |||
| 70 | #endif | ||
diff --git a/layouts/community/numpad_5x6/bjohnson/config.h b/layouts/community/numpad_5x6/bjohnson/config.h new file mode 100644 index 000000000..fe2cffec7 --- /dev/null +++ b/layouts/community/numpad_5x6/bjohnson/config.h | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | // #define B6_AUDIO | ||
| 4 | |||
| 5 | #if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) | ||
| 6 | #define RGB_DI_PIN B7 | ||
| 7 | #define RGBLED_NUM 16 // Number of LEDs | ||
| 8 | #define RGBLIGHT_ANIMATIONS | ||
| 9 | |||
| 10 | #define RGBLIGHT_HUE_STEP 12 | ||
| 11 | #define RGBLIGHT_SAT_STEP 12 | ||
| 12 | #define RGBLIGHT_VAL_STEP 12 | ||
| 13 | #define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 | ||
| 14 | #define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 | ||
| 15 | #define RGBLIGHT_EFFECT_BREATHE_CENTER 1 | ||
| 16 | |||
| 17 | #define RGBLIGHT_SLEEP | ||
| 18 | #endif // RGBLIGHT_ENABLE | ||
| 19 | |||
| 20 | #ifdef AUDIO_ENABLE | ||
| 21 | #ifdef RGBLIGHT_ENABLE | ||
| 22 | #define NO_MUSIC_MODE | ||
| 23 | #endif // RGBLIGHT_ENABLE | ||
| 24 | #endif // AUDIO_ENABLE | ||
| 25 | #define TAP_CODE_DELAY 10 | ||
diff --git a/layouts/community/numpad_5x6/bjohnson/keymap.c b/layouts/community/numpad_5x6/bjohnson/keymap.c new file mode 100644 index 000000000..79e87e69f --- /dev/null +++ b/layouts/community/numpad_5x6/bjohnson/keymap.c | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | #include QMK_KEYBOARD_H | ||
| 2 | |||
| 3 | extern rgblight_config_t rgblight_config; | ||
| 4 | |||
| 5 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 6 | [0] = LAYOUT_numpad_5x6( | ||
| 7 | KC_F1, LT(1,KC_F2), KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, | ||
| 8 | KC_F3, KC_F4, KC_P7, KC_P8, KC_P9, | ||
| 9 | KC_F5, KC_F6, KC_P4, KC_P5, KC_P6, KC_PPLS, | ||
| 10 | KC_F7, KC_F8, KC_P1, KC_P2, KC_P3, | ||
| 11 | KC_F9, KC_F10, KC_P0, KC_PDOT, KC_PENT | ||
| 12 | ), | ||
| 13 | [1] = LAYOUT_numpad_5x6( | ||
| 14 | RGB_TOG, _______, _______, _______, _______, RESET, | ||
| 15 | RGB_MOD, RGB_RMOD, _______, _______, _______, | ||
| 16 | RGB_HUI, RGB_HUD, _______, _______, _______, _______, | ||
| 17 | RGB_SAI, RGB_SAD, _______, _______, _______, | ||
| 18 | RGB_VAI, RGB_VAD, _______, _______, _______ | ||
| 19 | ), | ||
| 20 | }; | ||
| 21 | |||
| 22 | |||
| 23 | void keyboard_post_init_user(void) { | ||
| 24 | #ifdef RGBLIGHT_ENABLE | ||
| 25 | uint8_t temp_mode = rgblight_config.mode; | ||
| 26 | rgblight_enable_noeeprom(); | ||
| 27 | rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); | ||
| 28 | for (uint16_t i = 360; i > 0; i--) { | ||
| 29 | rgblight_sethsv_noeeprom( ( i + 180) % 360, 255, 255); | ||
| 30 | wait_ms(8); | ||
| 31 | } | ||
| 32 | led_set_user(host_keyboard_leds()); | ||
| 33 | rgblight_mode_noeeprom(temp_mode); | ||
| 34 | #endif | ||
| 35 | } | ||
| 36 | |||
| 37 | void led_set_user(uint8_t usb_led) { | ||
| 38 | if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { | ||
| 39 | rgblight_sethsv_noeeprom_cyan(); | ||
| 40 | } else { | ||
| 41 | rgblight_sethsv_noeeprom_magenta(); | ||
| 42 | } | ||
| 43 | } | ||
| 44 | |||
| 45 | void shutdown_user (void) { | ||
| 46 | #ifdef RGBLIGHT_ENABLE | ||
| 47 | rgblight_enable_noeeprom(); | ||
| 48 | rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); | ||
| 49 | rgblight_setrgb_red(); | ||
| 50 | #endif // RGBLIGHT_ENABLE | ||
| 51 | } | ||
diff --git a/layouts/community/numpad_5x6/bjohnson/rules.mk b/layouts/community/numpad_5x6/bjohnson/rules.mk new file mode 100644 index 000000000..d370da7f1 --- /dev/null +++ b/layouts/community/numpad_5x6/bjohnson/rules.mk | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | AUDIO_ENABLE = no | ||
| 2 | RGBLIGHT_ENABLE = yes | ||
| 3 | BACKLIGHT_ENABLE = no | ||
| 4 | NO_SECRETS = yes | ||
| 5 | BOOTMAGIC_ENABLE = lite | ||
diff --git a/layouts/community/numpad_5x6/drashna/config.h b/layouts/community/numpad_5x6/drashna/config.h new file mode 100644 index 000000000..ec66940e0 --- /dev/null +++ b/layouts/community/numpad_5x6/drashna/config.h | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | // #define B6_AUDIO | ||
| 4 | |||
| 5 | #if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) | ||
| 6 | #define RGB_DI_PIN B1 | ||
| 7 | #define RGBLED_NUM 16 // Number of LEDs | ||
| 8 | |||
| 9 | #define RGBLIGHT_HUE_STEP 12 | ||
| 10 | #define RGBLIGHT_SAT_STEP 12 | ||
| 11 | #define RGBLIGHT_VAL_STEP 12 | ||
| 12 | #define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 | ||
| 13 | #define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 | ||
| 14 | #define RGBLIGHT_EFFECT_BREATHE_CENTER 1 | ||
| 15 | #endif // RGBLIGHT_ENABLE | ||
| 16 | |||
| 17 | |||
| 18 | #define TAP_CODE_DELAY 10 | ||
diff --git a/layouts/community/numpad_5x6/drashna/keymap.c b/layouts/community/numpad_5x6/drashna/keymap.c new file mode 100644 index 000000000..646f4db33 --- /dev/null +++ b/layouts/community/numpad_5x6/drashna/keymap.c | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | #include QMK_KEYBOARD_H | ||
| 2 | #include "drashna.h" | ||
| 3 | |||
| 4 | #define F2_MCRO LT(_GAMEPAD, KC_F2) | ||
| 5 | |||
| 6 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 7 | [_NUMLOCK] = LAYOUT_numpad_5x6( | ||
| 8 | KC_F1, F2_MCRO, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, | ||
| 9 | KC_F3, KC_F4, KC_P7, KC_P8, KC_P9, | ||
| 10 | KC_F5, KC_F6, KC_P4, KC_P5, KC_P6, KC_PPLS, | ||
| 11 | KC_F7, KC_F8, KC_P1, KC_P2, KC_P3, | ||
| 12 | KC_F9, KC_COLN, KC_P0, KC_PDOT, KC_PENT | ||
| 13 | ), | ||
| 14 | |||
| 15 | [_GAMEPAD] = LAYOUT_numpad_5x6( | ||
| 16 | RGB_TOG, _______, _______, EEP_RST, KC_MAKE, RESET, | ||
| 17 | RGB_MOD, RGB_RMOD, _______, _______, _______, | ||
| 18 | RGB_HUI, RGB_HUD, _______, _______, _______, _______, | ||
| 19 | RGB_SAI, RGB_SAD, _______, _______, _______, | ||
| 20 | RGB_VAI, RGB_VAD, _______, _______, _______ | ||
| 21 | ), | ||
| 22 | }; | ||
diff --git a/layouts/community/numpad_5x6/drashna/rules.mk b/layouts/community/numpad_5x6/drashna/rules.mk new file mode 100644 index 000000000..ed6fa8c79 --- /dev/null +++ b/layouts/community/numpad_5x6/drashna/rules.mk | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | AUDIO_ENABLE = no | ||
| 2 | RGBLIGHT_ENABLE = yes | ||
| 3 | BACKLIGHT_ENABLE = no | ||
| 4 | NO_SECRETS = yes | ||
| 5 | BOOTMAGIC_ENABLE = lite | ||
| 6 | INDICATOR_LIGHTS = no | ||
| 7 | RGBLIGHT_TWINKLE = yes | ||
| 8 | MACROS_ENABLED = no | ||
| 9 | MAKE_BOOTLOADER = yes | ||
diff --git a/layouts/community/numpad_5x6/layout.json b/layouts/community/numpad_5x6/layout.json new file mode 100644 index 000000000..7264cd5a6 --- /dev/null +++ b/layouts/community/numpad_5x6/layout.json | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | ["","","",""], | ||
| 2 | [{y:0.5},"","","",""], | ||
| 3 | ["","","",{h:2},""], | ||
| 4 | ["","",""], | ||
| 5 | ["","","",{h:2},""], | ||
| 6 | [{w:2},"",""] | ||
diff --git a/layouts/community/numpad_5x6/readme.md b/layouts/community/numpad_5x6/readme.md new file mode 100644 index 000000000..147097c83 --- /dev/null +++ b/layouts/community/numpad_5x6/readme.md | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | # numpad_5x6 | ||
| 2 | |||
| 3 | LAYOUT_numpad_5x6 | ||
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) |
diff --git a/users/drashna/config.h b/users/drashna/config.h index 2e125d1e4..2abd326da 100644 --- a/users/drashna/config.h +++ b/users/drashna/config.h | |||
| @@ -15,10 +15,10 @@ | |||
| 15 | // #ifdef RGBLIGHT_ENABLE | 15 | // #ifdef RGBLIGHT_ENABLE |
| 16 | // #define NO_MUSIC_MODE | 16 | // #define NO_MUSIC_MODE |
| 17 | // #endif //RGBLIGHT_ENABLE/ | 17 | // #endif //RGBLIGHT_ENABLE/ |
| 18 | #ifndef __arm__ | 18 | // #ifndef __arm__ |
| 19 | #undef NOTE_REST | 19 | // #undef NOTE_REST |
| 20 | #define NOTE_REST 1.00f | 20 | // #define NOTE_REST 1.00f |
| 21 | #endif // !__arm__ | 21 | // #endif // !__arm__ |
| 22 | 22 | ||
| 23 | #define UNICODE_SONG_OSX SONG(RICK_ROLL) | 23 | #define UNICODE_SONG_OSX SONG(RICK_ROLL) |
| 24 | #define UNICODE_SONG_LNX SONG(RICK_ROLL) | 24 | #define UNICODE_SONG_LNX SONG(RICK_ROLL) |
diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index 8019f2667..6968a4b92 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c | |||
| @@ -144,9 +144,9 @@ void shutdown_user (void) { | |||
| 144 | rgblight_setrgb_red(); | 144 | rgblight_setrgb_red(); |
| 145 | #endif // RGBLIGHT_ENABLE | 145 | #endif // RGBLIGHT_ENABLE |
| 146 | #ifdef RGB_MATRIX_ENABLE | 146 | #ifdef RGB_MATRIX_ENABLE |
| 147 | uint16_t timer_start = timer_read(); | 147 | // uint16_t timer_start = timer_read(); |
| 148 | rgb_matrix_set_color_all( 0xFF, 0x00, 0x00 ); | 148 | // rgb_matrix_set_color_all( 0xFF, 0x00, 0x00 ); |
| 149 | while(timer_elapsed(timer_start) < 250) { wait_ms(1); } | 149 | // while(timer_elapsed(timer_start) < 250) { wait_ms(1); } |
| 150 | #endif //RGB_MATRIX_ENABLE | 150 | #endif //RGB_MATRIX_ENABLE |
| 151 | shutdown_keymap(); | 151 | shutdown_keymap(); |
| 152 | } | 152 | } |
diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index ca55198e3..c19b18943 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h | |||
| @@ -53,11 +53,6 @@ enum userspace_layers { | |||
| 53 | /* | 53 | /* |
| 54 | define modifiers here, since MOD_* doesn't seem to work for these | 54 | define modifiers here, since MOD_* doesn't seem to work for these |
| 55 | */ | 55 | */ |
| 56 | #define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) | ||
| 57 | #define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL)) | ||
| 58 | #define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT)) | ||
| 59 | #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) | ||
| 60 | |||
| 61 | 56 | ||
| 62 | 57 | ||
| 63 | bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed); | 58 | bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed); |
diff --git a/users/drashna/process_records.c b/users/drashna/process_records.c index 73cad92f6..2d9025b37 100644 --- a/users/drashna/process_records.c +++ b/users/drashna/process_records.c | |||
| @@ -12,7 +12,6 @@ bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { | |||
| 12 | return true; | 12 | return true; |
| 13 | } | 13 | } |
| 14 | 14 | ||
| 15 | |||
| 16 | // Defines actions tor my global custom keycodes. Defined in drashna.h file | 15 | // Defines actions tor my global custom keycodes. Defined in drashna.h file |
| 17 | // Then runs the _keymap's record handier if not processed here | 16 | // Then runs the _keymap's record handier if not processed here |
| 18 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | 17 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { |
| @@ -35,30 +34,28 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 35 | 34 | ||
| 36 | case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader | 35 | case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader |
| 37 | if (!record->event.pressed) { | 36 | if (!record->event.pressed) { |
| 38 | #if !defined(KEYBOARD_viterbi) | 37 | uint8_t temp_mod = get_mods(); |
| 39 | uint8_t temp_mod = get_mods(); | 38 | uint8_t temp_osm = get_oneshot_mods(); |
| 40 | uint8_t temp_osm = get_oneshot_mods(); | 39 | clear_mods(); clear_oneshot_mods(); |
| 41 | clear_mods(); clear_oneshot_mods(); | ||
| 42 | #endif | ||
| 43 | send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), MACRO_TIMER); | 40 | send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), MACRO_TIMER); |
| 44 | #if defined(KEYBOARD_viterbi) | 41 | #ifndef MAKE_BOOTLOADER |
| 45 | send_string_with_delay_P(PSTR(":dfu" SS_TAP(X_ENTER)), MACRO_TIMER); | 42 | if ( ( temp_mod | temp_osm ) & MOD_MASK_SHIFT ) |
| 46 | #else | 43 | #endif |
| 47 | if (temp_mod & MODS_SHIFT_MASK || temp_osm & MODS_SHIFT_MASK) { | 44 | { |
| 48 | #if defined(__arm__) | 45 | #if defined(__arm__) |
| 49 | send_string_with_delay_P(PSTR(":dfu-util"), MACRO_TIMER); | 46 | send_string_with_delay_P(PSTR(":dfu-util"), MACRO_TIMER); |
| 50 | #elif defined(BOOTLOADER_DFU) | 47 | #elif defined(BOOTLOADER_DFU) |
| 51 | send_string_with_delay_P(PSTR(":dfu"), MACRO_TIMER); | 48 | send_string_with_delay_P(PSTR(":dfu"), MACRO_TIMER); |
| 52 | #elif defined(BOOTLOADER_HALFKAY) | 49 | #elif defined(BOOTLOADER_HALFKAY) |
| 53 | send_string_with_delay_P(PSTR(":teensy"), MACRO_TIMER); | 50 | send_string_with_delay_P(PSTR(":teensy"), MACRO_TIMER); |
| 54 | #elif defined(BOOTLOADER_CATERINA) | 51 | #elif defined(BOOTLOADER_CATERINA) |
| 55 | send_string_with_delay_P(PSTR(":avrdude"), MACRO_TIMER); | 52 | send_string_with_delay_P(PSTR(":avrdude"), MACRO_TIMER); |
| 56 | #endif // bootloader options | 53 | #endif // bootloader options |
| 57 | } | 54 | } |
| 58 | if (temp_mod & MODS_CTRL_MASK || temp_osm & MODS_CTRL_MASK) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), MACRO_TIMER); } | 55 | if ( ( temp_mod | temp_osm ) & MOD_MASK_CTRL) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), MACRO_TIMER); } |
| 59 | send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), MACRO_TIMER); | 56 | send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), MACRO_TIMER); |
| 60 | set_mods(temp_mod); | 57 | set_mods(temp_mod); |
| 61 | #endif | 58 | set_oneshot_mods(temp_osm); |
| 62 | } | 59 | } |
| 63 | break; | 60 | break; |
| 64 | 61 | ||
diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c index 7eaa7e949..a98ad590c 100644 --- a/users/drashna/rgb_stuff.c +++ b/users/drashna/rgb_stuff.c | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #if defined(RGBLIGHT_ENABLE) | 5 | #if defined(RGBLIGHT_ENABLE) |
| 6 | extern rgblight_config_t rgblight_config; | 6 | extern rgblight_config_t rgblight_config; |
| 7 | bool has_initialized; | ||
| 7 | #elif defined(RGB_MATRIX_ENABLE) | 8 | #elif defined(RGB_MATRIX_ENABLE) |
| 8 | extern rgb_config_t rgb_matrix_config; | 9 | extern rgb_config_t rgb_matrix_config; |
| 9 | #endif | 10 | #endif |
| @@ -17,7 +18,7 @@ void rgblight_sethsv_default_helper(uint8_t index) { | |||
| 17 | #ifdef INDICATOR_LIGHTS | 18 | #ifdef INDICATOR_LIGHTS |
| 18 | void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { | 19 | void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { |
| 19 | if (userspace_config.rgb_layer_change && biton32(layer_state) == 0) { | 20 | if (userspace_config.rgb_layer_change && biton32(layer_state) == 0) { |
| 20 | if (this_mod & MODS_SHIFT_MASK || this_led & (1<<USB_LED_CAPS_LOCK) || this_osm & MODS_SHIFT_MASK) { | 21 | if ( (this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1<<USB_LED_CAPS_LOCK) ) { |
| 21 | #ifdef SHFT_LED1 | 22 | #ifdef SHFT_LED1 |
| 22 | rgblight_sethsv_at(120, 255, 255, SHFT_LED1); | 23 | rgblight_sethsv_at(120, 255, 255, SHFT_LED1); |
| 23 | #endif // SHFT_LED1 | 24 | #endif // SHFT_LED1 |
| @@ -32,7 +33,7 @@ void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { | |||
| 32 | rgblight_sethsv_default_helper(SHFT_LED2); | 33 | rgblight_sethsv_default_helper(SHFT_LED2); |
| 33 | #endif // SHFT_LED2 | 34 | #endif // SHFT_LED2 |
| 34 | } | 35 | } |
| 35 | if (this_mod & MODS_CTRL_MASK || this_osm & MODS_CTRL_MASK) { | 36 | if ( (this_mod | this_osm) & MOD_MASK_CTRL) { |
| 36 | #ifdef CTRL_LED1 | 37 | #ifdef CTRL_LED1 |
| 37 | rgblight_sethsv_at(0, 255, 255, CTRL_LED1); | 38 | rgblight_sethsv_at(0, 255, 255, CTRL_LED1); |
| 38 | #endif // CTRL_LED1 | 39 | #endif // CTRL_LED1 |
| @@ -47,7 +48,7 @@ void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { | |||
| 47 | rgblight_sethsv_default_helper(CTRL_LED2); | 48 | rgblight_sethsv_default_helper(CTRL_LED2); |
| 48 | #endif // CTRL_LED2 | 49 | #endif // CTRL_LED2 |
| 49 | } | 50 | } |
| 50 | if (this_mod & MODS_GUI_MASK || this_osm & MODS_GUI_MASK) { | 51 | if ( (this_mod | this_osm) & MOD_MASK_GUI) { |
| 51 | #ifdef GUI_LED1 | 52 | #ifdef GUI_LED1 |
| 52 | rgblight_sethsv_at(51, 255, 255, GUI_LED1); | 53 | rgblight_sethsv_at(51, 255, 255, GUI_LED1); |
| 53 | #endif // GUI_LED1 | 54 | #endif // GUI_LED1 |
| @@ -62,7 +63,7 @@ void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { | |||
| 62 | rgblight_sethsv_default_helper(GUI_LED2); | 63 | rgblight_sethsv_default_helper(GUI_LED2); |
| 63 | #endif // GUI_LED2 | 64 | #endif // GUI_LED2 |
| 64 | } | 65 | } |
| 65 | if (this_mod & MODS_ALT_MASK || this_osm & MODS_ALT_MASK) { | 66 | if ( (this_mod | this_osm) & MOD_MASK_ALT) { |
| 66 | #ifdef ALT_LED1 | 67 | #ifdef ALT_LED1 |
| 67 | rgblight_sethsv_at(240, 255, 255, ALT_LED1); | 68 | rgblight_sethsv_at(240, 255, 255, ALT_LED1); |
| 68 | #endif // ALT_LED1 | 69 | #endif // ALT_LED1 |
| @@ -81,7 +82,9 @@ void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { | |||
| 81 | } | 82 | } |
| 82 | 83 | ||
| 83 | void matrix_scan_indicator(void) { | 84 | void matrix_scan_indicator(void) { |
| 84 | set_rgb_indicators(get_mods(), host_keyboard_leds(), get_oneshot_mods()); | 85 | if (has_initialized) { |
| 86 | set_rgb_indicators(get_mods(), host_keyboard_leds(), get_oneshot_mods()); | ||
| 87 | } | ||
| 85 | } | 88 | } |
| 86 | #endif //INDICATOR_LIGHTS | 89 | #endif //INDICATOR_LIGHTS |
| 87 | 90 | ||
| @@ -244,22 +247,16 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { | |||
| 244 | 247 | ||
| 245 | 248 | ||
| 246 | void keyboard_post_init_rgb(void) { | 249 | void keyboard_post_init_rgb(void) { |
| 247 | |||
| 248 | #ifdef RGBLIGHT_ENABLE | 250 | #ifdef RGBLIGHT_ENABLE |
| 249 | if (userspace_config.rgb_layer_change) { | 251 | rgblight_enable_noeeprom(); |
| 250 | rgblight_enable_noeeprom(); | 252 | layer_state_set_user(layer_state); |
| 251 | switch (biton32(eeconfig_read_default_layer())) { | 253 | uint16_t old_hue = rgblight_config.hue; |
| 252 | case _COLEMAK: | 254 | rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); |
| 253 | rgblight_sethsv_noeeprom_magenta(); break; | 255 | for (uint16_t i = 360; i > 0; i--) { |
| 254 | case _DVORAK: | 256 | rgblight_sethsv_noeeprom( ( i + old_hue) % 360, 255, 255); |
| 255 | rgblight_sethsv_noeeprom_springgreen(); break; | 257 | wait_ms(10); |
| 256 | case _WORKMAN: | 258 | } |
| 257 | rgblight_sethsv_noeeprom_goldenrod(); break; | 259 | layer_state_set_user(layer_state); |
| 258 | default: | ||
| 259 | rgblight_sethsv_noeeprom_cyan(); break; | ||
| 260 | } | ||
| 261 | rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); | ||
| 262 | } | ||
| 263 | #endif | 260 | #endif |
| 264 | } | 261 | } |
| 265 | 262 | ||
diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk index 6d8612e71..5050704a5 100644 --- a/users/drashna/rules.mk +++ b/users/drashna/rules.mk | |||
| @@ -42,3 +42,7 @@ ifdef CONSOLE_ENABLE | |||
| 42 | OPT_DEFS += -DKEYLOGGER_ENABLE | 42 | OPT_DEFS += -DKEYLOGGER_ENABLE |
| 43 | endif | 43 | endif |
| 44 | endif | 44 | endif |
| 45 | |||
| 46 | ifeq ($(strip $(MAKE_BOOTLOADER)), yes) | ||
| 47 | OPT_DEFS += -DMAKE_BOOTLOADER | ||
| 48 | endif | ||
