summaryrefslogtreecommitdiff
path: root/keyboards/duck
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2022-12-14 11:14:10 +0000
committerGitHub <noreply@github.com>2022-12-14 11:14:10 +0000
commit1124bbc1db8fb26418bded7016c702de469b162f (patch)
tree6486fdf3ddcd39355af2a94b8998e57dc1d239cc /keyboards/duck
parent0fcf481cdd2a350b628462201b0a725df6c72b2b (diff)
Remove deprecated led_set_kb (#19273)
* Remove led_set_kb maintaining existing led_set_user behaviour * Also call led_set_user
Diffstat (limited to 'keyboards/duck')
-rw-r--r--keyboards/duck/octagon/v1/v1.c10
-rw-r--r--keyboards/duck/octagon/v2/v2.c28
-rw-r--r--keyboards/duck/tcv3/tcv3.c30
3 files changed, 40 insertions, 28 deletions
diff --git a/keyboards/duck/octagon/v1/v1.c b/keyboards/duck/octagon/v1/v1.c
index e9e88c70d0..575847f588 100644
--- a/keyboards/duck/octagon/v1/v1.c
+++ b/keyboards/duck/octagon/v1/v1.c
@@ -40,7 +40,11 @@ void backlight_set(uint8_t level) {
level & BACKLIGHT_RGBBLUE ? (PORTD |= 0b00010000) : (PORTD &= ~0b00010000);
}
-void led_set_kb(uint8_t usb_led) {
- backlight_os_state & (1<<USB_LED_CAPS_LOCK) ? (PORTB &= ~0b00000001) : (PORTB |= 0b00000001);
- backlight_os_state & (1<<USB_LED_SCROLL_LOCK) ? (PORTB &= ~0b00010000) : (PORTB |= 0b00010000);
+bool led_update_kb(led_t led_state) {
+ bool res = led_update_user(led_state);
+ if(res) {
+ backlight_os_state & (1<<USB_LED_CAPS_LOCK) ? (PORTB &= ~0b00000001) : (PORTB |= 0b00000001);
+ backlight_os_state & (1<<USB_LED_SCROLL_LOCK) ? (PORTB &= ~0b00010000) : (PORTB |= 0b00010000);
+ }
+ return res;
}
diff --git a/keyboards/duck/octagon/v2/v2.c b/keyboards/duck/octagon/v2/v2.c
index 23e92b2769..19bef7f877 100644
--- a/keyboards/duck/octagon/v2/v2.c
+++ b/keyboards/duck/octagon/v2/v2.c
@@ -97,17 +97,21 @@ 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[7] = {
- backlight_os_state & (1<<USB_LED_CAPS_LOCK),
- backlight_os_state & (1<<USB_LED_SCROLL_LOCK),
- backlight_os_state & (1<<USB_LED_NUM_LOCK),
- backlight_layer_state & (1<<1),
- backlight_layer_state & (1<<2),
- backlight_layer_state & (1<<3),
- backlight_layer_state & (1<<4)
- };
- indicator_leds_set(status);
- backlight_os_state & (1<<USB_LED_CAPS_LOCK) ? (PORTB &= ~0b00000001) : (PORTB |= 0b00000001);
- backlight_os_state & (1<<USB_LED_SCROLL_LOCK) ? (PORTB &= ~0b00010000) : (PORTB |= 0b00010000);
+ backlight_os_state & (1<<USB_LED_CAPS_LOCK),
+ backlight_os_state & (1<<USB_LED_SCROLL_LOCK),
+ backlight_os_state & (1<<USB_LED_NUM_LOCK),
+ backlight_layer_state & (1<<1),
+ backlight_layer_state & (1<<2),
+ backlight_layer_state & (1<<3),
+ backlight_layer_state & (1<<4)
+ };
+ indicator_leds_set(status);
+ backlight_os_state & (1<<USB_LED_CAPS_LOCK) ? (PORTB &= ~0b00000001) : (PORTB |= 0b00000001);
+ backlight_os_state & (1<<USB_LED_SCROLL_LOCK) ? (PORTB &= ~0b00010000) : (PORTB |= 0b00010000);
+ }
+ return res;
}
diff --git a/keyboards/duck/tcv3/tcv3.c b/keyboards/duck/tcv3/tcv3.c
index 4d52d22c11..805d2b75d5 100644
--- a/keyboards/duck/tcv3/tcv3.c
+++ b/keyboards/duck/tcv3/tcv3.c
@@ -100,19 +100,23 @@ void backlight_set(uint8_t level) {
}
// // Port from backlight_update_state
-// void led_set_kb(uint8_t usb_led) {
-// bool status[7] = {
-// backlight_os_state & (1<<USB_LED_CAPS_LOCK),
-// backlight_os_state & (1<<USB_LED_SCROLL_LOCK),
-// backlight_os_state & (1<<USB_LED_NUM_LOCK),
-// backlight_layer_state & (1<<1),
-// backlight_layer_state & (1<<2),
-// backlight_layer_state & (1<<3),
-// backlight_layer_state & (1<<4)
-// };
-// indicator_leds_set(status);
-// backlight_os_state & (1<<USB_LED_CAPS_LOCK) ? (PORTB &= ~0b00000001) : (PORTB |= 0b00000001);
-// backlight_os_state & (1<<USB_LED_SCROLL_LOCK) ? (PORTB &= ~0b00010000) : (PORTB |= 0b00010000);
+// bool led_update_kb(led_t led_state) {
+// bool res = led_update_user(led_state);
+// if(res) {
+// bool status[7] = {
+// backlight_os_state & (1<<USB_LED_CAPS_LOCK),
+// backlight_os_state & (1<<USB_LED_SCROLL_LOCK),
+// backlight_os_state & (1<<USB_LED_NUM_LOCK),
+// backlight_layer_state & (1<<1),
+// backlight_layer_state & (1<<2),
+// backlight_layer_state & (1<<3),
+// backlight_layer_state & (1<<4)
+// };
+// indicator_leds_set(status);
+// backlight_os_state & (1<<USB_LED_CAPS_LOCK) ? (PORTB &= ~0b00000001) : (PORTB |= 0b00000001);
+// backlight_os_state & (1<<USB_LED_SCROLL_LOCK) ? (PORTB &= ~0b00010000) : (PORTB |= 0b00010000);
+// }
+// return res;
// }
// U5 Pin 1, 2, 3 connected to top left LEDs