summaryrefslogtreecommitdiffstats
path: root/keyboards/40percentclub
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2023-07-06 18:48:02 +1000
committerGitHub <noreply@github.com>2023-07-06 09:48:02 +0100
commit87b11345a55d076966846d87b60d0f315b8bb984 (patch)
treea64503358d5f30b55a722b882eebaf1b60b03e1f /keyboards/40percentclub
parent928e03e8d669cb35a96c2aa4a09012c527b27892 (diff)
Get rid of `USB_LED_CAPS_LOCK` (#21436)
Diffstat (limited to 'keyboards/40percentclub')
-rw-r--r--keyboards/40percentclub/mf68/keymaps/delivrance/keymap.c7
-rw-r--r--keyboards/40percentclub/mf68/keymaps/emdarcher/keymap.c7
-rw-r--r--keyboards/40percentclub/ut47/led.c31
3 files changed, 24 insertions, 21 deletions
diff --git a/keyboards/40percentclub/mf68/keymaps/delivrance/keymap.c b/keyboards/40percentclub/mf68/keymaps/delivrance/keymap.c
index c3e359e24e..f7899ad886 100644
--- a/keyboards/40percentclub/mf68/keymaps/delivrance/keymap.c
+++ b/keyboards/40percentclub/mf68/keymaps/delivrance/keymap.c
@@ -157,11 +157,11 @@ void dynamic_macro_record_end_user(int8_t direction) {
// Custom Caps Lock backlight behaviour
// ------------------------------------
-void led_set_user(uint8_t usb_led) {
+bool led_update_user(led_t led_state) {
// This exists because I don't like the backlight to turn OFF when the Caps Lock is ON.
// That is, this will turn the backlight ON (at half the brightness) when the Caps Lock is ON as well.
static bool prev_is_caps_on;
- bool is_caps_on = IS_LED_ON(usb_led, USB_LED_CAPS_LOCK);
+ bool is_caps_on = led_state.caps_lock;
if (prev_is_caps_on != is_caps_on) {
prev_is_caps_on = is_caps_on;
@@ -178,7 +178,7 @@ void led_set_user(uint8_t usb_led) {
}
// Turn on the Pro Micro's on-board LEDs for Caps Lock
- if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
+ if (led_state.caps_lock) {
// Set to low
setPinOutput(B0);
writePinLow(B0);
@@ -189,6 +189,7 @@ void led_set_user(uint8_t usb_led) {
setPinInput(B0);
setPinInput(D5);
}
+ return false;
}
// Backlight idle timeout feature
diff --git a/keyboards/40percentclub/mf68/keymaps/emdarcher/keymap.c b/keyboards/40percentclub/mf68/keymaps/emdarcher/keymap.c
index ea659979ea..3932a1ee9b 100644
--- a/keyboards/40percentclub/mf68/keymaps/emdarcher/keymap.c
+++ b/keyboards/40percentclub/mf68/keymaps/emdarcher/keymap.c
@@ -35,11 +35,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
-
-
-void led_set_user(uint8_t usb_led){
+bool led_update_user(led_t led_state){
//turn on the Pro Micro's on board LEDs for CAPS LOCK
- if(IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)){
+ if(led_state.caps_lock){
//set led pins to low
setPinOutput(B0);
writePinLow(B0);
@@ -50,4 +48,5 @@ void led_set_user(uint8_t usb_led){
setPinInput(B0);
setPinInput(D5);
}
+ return false;
}
diff --git a/keyboards/40percentclub/ut47/led.c b/keyboards/40percentclub/ut47/led.c
index f5d8ffc12e..867a6e2e2a 100644
--- a/keyboards/40percentclub/ut47/led.c
+++ b/keyboards/40percentclub/ut47/led.c
@@ -19,20 +19,23 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <stdint.h>
#include "led.h"
-
-void led_set(uint8_t usb_led)
+bool led_update_kb(led_t led_state)
{
- if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
- // output low
- DDRB |= (1<<0);
- PORTB &= ~(1<<0);
- DDRD |= (1<<5);
- PORTD &= ~(1<<5);
- } else {
- // Hi-Z
- DDRB &= ~(1<<0);
- PORTB &= ~(1<<0);
- DDRD &= ~(1<<5);
- PORTD &= ~(1<<5);
+ bool res = led_update_user(led_state);
+ if (res) {
+ if (led_state.caps_lock) {
+ // output low
+ DDRB |= (1<<0);
+ PORTB &= ~(1<<0);
+ DDRD |= (1<<5);
+ PORTD &= ~(1<<5);
+ } else {
+ // Hi-Z
+ DDRB &= ~(1<<0);
+ PORTB &= ~(1<<0);
+ DDRD &= ~(1<<5);
+ PORTD &= ~(1<<5);
+ }
}
+ return false;
}