Adds caps lock led status on Moonlander/Ergodox (#332)

* feat: adds caps lock led status on Moonlander/Ergodox

* fix: botched source file

* fix: light up the most right leds
This commit is contained in:
Florian Didron
2021-03-18 10:07:50 +09:00
committed by GitHub
parent 1b29979433
commit 53d1cfb705
2 changed files with 27 additions and 1 deletions

View File

@@ -470,5 +470,18 @@ void matrix_scan_kb(void) {
}
#endif
#ifdef CAPS_LOCK_STATUS
led_t led_state = host_keyboard_led_state();
if(led_state.caps_lock) {
ergodox_right_led_3_on();
}
else {
uint8_t layer = get_highest_layer(layer_state);
if(layer != 1) {
ergodox_right_led_3_off();
}
}
#endif
matrix_scan_user();
}

View File

@@ -128,7 +128,20 @@ void moonlander_led_task(void) {
wait_ms(150);
}
#endif
#ifdef CAPS_LOCK_STATUS
else {
led_t led_state = host_keyboard_led_state();
if(led_state.caps_lock) {
ML_LED_6(true);
}
else {
uint8_t layer = get_highest_layer(layer_state);
if(layer != 1) {
ML_LED_6(false);
}
}
}
#endif
}
static THD_WORKING_AREA(waLEDThread, 128);