forked from mirrors/qmk_userspace
Update to drashna keymaps (#4365)
* Consistency fixes and more eeprom defaults * Handle setting Unicode mode on eeprom reset better * Unicode EEPROM hack * Re-enable permissive hold and ignore mod tap * Set unicode input mode * More unicode stuff * more haaaaaacks * Attempted RGB Cleanup * Fix compiler issue * Add GitLab CI config for personal compiling * Add avr gcc version to GitLab CI script * Add rgblight init to matrix init
This commit is contained in:
parent
6729265625
commit
f2101cfb6a
7 changed files with 98 additions and 63 deletions
|
@ -12,14 +12,6 @@ void rgblight_sethsv_default_helper(uint8_t index) {
|
|||
#endif // RGBLIGHT_ENABLE
|
||||
|
||||
#ifdef INDICATOR_LIGHTS
|
||||
uint8_t last_mod;
|
||||
uint8_t last_led;
|
||||
uint8_t last_osm;
|
||||
uint8_t current_mod;
|
||||
uint8_t current_led;
|
||||
uint8_t current_osm;
|
||||
|
||||
|
||||
void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) {
|
||||
if (userspace_config.rgb_layer_change && biton32(layer_state) == 0) {
|
||||
if (this_mod & MODS_SHIFT_MASK || this_led & (1<<USB_LED_CAPS_LOCK) || this_osm & MODS_SHIFT_MASK) {
|
||||
|
@ -86,16 +78,7 @@ void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) {
|
|||
}
|
||||
|
||||
void matrix_scan_indicator(void) {
|
||||
current_mod = get_mods();
|
||||
current_led = host_keyboard_leds();
|
||||
current_osm = get_oneshot_mods();
|
||||
|
||||
set_rgb_indicators(current_mod, current_led, current_osm);
|
||||
|
||||
last_mod = current_mod;
|
||||
last_led = current_led;
|
||||
last_osm = current_osm;
|
||||
|
||||
set_rgb_indicators(get_mods(), host_keyboard_leds(), get_oneshot_mods());
|
||||
}
|
||||
#endif //INDICATOR_LIGHTS
|
||||
|
||||
|
@ -255,13 +238,9 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) {
|
|||
|
||||
|
||||
void matrix_init_rgb(void) {
|
||||
#ifdef INDICATOR_LIGHTS
|
||||
current_mod = last_mod = get_mods();
|
||||
current_led = last_led = host_keyboard_leds();
|
||||
current_osm = last_osm = get_oneshot_mods();
|
||||
#endif
|
||||
|
||||
if (userspace_config.rgb_layer_change) {
|
||||
rgblight_init();
|
||||
rgblight_enable_noeeprom();
|
||||
switch (biton32(eeconfig_read_default_layer())) {
|
||||
case _COLEMAK:
|
||||
|
@ -291,6 +270,7 @@ void matrix_scan_rgb(void) {
|
|||
|
||||
uint32_t layer_state_set_rgb(uint32_t state) {
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
static bool has_ran;
|
||||
if (userspace_config.rgb_layer_change) {
|
||||
switch (biton32(state)) {
|
||||
case _MACROS:
|
||||
|
@ -332,7 +312,12 @@ uint32_t layer_state_set_rgb(uint32_t state) {
|
|||
default:
|
||||
rgblight_sethsv_noeeprom_cyan(); break;
|
||||
}
|
||||
biton32(state) == _MODS ? rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING) : rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); // if _MODS layer is on, then breath to denote it
|
||||
if (has_ran) {
|
||||
biton32(state) == _MODS ? rgblight_mode(RGBLIGHT_MODE_BREATHING) : rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); // if _MODS layer is on, then breath to denote it
|
||||
} else {
|
||||
biton32(state) == _MODS ? rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING) : rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); // if _MODS layer is on, then breath to denote it
|
||||
has_ran = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
// layer_state_set_indicator(); // Runs every scan, so need to call this here .... since I can't get it working "right" anyhow
|
||||
|
@ -341,5 +326,3 @@ uint32_t layer_state_set_rgb(uint32_t state) {
|
|||
|
||||
return state;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue