]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Keyboard: Add caps lock led support to DZ60 (#3506)
authorMechMerlin <30334081+mechmerlin@users.noreply.github.com>
Sun, 29 Jul 2018 22:18:45 +0000 (15:18 -0700)
committerDrashna Jaelre <drashna@live.com>
Sun, 29 Jul 2018 22:18:45 +0000 (15:18 -0700)
* add caps lock led support to DZ60

* changes from drashna's code review comments

* call led_set_user at the end of led_set_kb

keyboards/dz60/dz60.c
keyboards/dz60/keymaps/default/keymap.c
keyboards/dz60/keymaps/iso_uk/keymap.c
keyboards/dz60/keymaps/krusli/keymap.c

index 33122846c9f9bc765cde2b73cbc8f8e43784d007..b54ff0117034e62353e6d4758995b8a2926cd397 100644 (file)
@@ -22,7 +22,13 @@ void led_init_ports(void) {
 }
 
 void led_set_kb(uint8_t usb_led) {
-  // Code for caps lock LED as reported by the OS
-  // Set this per keymap, instead of globally
-  led_set_user(usb_led);
+    if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
+        DDRB |= (1 << 2);
+        PORTB &= ~(1 << 2);
+    } else {
+        DDRB &= ~(1 << 2);
+        PORTB &= ~(1 << 2);
+    }
+
+    led_set_user(usb_led);
 }
index fdc2795d24564bdf532b8ffc3f848774cc2c8e43..426b10989d23390049cbb179a72dcbc8de23df42 100644 (file)
@@ -59,11 +59,3 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
       break;
   }
 }
-
-void led_set_user(uint8_t usb_led) {
-    if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
-        DDRB |= (1 << 2); PORTB &= ~(1 << 2);
-    } else {
-        DDRB &= ~(1 << 2); PORTB &= ~(1 << 2);
-    }
-}
index de06d23521b3ecfe1a25d1d3340086160d3d7bdd..1c15a59df8ccc6ca35bb45ae2dec995099e46ed3 100644 (file)
@@ -84,11 +84,3 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
       break;
   }
 }
-
-void led_set_user(uint8_t usb_led) {
-    if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
-        DDRB |= (1 << 2); PORTB &= ~(1 << 2);
-    } else {
-        DDRB &= ~(1 << 2); PORTB &= ~(1 << 2);
-    }
-}
index c79cb7f9101c00d3fe0619c27fcf49b19d7f7040..36e7b801a390dbdfdffaea8767e03827d4b95884 100644 (file)
@@ -19,11 +19,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
                _______, KC_NO,         _______, _______, _______, _______, _______, KC_PPLS, KC_PMNS, KC_END,  KC_PGDN, KC_DOWN, _______, _______,
                _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______)
 };
-
-void led_set_user(uint8_t usb_led) {
-    if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
-        DDRB |= (1 << 2); PORTB &= ~(1 << 2);
-    } else {
-        DDRB &= ~(1 << 2); PORTB &= ~(1 << 2);
-    }
-}