diff options
Diffstat (limited to 'keyboards')
-rw-r--r-- | keyboards/bpiphany/kitten_paw/keymaps/ickerwx/keymap.c | 8 | ||||
-rw-r--r-- | keyboards/converter/usb_usb/custom_matrix.cpp | 3 | ||||
-rw-r--r-- | keyboards/duck/octagon/v1/v1.c | 10 | ||||
-rw-r--r-- | keyboards/duck/octagon/v2/v2.c | 28 | ||||
-rw-r--r-- | keyboards/duck/tcv3/tcv3.c | 30 | ||||
-rw-r--r-- | keyboards/exclusive/e6v2/oe/oe.c | 41 | ||||
-rw-r--r-- | keyboards/sirius/unigo66/custom_matrix.cpp | 3 |
7 files changed, 60 insertions, 63 deletions
diff --git a/keyboards/bpiphany/kitten_paw/keymaps/ickerwx/keymap.c b/keyboards/bpiphany/kitten_paw/keymaps/ickerwx/keymap.c index 3f858734c9..7d4c53c61f 100644 --- a/keyboards/bpiphany/kitten_paw/keymaps/ickerwx/keymap.c +++ b/keyboards/bpiphany/kitten_paw/keymaps/ickerwx/keymap.c @@ -95,13 +95,13 @@ void matrix_scan_user(void) { current_layer_global = layer; // unset CAPSLOCK and SCROLL LOCK LEDs - led_set_kb(host_keyboard_leds() & ~(1<<USB_LED_CAPS_LOCK)); - led_set_kb(host_keyboard_leds() & ~(1<<USB_LED_SCROLL_LOCK)); + led_set(host_keyboard_leds() & ~(1<<USB_LED_CAPS_LOCK)); + led_set(host_keyboard_leds() & ~(1<<USB_LED_SCROLL_LOCK)); // set SCROLL LOCK LED when the mouse layer is active, CAPS LOCK when PROG layer is active if (layer == MOUSE1 || layer == MOUSE2) { - led_set_kb(host_keyboard_leds() | (1<<USB_LED_SCROLL_LOCK)); + led_set(host_keyboard_leds() | (1<<USB_LED_SCROLL_LOCK)); } else if (layer == PROG1 || layer == PROG2) { - led_set_kb(host_keyboard_leds() | (1<<USB_LED_CAPS_LOCK)); + led_set(host_keyboard_leds() | (1<<USB_LED_CAPS_LOCK)); } } } diff --git a/keyboards/converter/usb_usb/custom_matrix.cpp b/keyboards/converter/usb_usb/custom_matrix.cpp index a92feeb6c1..1463f27b86 100644 --- a/keyboards/converter/usb_usb/custom_matrix.cpp +++ b/keyboards/converter/usb_usb/custom_matrix.cpp @@ -233,6 +233,7 @@ extern "C" { if (kbd2.isReady()) kbd2.SetReport(0, 0, 2, 0, 1, &usb_led); if (kbd3.isReady()) kbd3.SetReport(0, 0, 2, 0, 1, &usb_led); if (kbd4.isReady()) kbd4.SetReport(0, 0, 2, 0, 1, &usb_led); - led_set_kb(usb_led); + led_set_user(usb_led); + led_update_kb((led_t)usb_led) } } 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 diff --git a/keyboards/exclusive/e6v2/oe/oe.c b/keyboards/exclusive/e6v2/oe/oe.c index 3c6627894f..2570bc101a 100644 --- a/keyboards/exclusive/e6v2/oe/oe.c +++ b/keyboards/exclusive/e6v2/oe/oe.c @@ -1,32 +1,15 @@ #include "oe.h" -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - DDRB |= (1<<6); - if (usb_led & (1<<USB_LED_CAPS_LOCK)) { - // output low - DDRB |= (1<<2); - PORTB &= ~(1<<2); - } else { - // Hi-Z - DDRB &= ~(1<<2); - PORTB &= ~(1<<2); - } - // DDRB |= (1<<7); - // DDRB |= (1<<1); - // DDRB |= (1<<3); - // DDRE |= (1<<6); - if (usb_led == 0){ - PORTB |= (1<<6); - // PORTB |= (1<<7); - // PORTB |= (1<<1); - // PORTB |= (1<<3); - // PORTE |= (1<<6); - } - else{ - PORTB &= ~(1<<6); - // PORTB &= ~(1<<7); - } - - led_set_user(usb_led); +void led_init_ports(void) { + setPinOutput(B2); + setPinOutput(B6); +} + +bool led_update_kb(led_t led_state) { + bool res = led_update_user(led_state); + if(res) { + writePin(B2, !led_state.caps_lock); + writePin(B6, led_state == 0); + } + return res; } diff --git a/keyboards/sirius/unigo66/custom_matrix.cpp b/keyboards/sirius/unigo66/custom_matrix.cpp index 72e120400f..a399312b7d 100644 --- a/keyboards/sirius/unigo66/custom_matrix.cpp +++ b/keyboards/sirius/unigo66/custom_matrix.cpp @@ -220,7 +220,8 @@ extern "C" kbd2.SetReport(0, 0, 2, 0, 1, &usb_led); kbd3.SetReport(0, 0, 2, 0, 1, &usb_led); kbd4.SetReport(0, 0, 2, 0, 1, &usb_led); - led_set_kb(usb_led); + led_set_user(usb_led); + led_update_kb((led_t)usb_led) } }; |