summaryrefslogtreecommitdiff
path: root/keyboards/dumbpad
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2022-12-09 01:42:22 +0000
committerGitHub <noreply@github.com>2022-12-09 01:42:22 +0000
commit99cd0b13e109bb14f1e5af023c5fcb5e50a78e0a (patch)
treef6b3198bca1321fb9f4b8c0903d87869a8816630 /keyboards/dumbpad
parentba6ee2904066aa64fa83417dc865f24dc76d991b (diff)
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>
Diffstat (limited to 'keyboards/dumbpad')
-rw-r--r--keyboards/dumbpad/v1x/v1x.c10
-rw-r--r--keyboards/dumbpad/v1x_dualencoder/v1x_dualencoder.c10
-rw-r--r--keyboards/dumbpad/v1x_right/v1x_right.c10
3 files changed, 18 insertions, 12 deletions
diff --git a/keyboards/dumbpad/v1x/v1x.c b/keyboards/dumbpad/v1x/v1x.c
index 0adef0f610..4f4df5ece2 100644
--- a/keyboards/dumbpad/v1x/v1x.c
+++ b/keyboards/dumbpad/v1x/v1x.c
@@ -62,8 +62,10 @@ void matrix_init_kb(void) {
matrix_init_user();
}
-void led_set_kb(uint8_t usb_led) {
- // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
- writePin(LED_02, !IS_LED_ON(usb_led, USB_LED_NUM_LOCK));
- led_set_user(usb_led);
+bool led_update_kb(led_t led_state) {
+ bool res = led_update_user(led_state);
+ if(res) {
+ writePin(LED_02, !led_state.num_lock);
+ }
+ return res;
}
diff --git a/keyboards/dumbpad/v1x_dualencoder/v1x_dualencoder.c b/keyboards/dumbpad/v1x_dualencoder/v1x_dualencoder.c
index 4ea402d805..a727a257b2 100644
--- a/keyboards/dumbpad/v1x_dualencoder/v1x_dualencoder.c
+++ b/keyboards/dumbpad/v1x_dualencoder/v1x_dualencoder.c
@@ -62,8 +62,10 @@ void matrix_init_kb(void) {
matrix_init_user();
}
-void led_set_kb(uint8_t usb_led) {
- // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
- writePin(LED_02, !IS_LED_ON(usb_led, USB_LED_NUM_LOCK));
- led_set_user(usb_led);
+bool led_update_kb(led_t led_state) {
+ bool res = led_update_user(led_state);
+ if(res) {
+ writePin(LED_02, !led_state.num_lock);
+ }
+ return res;
}
diff --git a/keyboards/dumbpad/v1x_right/v1x_right.c b/keyboards/dumbpad/v1x_right/v1x_right.c
index c2adbaebed..b0b3f473df 100644
--- a/keyboards/dumbpad/v1x_right/v1x_right.c
+++ b/keyboards/dumbpad/v1x_right/v1x_right.c
@@ -62,8 +62,10 @@ void matrix_init_kb(void) {
matrix_init_user();
}
-void led_set_kb(uint8_t usb_led) {
- // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
- writePin(LED_02, !IS_LED_ON(usb_led, USB_LED_NUM_LOCK));
- led_set_user(usb_led);
+bool led_update_kb(led_t led_state) {
+ bool res = led_update_user(led_state);
+ if(res) {
+ writePin(LED_02, !led_state.num_lock);
+ }
+ return res;
}