summaryrefslogtreecommitdiff
path: root/keyboards/handwired/retro_refit
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2022-12-09 01:42:22 +0000
committerGitHub <noreply@github.com>2022-12-09 01:42:22 +0000
commit99cd0b13e109bb14f1e5af023c5fcb5e50a78e0a (patch)
treef6b3198bca1321fb9f4b8c0903d87869a8816630 /keyboards/handwired/retro_refit
parentba6ee2904066aa64fa83417dc865f24dc76d991b (diff)
Refactor some led_set_kb instances (#19179)
* Refactor some led_set_kb instances * Apply suggestions from code review Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'keyboards/handwired/retro_refit')
-rw-r--r--keyboards/handwired/retro_refit/retro_refit.c39
1 files changed, 8 insertions, 31 deletions
diff --git a/keyboards/handwired/retro_refit/retro_refit.c b/keyboards/handwired/retro_refit/retro_refit.c
index 3d610eba34..2a5476e40c 100644
--- a/keyboards/handwired/retro_refit/retro_refit.c
+++ b/keyboards/handwired/retro_refit/retro_refit.c
@@ -12,36 +12,13 @@ void matrix_init_kb(void) {
matrix_init_user();
};
-void led_set_kb(uint8_t usb_led) {
- // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
+bool led_update_kb(led_t led_state) {
+ bool res = led_update_user(led_state);
+ if(res) {
+ writePin(D0, !led_state.caps_lock);
+ writePin(D1, !led_state.num_lock);
+ writePin(C6, !led_state.scroll_lock);
- if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
- // output low
- DDRD |= (1<<0);
- PORTD &= ~(1<<0);
- } else {
- // Hi-Z
- DDRD &= ~(1<<0);
- PORTD &= ~(1<<0);
}
- if (usb_led & (1<<USB_LED_NUM_LOCK)) {
- // output low
- DDRD |= (1<<1);
- PORTD &= ~(1<<1);
- } else {
- // Hi-Z
- DDRD &= ~(1<<1);
- PORTD &= ~(1<<1);
- }
- if (usb_led & (1<<USB_LED_SCROLL_LOCK)) {
- // output low
- DDRC |= (1<<6);
- PORTC &= ~(1<<6);
- } else {
- // Hi-Z
- DDRC &= ~(1<<6);
- PORTC &= ~(1<<6);
- }
-
- led_set_user(usb_led);
-}; \ No newline at end of file
+ return res;
+} \ No newline at end of file