~ruther/qmk_firmware

00d3061e02fa5fedaa6e6cebd310d4e716ffffee — Drashna Jaelre 5 years ago b3b115b
[Keymap] Cleanup of Drashna code (#7800)

* ifdef rgb stuff like a madman for RGB Coexistance

* Re-enable RGB Light on Planck

* fix RGB Coexistance issue

* Tweak feature settings for Ergodox EZ Glow

* Their powers combine, and I am Captain RGB

This one is for noroadsleft and yan.

* Limit brightness when both RGB features are enabled

* Change shutdown method

* Add RGB Coexistience stuff to keymap

* disable RGBLIGHT_SLEEP until a solution can be found

* Disable Unicode on the kyria

* Fix up Iris rev defines

* Fix up community layouts to compile properly

* Cleanup rgb stuff

* Merge ergodox keymaps

* Update CCCV macro to use tap_code16

* Enable Solenoid on C39

Because josh couldn't

* Enable RGB Light, not Matrix on rev6 keymap

* Only enable LTO on non-ARM boards

* Clean up Bootmagic OLED display

* Enable RGBLIGHT_SPLIT on kyria

Not that it does anything

* Add hotkey for discord
M keyboards/c39/keymaps/drashna/config.h => keyboards/c39/keymaps/drashna/config.h +2 -0
@@ 10,3 10,5 @@

#define RGB_DI_PIN B10
#define RGBLED_NUM 15

#define SOLENOID_PIN B11

M keyboards/c39/keymaps/drashna/rules.mk => keyboards/c39/keymaps/drashna/rules.mk +2 -0
@@ 18,3 18,5 @@ AUDIO_ENABLE = yes           # Audio output on port C6
RGBLIGHT_ENABLE = yes       # RGB Enable / Disable

RGBLIGHT_STARTUP_ANIMATION = yes

HAPTIC_ENABLE = SOLENOID

M keyboards/keebio/iris/keymaps/drashna/config.h => keyboards/keebio/iris/keymaps/drashna/config.h +9 -5
@@ 46,11 46,13 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
#ifdef AUDIO_ENABLE
#    define C6_AUDIO
#    ifdef RGBLIGHT_ENABLE
#        define NO_MUSIC_MODE
#        ifndef __arm__
#            define NO_MUSIC_MODE
#        endif
#    endif  // RGBLIGHT_ENABLE
#endif      // AUDIO_ENABLE

#ifndef KEYBOARD_keebio_iris_rev3
#if defined(KEYBOARD_keebio_iris_rev1) || defined(KEYBOARD_keebio_iris_rev2)
#    define QMK_ESC_OUTPUT F6  // usually COL
#    define QMK_ESC_INPUT D7   // usually ROW
#    define QMK_LED B0


@@ 58,10 60,12 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
#endif

#undef PRODUCT
#ifdef KEYBOARD_keebio_iris_rev2
#    define PRODUCT Drashna Hacked Iris Rev .2
#if defined(KEYBOARD_keebio_iris_rev2)
#    define PRODUCT Drashna Hacked Iris Rev 2
#elif defined(KEYBOARD_keebio_iris_rev3)
#    define PRODUCT Drashna Hacked Iris Rev .3
#    define PRODUCT Drashna Hacked Iris Rev 3
#elif defined(KEYBOARD_keebio_iris_rev4)
#    define PRODUCT Drashna Hacked Iris Rev 4
#endif

#define SHFT_LED1 6

M keyboards/kyria/keymaps/drashna/config.h => keyboards/kyria/keymaps/drashna/config.h +1 -0
@@ 31,6 31,7 @@
#    define RGBLIGHT_HUE_STEP 8
#    define RGBLIGHT_SAT_STEP 8
#    define RGBLIGHT_VAL_STEP 8
#    define RGBLIGHT_SPLIT
#endif

// If you are using an Elite C rev3 on the slave side, uncomment the lines below:

M keyboards/kyria/keymaps/drashna/keymap.c => keyboards/kyria/keymaps/drashna/keymap.c +21 -31
@@ 52,7 52,7 @@ void add_keylog(uint16_t keycode);
  LAYOUT_wrapper( \
      KC_ESC,  K01,     K02,     K03,     K04,     K05,                                             K06,     K07,     K08,     K09,     K0A,     KC_MINS, \
   LALT_T(KC_TAB), K11, K12,     K13,     K14,     K15,                                             K16,     K17,     K18,     K19,     K1A, RALT_T(KC_QUOT), \
      OS_LSFT, CTL_T(K21), K22,  K23,     K24,     K25,     KC_NO,   KC_NO,       KC_NO,   KC_NO,   K26,     K27,     K28,     K29, RCTL_T(K2A), OS_RSFT, \
      OS_LSFT, CTL_T(K21), K22,  K23,     K24,     K25,     KC_NO,   KC_NO,  MEH(KC_MINS), KC_NO,   K26,     K27,     K28,     K29, RCTL_T(K2A), OS_RSFT, \
                                 KC_MUTE, OS_LALT, KC_GRV,  KC_SPC,  BK_LWER,     DL_RAIS, KC_ENT,  OS_RGUI, UC(0x03A8), UC(0x2E2E) \
    )
/* Re-pass though to allow templates to be used */


@@ 191,30 191,14 @@ void render_keylogger_status(void) {
void render_default_layer_state(void) {
    oled_write_P(PSTR("Layout: "), false);
    switch (get_highest_layer(default_layer_state)) {
        case _QWERTY:
            oled_write_ln_P(PSTR("Qwerty "), false);
            break;
        case _COLEMAK:
            oled_write_ln_P(PSTR("Colemak"), false);
            break;
        case _DVORAK:
            oled_write_ln_P(PSTR("Dvorak"), false);
            break;
        case _WORKMAN:
            oled_write_ln_P(PSTR("Workman"), false);
            break;
        case _NORMAN:
            oled_write_ln_P(PSTR("Norman"), false);
            break;
        case _MALTRON:
            oled_write_ln_P(PSTR("Maltron"), false);
            break;
        case _EUCALYN:
            oled_write_ln_P(PSTR("Eucalyn"), false);
            break;
        case _CARPLAX:
            oled_write_ln_P(PSTR("Carplax"), false);
            break;
        case _QWERTY:  oled_write_ln_P(PSTR("Qwerty"), false); break;
        case _COLEMAK: oled_write_ln_P(PSTR("Colemak"), false); break;
        case _DVORAK:  oled_write_ln_P(PSTR("Dvorak"), false);  break;
        case _WORKMAN: oled_write_ln_P(PSTR("Workman"), false); break;
        case _NORMAN:  oled_write_ln_P(PSTR("Norman"), false);  break;
        case _MALTRON: oled_write_ln_P(PSTR("Maltron"), false); break;
        case _EUCALYN: oled_write_ln_P(PSTR("Eucalyn"), false); break;
        case _CARPLAX: oled_write_ln_P(PSTR("Carplax"), false); break;
    }
}



@@ 230,11 214,11 @@ void render_layer_state(void) {

void render_keylock_status(uint8_t led_usb_state) {
    oled_write_P(PSTR("Lock: "), false);
    oled_write_P(PSTR("NUM"), led_usb_state & (1 << USB_LED_NUM_LOCK));
    oled_write_P(PSTR("NUML"), led_usb_state & (1 << USB_LED_NUM_LOCK));
    oled_write_P(PSTR(" "), false);
    oled_write_P(PSTR("CAPS"), led_usb_state & (1 << USB_LED_CAPS_LOCK));
    oled_write_P(PSTR(" "), false);
    oled_write_ln_P(PSTR("SCL"), led_usb_state & (1 << USB_LED_SCROLL_LOCK));
    oled_write_ln_P(PSTR("SCLK"), led_usb_state & (1 << USB_LED_SCROLL_LOCK));
}

void render_mod_status(uint8_t modifiers) {


@@ 255,15 239,21 @@ void render_bootmagic_status(void) {
        {{0x95, 0x96, 0}, {0xb5, 0xb6, 0}},
    };
    oled_write_P(PSTR("Boot  "), false);
    oled_write_P(logo[0][0], !keymap_config.swap_lctl_lgui);
    oled_write_P(logo[1][0], keymap_config.swap_lctl_lgui);
    if (keymap_config.swap_lctl_lgui) {
        oled_write_P(logo[1][0], false);
    } else {
        oled_write_P(logo[0][0], false);
    }
    oled_write_P(PSTR(" "), false);
    oled_write_P(PSTR("NKRO"), keymap_config.nkro);
    oled_write_P(PSTR(" "), false);
    oled_write_ln_P(PSTR("GUI"), !keymap_config.no_gui);
    oled_write_P(PSTR("Magic "), false);
    oled_write_P(logo[0][1], !keymap_config.swap_lctl_lgui);
    oled_write_P(logo[1][1], keymap_config.swap_lctl_lgui);
    if (keymap_config.swap_lctl_lgui) {
        oled_write_P(logo[1][1], false);
    } else {
        oled_write_P(logo[0][1], false);
    }
    oled_write_P(PSTR(" "), false);
    oled_write_P(PSTR("GRV"), keymap_config.swap_grave_esc);
    oled_write_P(PSTR("  "), false);

M keyboards/kyria/keymaps/drashna/rules.mk => keyboards/kyria/keymaps/drashna/rules.mk +1 -1
@@ 1,7 1,7 @@
OLED_DRIVER_ENABLE = yes   # Enables the use of OLED displays
ENCODER_ENABLE = yes       # ENables the use of one or more encoders
RGBLIGHT_ENABLE = yes      # Enable keyboard RGB underglow
RGBLIGHT_STARTUP_ANIMATION = yes
RGBLIGHT_STARTUP_ANIMATION = no

BOOTMAGIC_ENABLE = no      # Virtual DIP switch configuration
MOUSEKEY_ENABLE = no      # Mouse keys

M layouts/community/ergodox/drashna/config.h => layouts/community/ergodox/drashna/config.h +14 -1
@@ 6,10 6,13 @@

#    define RGBLIGHT_EFFECT_KNIGHT_LENGTH 3
#    define RGBLIGHT_EFFECT_SNAKE_LENGTH 3
#    ifdef RGB_MATRIX_ENABLE
#        define RGBLIGHT_DISABLE_KEYCODES
#    endif
#endif  // RGBLIGHT_ENABLE

#undef PRODUCT
#define PRODUCT DrashnaDox - Hacked ErgoDox EZ Shine
#define PRODUCT DrashnaDox - Hacked ErgoDox EZ Hybrid Monstrosity

#undef DEBOUNCE
#define DEBOUNCE 30


@@ 17,3 20,13 @@
#define TAPPING_TERM_PER_KEY

#define ERGODOX_LED_30

#ifdef RGB_MATRIX_ENABLE
#    undef RGB_MATRIX_LED_PROCESS_LIMIT
#    undef RGB_MATRIX_LED_FLUSH_LIMIT
#    if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE)
#        define RGBLIGHT_LIMIT_VAL 175
#        define RGB_MATRIX_MAXIMUM_BRIGHTNESS (RGBLIGHT_LIMIT_VAL + 25)
#        undef RGBLIGHT_SLEEP
#    endif
#endif

M layouts/community/ergodox/drashna/keymap.c => layouts/community/ergodox/drashna/keymap.c +21 -20
@@ 280,7 280,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
            ),

  [_ADJUST] = LAYOUT_ergodox_pretty_wrapper(
             KC_MAKE, _______, _______, _______, _______, _______, _______,                 KC_NUKE, _________________ADJUST_R1_________________, KC_RST,
             KC_MAKE, _______, _______, _______, _______, _______, UC_MOD,                  KC_NUKE, _________________ADJUST_R1_________________, KC_RST,
             VRSN,    _________________ADJUST_L1_________________, _______,                 _______, _______, _______, _______, _______, _______, EEP_RST,
             _______, _________________ADJUST_L2_________________,                                   _________________ADJUST_R2_________________, RGB_IDL,
             _______, _________________ADJUST_L3_________________, _______,                 _______, _________________ADJUST_R3_________________, TG(_MODS),


@@ 382,31 382,32 @@ void suspend_power_down_keymap(void) { rgb_matrix_set_suspend_state(true); }
void suspend_wakeup_init_keymap(void) { rgb_matrix_set_suspend_state(false); }

void rgb_matrix_indicators_user(void) {
    if (userspace_config.rgb_layer_change &&
#    ifdef RGB_DISABLE_WHEN_USB_SUSPENDED
        !g_suspend_state &&
#    endif
    if (g_suspend_state || !rgb_matrix_config.enable) return;

    if (layer_state_is(_GAMEPAD)) {
        rgb_matrix_set_color(32, 0x00, 0xFF, 0x00);  // Q
        rgb_matrix_set_color(31, 0x00, 0xFF, 0xFF);  // W
        rgb_matrix_set_color(30, 0xFF, 0x00, 0x00);  // E
        rgb_matrix_set_color(29, 0xFF, 0x80, 0x00);  // R
        rgb_matrix_set_color(37, 0x00, 0xFF, 0xFF);  // A
        rgb_matrix_set_color(36, 0x00, 0xFF, 0xFF);  // S
        rgb_matrix_set_color(35, 0x00, 0xFF, 0xFF);  // D
        rgb_matrix_set_color(34, 0x7A, 0x00, 0xFF);  // F

        rgb_matrix_set_color(userspace_config.swapped_numbers ? 27 : 26, 0xFF, 0xFF, 0xFF);  // 1
        rgb_matrix_set_color(userspace_config.swapped_numbers ? 26 : 27, 0x00, 0xFF, 0x00);  // 2
        rgb_matrix_set_color(25, 0x7A, 0x00, 0xFF);                                          // 3
    }

#    if defined(RGBLIGHT_ENABLE)
        (!rgblight_config.enable && rgb_matrix_config.enable)
    if (!userspace_config.rgb_layer_change)
#    else
        rgb_matrix_config.enable
    if (userspace_config.rgb_layer_change)
#    endif
    ) {
    {
        switch (get_highest_layer(layer_state)) {
            case _GAMEPAD:
                rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
                rgb_matrix_set_color(32, 0x00, 0xFF, 0x00);  // Q
                rgb_matrix_set_color(31, 0x00, 0xFF, 0xFF);  // W
                rgb_matrix_set_color(30, 0xFF, 0x00, 0x00);  // E
                rgb_matrix_set_color(29, 0xFF, 0x80, 0x00);  // R
                rgb_matrix_set_color(37, 0x00, 0xFF, 0xFF);  // A
                rgb_matrix_set_color(36, 0x00, 0xFF, 0xFF);  // S
                rgb_matrix_set_color(35, 0x00, 0xFF, 0xFF);  // D
                rgb_matrix_set_color(34, 0x7A, 0x00, 0xFF);  // F

                rgb_matrix_set_color(userspace_config.swapped_numbers ? 27 : 26, 0xFF, 0xFF, 0xFF);  // 1
                rgb_matrix_set_color(userspace_config.swapped_numbers ? 26 : 27, 0x00, 0xFF, 0x00);  // 2
                rgb_matrix_set_color(25, 0x7A, 0x00, 0xFF);                                          // 3
                break;
            case _DIABLO:
                rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed * 8, LED_FLAG_MODIFIER);

M layouts/community/ergodox/drashna/rules.mk => layouts/community/ergodox/drashna/rules.mk +9 -8
@@ 1,19 1,20 @@
TAP_DANCE_ENABLE   = yes
BOOTMAGIC_ENABLE   = lite
TAP_DANCE_ENABLE   = no
SLEEP_LED_ENABLE   = no  # Breathing sleep LED during USB suspend
COMMAND_ENABLE     = no  # Commands for debug and configuration
CONSOLE_ENABLE     = no
SPACE_CADET_ENABLE = no

ifeq ($(strip $(KEYBOARD)), ergodox_ez)
    RGBLIGHT_ENABLE   = yes
    RGB_MATRIX_ENABLE = no
    RGBLIGHT_ENABLE    = yes
    RGB_MATRIX_ENABLE  = yes
    RGBLIGHT_TWINKLE   = no
    INDICATOR_LIGHTS   = no
    RGBLIGHT_STARTUP_ANIMATION = no
endif
CONSOLE_ENABLE     = no
BOOTMAGIC_ENABLE   = yes

UNICODE_ENABLE     = yes
UNICDOEMAP_ENABLE  = no

RGBLIGHT_TWINKLE   = no
INDICATOR_LIGHTS   = no
RGBLIGHT_STARTUP_ANIMATION = yes

DEBOUNCE_TYPE     = eager_pr

D layouts/community/ergodox/drashna_glow/config.h => layouts/community/ergodox/drashna_glow/config.h +0 -9
@@ 1,9 0,0 @@
#pragma once

#include "../drashna/config.h"

#undef PRODUCT
#define PRODUCT         DrashnaDox - Hacked ErgoDox EZ Glow

#undef RGB_MATRIX_LED_PROCESS_LIMIT
#undef RGB_MATRIX_LED_FLUSH_LIMIT

D layouts/community/ergodox/drashna_glow/keymap.c => layouts/community/ergodox/drashna_glow/keymap.c +0 -2
@@ 1,2 0,0 @@
/* placeholder file */
#include QMK_KEYBOARD_H

D layouts/community/ergodox/drashna_glow/rules.mk => layouts/community/ergodox/drashna_glow/rules.mk +0 -13
@@ 1,13 0,0 @@
USER_NAME := drashna

CORRECTED_LAYOUT := $(LAYOUTS_REPO)/$(LAYOUT)/drashna

SRC += $(CORRECTED_LAYOUT)/keymap.c

-include $(CORRECTED_LAYOUT)/rules.mk

ifeq ($(strip $(KEYBOARD)), ergodox_ez)
	RGBLIGHT_ENABLE = no
	RGB_MATRIX_ENABLE = yes
#   TAP_DANCE_ENABLE  = no
endif

M layouts/community/ortho_4x12/drashna/keymap.c => layouts/community/ortho_4x12/drashna/keymap.c +6 -7
@@ 224,16 224,14 @@ void rgb_matrix_indicators_user(void) {
    is_ez = true;
#    endif

    if (userspace_config.rgb_layer_change &&
#    ifdef RGB_DISABLE_WHEN_USB_SUSPENDED
        !g_suspend_state &&
#    endif
    if (g_suspend_state || !rgb_matrix_config.enable) return;

#    if defined(RGBLIGHT_ENABLE)
        (!rgblight_config.enable && rgb_matrix_config.enable)
    if (!userspace_config.rgb_layer_change)
#    else
        rgb_matrix_config.enable
    if (userspace_config.rgb_layer_change)
#    endif
    ) {
    {
        switch (get_highest_layer(layer_state)) {
            case _GAMEPAD:
                rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER);


@@ 297,6 295,7 @@ void rgb_matrix_indicators_user(void) {
            rgb_matrix_set_color(is_ez ? 41 : 42, 0xD9, 0xA5, 0x21);
            break;
    }

    if ((this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1 << USB_LED_CAPS_LOCK)) {
        if (!layer_state_cmp(layer_state, _ADJUST)) {
            rgb_matrix_set_color(24, 0x00, 0xFF, 0x00);

M layouts/community/ortho_4x12/drashna/rules.mk => layouts/community/ortho_4x12/drashna/rules.mk +11 -9
@@ 2,7 2,6 @@ BOOTMAGIC_ENABLE   = lite       # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE    = no       # Mouse keys(+4700)
EXTRAKEY_ENABLE    = yes       # Audio control and System control(+450)
TAP_DANCE_ENABLE   = no
AUDIO_ENABLE       = yes
SPACE_CADET_ENABLE = no
NKRO_ENABLE        = yes



@@ 11,20 10,22 @@ ifneq ($(strip $(KEYBOARD)), planck/rev6)
    COMMAND_ENABLE    			= no
    ifeq ($(strip $(LAYOUT_HAS_RGB)), yes)
        RGBLIGHT_ENABLE         = yes
	endif
    INDICATOR_LIGHTS            = yes
    RGBLIGHT_TWINKLE            = yes
    RGBLIGHT_STARTUP_ANIMATION  = yes
        INDICATOR_LIGHTS            = yes
        RGBLIGHT_TWINKLE            = yes
        RGBLIGHT_STARTUP_ANIMATION  = yes
    endif
else
    CONSOLE_ENABLE    			= yes
    COMMAND_ENABLE    			= yes
    RGBLIGHT_ENABLE             = no
    RGB_MATRIX_ENABLE           = WS2812
    RGBLIGHT_ENABLE             = yes
    RGB_MATRIX_ENABLE           = no
    AUDIO_ENABLE       			= yes
endif
ifeq ($(strip $(KEYBOARD)), planck/light)
    RGB_MATRIX_ENABLE           = yes
    RGBLIGHT_ENABLE             = no
    RGBLIGHT_STARTUP_ANIMATION  = no
    RGBLIGHT_ENABLE             = yes
    RGBLIGHT_STARTUP_ANIMATION  = yes
    AUDIO_ENABLE       			= yes
    # HAPTIC_ENABLE               += SOLENOID
endif
ifeq ($(strip $(KEYBOARD)), planck/ez)


@@ 37,4 38,5 @@ ifeq ($(strip $(KEYBOARD)), planck/ez)
    RGBLIGHT_STARTUP_ANIMATION  = yes
    CONSOLE_ENABLE    			= yes
    COMMAND_ENABLE    			= yes
    AUDIO_ENABLE       			= yes
endif

M layouts/community/ortho_5x12/drashna/rules.mk => layouts/community/ortho_5x12/drashna/rules.mk +0 -1
@@ 4,7 4,6 @@ EXTRAKEY_ENABLE   = yes       # Audio control and System control(+450)
CONSOLE_ENABLE    = no         # Console for debug(+400)
COMMAND_ENABLE    = no        # Commands for debug and configuration
TAP_DANCE_ENABLE  = no
AUDIO_ENABLE      = yes
NKRO_ENABLE       = yes

ifeq ($(strip $(KEYBOARD)), fractal)

M users/drashna/drashna.c => users/drashna/drashna.c +5 -1
@@ 121,9 121,13 @@ void shutdown_user(void) {
    rgblight_setrgb_red();
#endif  // RGBLIGHT_ENABLE
#ifdef RGB_MATRIX_ENABLE
#    ifdef __AVR__
    rgb_matrix_set_color_all(0xFF, 0x00, 0x00);
    rgb_matrix_update_pwm_buffers();

#    else
    rgb_matrix_sethsv_noeeprom(0, 255, 255);
    rgb_matrix_mode_noeeprom(1);
#    endif
#endif  // RGB_MATRIX_ENABLE
    shutdown_keymap();
}

M users/drashna/process_records.c => users/drashna/process_records.c +2 -6
@@ 80,13 80,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
                copy_paste_timer = timer_read();
            } else {
                if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) {  // Hold, copy
                    register_code(KC_LCTL);
                    tap_code(KC_C);
                    unregister_code(KC_LCTL);
                    tap_code16(LCTL(KC_C));
                } else {  // Tap, paste
                    register_code(KC_LCTL);
                    tap_code(KC_V);
                    unregister_code(KC_LCTL);
                    tap_code16(LCTL(KC_V));
                }
            }
            break;

M users/drashna/rgb_stuff.c => users/drashna/rgb_stuff.c +168 -5
@@ 147,6 147,7 @@ bool rgblight_twinkle_is_led_used(uint8_t index) {
/* Handler for fading/twinkling effect */
void scan_rgblight_fadeout(void) {  // Don't effing change this function .... rgblight_sethsv is supppppper intensive
    bool litup = false;

    for (uint8_t light_index = 0; light_index < RGBLED_NUM; ++light_index) {
        if (lights[light_index].enabled && timer_elapsed(lights[light_index].timer) > 10) {
            rgblight_fadeout *light = &lights[light_index];


@@ 179,6 180,7 @@ void start_rgb_light(void) {
    uint8_t indices_count  = 0;
    uint8_t min_life       = 0xFF;
    uint8_t min_life_index = -1;

    for (uint8_t index = 0; index < RGBLED_NUM; ++index) {
        if (rgblight_twinkle_is_led_used(index)) {
            continue;


@@ 248,7 250,14 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) {
                dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change);
                eeconfig_update_user(userspace_config.raw);
                if (userspace_config.rgb_layer_change) {
#    if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE)
                    rgblight_enable_noeeprom();
#    endif
                    layer_state_set(layer_state);  // This is needed to immediately set the layer color (looks better)
#    if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE)
                } else {
                    rgblight_disable_noeeprom();
#    endif
                }
            }
#endif  // RGBLIGHT_ENABLE


@@ 265,28 274,182 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) {
            }
#endif
            break;
#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
        case RGB_TOG:
            // Split keyboards need to trigger on key-up for edge-case issue
#    ifndef SPLIT_KEYBOARD
            if (record->event.pressed) {
#    else
            if (!record->event.pressed) {
#    endif
#    if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
                rgblight_toggle();
#    endif
#    if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES)
                rgb_matrix_toggle();
#    endif
            }
            return false;
            break;
        case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT:  // quantum_keycodes.h L400 for definitions
            if (record->event.pressed) {
                bool is_eeprom_updated = false;
#ifdef RGBLIGHT_ENABLE
                bool is_eeprom_updated;
#    if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
                // This disables layer indication, as it's assumed that if you're changing this ... you want that disabled
                if (userspace_config.rgb_layer_change) {
                    userspace_config.rgb_layer_change = false;
                    dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change);
                    is_eeprom_updated = true;
                }
#endif
#if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS)
#    endif
#    if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS)
                if (userspace_config.rgb_matrix_idle_anim) {
                    userspace_config.rgb_matrix_idle_anim = false;
                    dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim);
                    is_eeprom_updated = true;
                }
#endif
#    endif
                if (is_eeprom_updated) {
                    eeconfig_update_user(userspace_config.raw);
                }
            }

#    if defined(RGBLIGHT_DISABLE_KEYCODES) || defined(RGB_MATRIX_DISABLE_KEYCODES)
            if (keycode == RGB_MODE_FORWARD && record->event.pressed) {
                uint8_t shifted = get_mods() & (MOD_MASK_SHIFT);
                if (shifted) {
#        if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
                    rgblight_step_reverse();
#        endif
#        if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES)
                    rgb_matrix_step_reverse();
#        endif
                } else {
#        if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
                    rgblight_step();
#        endif
#        if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES)
                    rgb_matrix_step();
#        endif
                }
            } else if (keycode == RGB_MODE_REVERSE && record->event.pressed) {
                uint8_t shifted = get_mods() & (MOD_MASK_SHIFT);
                if (shifted) {
#        if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
                    rgblight_step();
#        endif
#        if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES)
                    rgb_matrix_step();
#        endif
                } else {
#        if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
                    rgblight_step_reverse();
#        endif
#        if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES)
                    rgb_matrix_step_reverse();
#        endif
                }
            } else if (keycode == RGB_HUI) {
#        ifndef SPLIT_KEYBOARD
                if (record->event.pressed) {
#        else
                if (!record->event.pressed) {
#        endif
#        if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
                    rgblight_increase_hue();
#        endif
#        if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES)
                    rgb_matrix_increase_hue();
#        endif
                }
            } else if (keycode == RGB_HUD) {
#        ifndef SPLIT_KEYBOARD
                if (record->event.pressed) {
#        else
                if (!record->event.pressed) {
#        endif
#        if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
                    rgblight_decrease_hue();
#        endif
#        if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES)
                    rgb_matrix_decrease_hue();
#        endif
                }
            } else if (keycode == RGB_SAI) {
#        ifndef SPLIT_KEYBOARD
                if (record->event.pressed) {
#        else
                if (!record->event.pressed) {
#        endif
#        if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
                    rgblight_increase_sat();
#        endif
#        if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES)
                    rgb_matrix_increase_sat();
#        endif
                }
            } else if (keycode == RGB_SAD) {
#        ifndef SPLIT_KEYBOARD
                if (record->event.pressed) {
#        else
                if (!record->event.pressed) {
#        endif
#        if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
                    rgblight_decrease_sat();
#        endif
#        if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES)
                    rgb_matrix_decrease_sat();
#        endif
                }
            } else if (keycode == RGB_VAI) {
#        ifndef SPLIT_KEYBOARD
                if (record->event.pressed) {
#        else
                if (!record->event.pressed) {
#        endif
#        if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
                    rgblight_increase_val();
#        endif
#        if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES)
                    rgb_matrix_increase_val();
#        endif
                }
            } else if (keycode == RGB_VAD) {
#        ifndef SPLIT_KEYBOARD
                if (record->event.pressed) {
#        else
                if (!record->event.pressed) {
#        endif
#        if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
                    rgblight_decrease_val();
#        endif
#        if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES)
                    rgb_matrix_decrease_val();
#        endif
                }
            } else if (keycode == RGB_SPI) {
                if (record->event.pressed) {
#        if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
                    rgblight_increase_speed();
#        endif
#        if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES)
                    rgb_matrix_increase_speed();
#        endif
                }
            } else if (keycode == RGB_SPD) {
                if (record->event.pressed) {
#        if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
                    rgblight_decrease_speed();
#        endif
#        if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES)
                    rgb_matrix_decrease_speed();
#        endif
                }
            }
            return false;
#    endif
#endif

            break;
    }
    return true;

M users/drashna/rules.mk => users/drashna/rules.mk +4 -2
@@ 1,7 1,9 @@
SRC += drashna.c \
       process_records.c

LTO_ENABLE            = yes
ifneq ($(PLATFORM),CHIBIOS)
    LTO_ENABLE            = yes
endif
SPACE_CADET_ENABLE    = no

ifneq ($(strip $(NO_SECRETS)), yes)


@@ 58,4 60,4 @@ endif
# this should be handled per keyboard, but until that happens ...
ifeq ($(strip $(PROTOCOL)), VUSB)
    NKRO_ENABLE       = no
endif
\ No newline at end of file
endif