Get rid of USB_LED_SCROLL_LOCK
(#21405)
This commit is contained in:
parent
9dbad1fa5c
commit
7ff80a57cb
62 changed files with 399 additions and 479 deletions
|
@ -253,12 +253,7 @@ void matrix_scan_user(void) {
|
|||
};
|
||||
|
||||
// The state of the LEDs requested by the system, as a bitmask.
|
||||
static uint8_t sys_led_state = 0;
|
||||
|
||||
// Use these masks to read the system LEDs state.
|
||||
static const uint8_t sys_led_mask_num_lock = 1 << USB_LED_NUM_LOCK;
|
||||
static const uint8_t sys_led_mask_caps_lock = 1 << USB_LED_CAPS_LOCK;
|
||||
static const uint8_t sys_led_mask_scroll_lock = 1 << USB_LED_SCROLL_LOCK;
|
||||
static led_t sys_led_state = {0};
|
||||
|
||||
// Value to use to switch LEDs on. The default value of 255 is far too bright.
|
||||
static const uint8_t max_led_value = 20;
|
||||
|
@ -294,25 +289,26 @@ void led_3_off(void) {
|
|||
}
|
||||
|
||||
// Called when the computer wants to change the state of the keyboard LEDs.
|
||||
void led_set_user(uint8_t usb_led) {
|
||||
sys_led_state = usb_led;
|
||||
bool led_update_user(led_t led_state) {
|
||||
sys_led_state = led_state;
|
||||
if (LAYER_ON(SYSLEDS)) {
|
||||
if (sys_led_state & sys_led_mask_caps_lock) {
|
||||
if (sys_led_state.caps_lock) {
|
||||
led_1_on();
|
||||
} else {
|
||||
led_1_off();
|
||||
}
|
||||
if (sys_led_state & sys_led_mask_num_lock) {
|
||||
if (sys_led_state.num_lock) {
|
||||
led_2_on();
|
||||
} else {
|
||||
led_2_off();
|
||||
}
|
||||
if (sys_led_state & sys_led_mask_scroll_lock) {
|
||||
if (sys_led_state.scroll_lock) {
|
||||
led_3_on();
|
||||
} else {
|
||||
led_3_off();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
|
@ -327,7 +323,7 @@ layer_state_t layer_state_set_user(layer_state_t state) {
|
|||
}
|
||||
|
||||
if (LAYER_ON(SYSLEDS)) {
|
||||
led_set_user(sys_led_state);
|
||||
led_update_user(sys_led_state);
|
||||
return state;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue