summaryrefslogtreecommitdiff
path: root/keyboards/maartenwut
diff options
context:
space:
mode:
authorfauxpark <fauxpark@gmail.com>2019-11-06 11:42:16 +1100
committerJoel Challis <git@zvecr.com>2019-11-06 00:42:16 +0000
commitdfb78d2a086daa2ceb3fd043afce03785abfa23a (patch)
tree7cd724b1cd12a65025bbc9d3cb32d7dd39cb9928 /keyboards/maartenwut
parented0575fc8aacdfdd83a31fc98df2b1cad2e977f4 (diff)
downloadqmk_firmware-dfb78d2a086daa2ceb3fd043afce03785abfa23a.tar.gz
qmk_firmware-dfb78d2a086daa2ceb3fd043afce03785abfa23a.zip
New and improved lock LED callbacks (#7215)
* New and improved lock LED callbacks * Include stdbool * Update documentation * Use full function signatures and add keyboard-level example
Diffstat (limited to 'keyboards/maartenwut')
-rw-r--r--keyboards/maartenwut/wasdat/wasdat.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/keyboards/maartenwut/wasdat/wasdat.c b/keyboards/maartenwut/wasdat/wasdat.c
index 11338634d4..99dd97dcfa 100644
--- a/keyboards/maartenwut/wasdat/wasdat.c
+++ b/keyboards/maartenwut/wasdat/wasdat.c
@@ -33,26 +33,12 @@ void led_init_ports(void) {
setPinOutput(B2);
}
-void led_set_kb(uint8_t usb_led) {
- // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
-
- if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
- writePinLow(B0);
- } else {
- writePinHigh(B0);
- }
-
- if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) {
- writePinLow(B1);
- } else {
- writePinHigh(B1);
- }
-
- if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) {
- writePinLow(B2);
- } else {
- writePinHigh(B2);
+bool led_update_kb(led_t led_state) {
+ if(led_update_user(led_state)) {
+ writePin(B0, !led_state.caps_lock);
+ writePin(B1, !led_state.scroll_lock);
+ writePin(B2, !led_state.num_lock);
}
- led_set_user(usb_led);
+ return true;
}