summaryrefslogtreecommitdiffstats
path: root/platforms
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 /platforms
parent928e03e8d669cb35a96c2aa4a09012c527b27892 (diff)
Get rid of `USB_LED_CAPS_LOCK` (#21436)
Diffstat (limited to 'platforms')
-rw-r--r--platforms/avr/sleep_led.c9
-rw-r--r--platforms/chibios/sleep_led.c11
2 files changed, 13 insertions, 7 deletions
diff --git a/platforms/avr/sleep_led.c b/platforms/avr/sleep_led.c
index b05431633b..ad6253be93 100644
--- a/platforms/avr/sleep_led.c
+++ b/platforms/avr/sleep_led.c
@@ -109,16 +109,19 @@ ISR(TIMERx_COMPA_vect) {
uint8_t duration : 2;
uint8_t index : 6;
} pwm;
- } timer = {.row = 0};
+ } timer = {.row = 0};
+ static led_t led_state = {0};
timer.row++;
// LED on
if (timer.pwm.count == 0) {
- led_set(1 << USB_LED_CAPS_LOCK);
+ led_state.caps_lock = true;
+ led_set(led_state.raw);
}
// LED off
if (timer.pwm.count == pgm_read_byte(&breathing_table[timer.pwm.index])) {
- led_set(0);
+ led_state.caps_lock = false;
+ led_set(led_state.raw);
}
}
diff --git a/platforms/chibios/sleep_led.c b/platforms/chibios/sleep_led.c
index a777d60468..a35514bf2e 100644
--- a/platforms/chibios/sleep_led.c
+++ b/platforms/chibios/sleep_led.c
@@ -41,17 +41,20 @@ void sleep_led_timer_callback(void) {
uint8_t duration : 2;
uint8_t index : 6;
} pwm;
- } timer = {.row = 0};
+ } timer = {.row = 0};
+ static led_t led_state = {0};
timer.row++;
// LED on
if (timer.pwm.count == 0) {
- led_set(1 << USB_LED_CAPS_LOCK);
+ led_state.caps_lock = true;
+ led_set(led_state.raw);
}
// LED off
if (timer.pwm.count == breathing_table[timer.pwm.index]) {
- led_set(0);
+ led_state.caps_lock = false;
+ led_set(led_state.raw);
}
}
@@ -190,7 +193,7 @@ void sleep_led_toggle(void) {
void sleep_led_init(void) {}
void sleep_led_enable(void) {
- led_set(1 << USB_LED_CAPS_LOCK);
+ led_set(2); // Caps Lock
}
void sleep_led_disable(void) {