From 99cd0b13e109bb14f1e5af023c5fcb5e50a78e0a Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Fri, 9 Dec 2022 01:42:22 +0000 Subject: Refactor some led_set_kb instances (#19179) * Refactor some led_set_kb instances * Apply suggestions from code review Co-authored-by: Ryan Co-authored-by: Ryan --- keyboards/duck/eagle_viper/v2/v2.c | 27 ++++++++++++----------- keyboards/duck/jetfire/jetfire.c | 39 ++++++++++++++++++---------------- keyboards/duck/lightsaver/lightsaver.c | 32 +++++++++++++++------------- 3 files changed, 53 insertions(+), 45 deletions(-) (limited to 'keyboards/duck') diff --git a/keyboards/duck/eagle_viper/v2/v2.c b/keyboards/duck/eagle_viper/v2/v2.c index d3e1368de9..e7ce5d4749 100644 --- a/keyboards/duck/eagle_viper/v2/v2.c +++ b/keyboards/duck/eagle_viper/v2/v2.c @@ -42,20 +42,23 @@ void backlight_set(uint8_t level) { } } -// Port from backlight_update_state -void led_set_kb(uint8_t usb_led) { +bool led_update_kb(led_t led_state) { + bool res = led_update_user(led_state); + if(res) { bool status[8] = { - host_keyboard_leds() & (1<