Refactor some led_set_kb instances (#19179)
* Refactor some led_set_kb instances * Apply suggestions from code review Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: Ryan <fauxpark@gmail.com>
This commit is contained in:
@@ -128,15 +128,17 @@ void reset_keyboard_kb(){
|
||||
reset_keyboard();
|
||||
}
|
||||
|
||||
void led_set_kb(uint8_t usb_led)
|
||||
{
|
||||
// Set capslock LED to Blue
|
||||
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
|
||||
set_rgb(31, 0x00, 0x00, 0x7F);
|
||||
}else{
|
||||
set_rgb(31, 0x00, 0x00, 0x00);
|
||||
bool led_update_kb(led_t led_state) {
|
||||
bool res = led_update_user(led_state);
|
||||
if(res) {
|
||||
// Set capslock LED to Blue
|
||||
if (led_state.caps_lock) {
|
||||
set_rgb(31, 0x00, 0x00, 0x7F);
|
||||
} else{
|
||||
set_rgb(31, 0x00, 0x00, 0x00);
|
||||
}
|
||||
}
|
||||
led_set_user(usb_led);
|
||||
return res;
|
||||
}
|
||||
|
||||
// Lighting info, see lighting.h for details
|
||||
|
Reference in New Issue
Block a user