aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMechMerlin <30334081+mechmerlin@users.noreply.github.com>2018-07-29 15:18:45 -0700
committerDrashna Jaelre <drashna@live.com>2018-07-29 15:18:45 -0700
commit841ea7ceb64648b14b44909745b13e127327be15 (patch)
tree7e7db9a916953a3f5b5340bd7e49a071331c162e
parent54517f8b344580c49a1ce71c319c5c9e858c263b (diff)
downloadqmk_firmware-841ea7ceb64648b14b44909745b13e127327be15.tar.gz
qmk_firmware-841ea7ceb64648b14b44909745b13e127327be15.zip
Keyboard: Add caps lock led support to DZ60 (#3506)
* 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
-rw-r--r--keyboards/dz60/dz60.c12
-rw-r--r--keyboards/dz60/keymaps/default/keymap.c8
-rw-r--r--keyboards/dz60/keymaps/iso_uk/keymap.c8
-rw-r--r--keyboards/dz60/keymaps/krusli/keymap.c8
4 files changed, 9 insertions, 27 deletions
diff --git a/keyboards/dz60/dz60.c b/keyboards/dz60/dz60.c
index 33122846c..b54ff0117 100644
--- a/keyboards/dz60/dz60.c
+++ b/keyboards/dz60/dz60.c
@@ -22,7 +22,13 @@ void led_init_ports(void) {
22} 22}
23 23
24void led_set_kb(uint8_t usb_led) { 24void led_set_kb(uint8_t usb_led) {
25 // Code for caps lock LED as reported by the OS 25 if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
26 // Set this per keymap, instead of globally 26 DDRB |= (1 << 2);
27 led_set_user(usb_led); 27 PORTB &= ~(1 << 2);
28 } else {
29 DDRB &= ~(1 << 2);
30 PORTB &= ~(1 << 2);
31 }
32
33 led_set_user(usb_led);
28} 34}
diff --git a/keyboards/dz60/keymaps/default/keymap.c b/keyboards/dz60/keymaps/default/keymap.c
index fdc2795d2..426b10989 100644
--- a/keyboards/dz60/keymaps/default/keymap.c
+++ b/keyboards/dz60/keymaps/default/keymap.c
@@ -59,11 +59,3 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
59 break; 59 break;
60 } 60 }
61} 61}
62
63void led_set_user(uint8_t usb_led) {
64 if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
65 DDRB |= (1 << 2); PORTB &= ~(1 << 2);
66 } else {
67 DDRB &= ~(1 << 2); PORTB &= ~(1 << 2);
68 }
69}
diff --git a/keyboards/dz60/keymaps/iso_uk/keymap.c b/keyboards/dz60/keymaps/iso_uk/keymap.c
index de06d2352..1c15a59df 100644
--- a/keyboards/dz60/keymaps/iso_uk/keymap.c
+++ b/keyboards/dz60/keymaps/iso_uk/keymap.c
@@ -84,11 +84,3 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
84 break; 84 break;
85 } 85 }
86} 86}
87
88void led_set_user(uint8_t usb_led) {
89 if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
90 DDRB |= (1 << 2); PORTB &= ~(1 << 2);
91 } else {
92 DDRB &= ~(1 << 2); PORTB &= ~(1 << 2);
93 }
94}
diff --git a/keyboards/dz60/keymaps/krusli/keymap.c b/keyboards/dz60/keymaps/krusli/keymap.c
index c79cb7f91..36e7b801a 100644
--- a/keyboards/dz60/keymaps/krusli/keymap.c
+++ b/keyboards/dz60/keymaps/krusli/keymap.c
@@ -19,11 +19,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19 _______, KC_NO, _______, _______, _______, _______, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, 19 _______, KC_NO, _______, _______, _______, _______, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______,
20 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) 20 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______)
21}; 21};
22
23void led_set_user(uint8_t usb_led) {
24 if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
25 DDRB |= (1 << 2); PORTB &= ~(1 << 2);
26 } else {
27 DDRB &= ~(1 << 2); PORTB &= ~(1 << 2);
28 }
29}