From a2176f6a039b5f92ba4cb473f7a2de560b57dd86 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Tue, 25 Jun 2024 03:25:05 +0100 Subject: [PATCH] Migrate `led_update_kb` implementations to DD (#23985) --- keyboards/bear_face/info.json | 3 ++ keyboards/bear_face/v1/v1.c | 34 ---------------- keyboards/bear_face/v2/v2.c | 34 ---------------- keyboards/dztech/bocc/bocc.c | 29 -------------- keyboards/dztech/bocc/keyboard.json | 4 ++ keyboards/evyd13/gh80_3700/gh80_3700.c | 14 ++----- keyboards/evyd13/gh80_3700/keyboard.json | 4 ++ keyboards/exclusive/e85/hotswap/hotswap.c | 32 --------------- keyboards/exclusive/e85/hotswap/keyboard.json | 4 ++ keyboards/fjlabs/bolsa65/bolsa65.c | 28 ------------- keyboards/fjlabs/bolsa65/keyboard.json | 3 ++ keyboards/flx/virgo/keyboard.json | 5 +++ keyboards/flx/virgo/virgo.c | 34 ---------------- keyboards/handwired/colorlice/colorlice.c | 15 ------- keyboards/handwired/colorlice/keyboard.json | 6 +++ keyboards/handwired/evk/v1_3/v1_3.c | 9 ----- keyboards/handwired/retro_refit/keyboard.json | 6 +++ keyboards/handwired/retro_refit/retro_refit.c | 12 ------ keyboards/handwired/selene/keyboard.json | 5 +++ keyboards/handwired/selene/selene.c | 18 +-------- keyboards/handwired/selene/selene.h | 23 ----------- keyboards/handwired/z150/config.h | 38 ------------------ keyboards/handwired/z150/keyboard.json | 6 +++ keyboards/handwired/z150/z150.c | 39 ------------------- keyboards/kabedon/kabedon980/kabedon980.c | 8 ---- keyboards/kabedon/kabedon980/keyboard.json | 4 ++ keyboards/noxary/x268/keyboard.json | 3 ++ keyboards/noxary/x268/x268.c | 34 ---------------- keyboards/punk75/config.h | 20 ---------- keyboards/punk75/keyboard.json | 4 ++ keyboards/punk75/keymaps/default/keymap.c | 2 +- keyboards/punk75/keymaps/via/keymap.c | 2 +- keyboards/punk75/punk75.c | 32 --------------- keyboards/redscarf_i/keyboard.json | 4 ++ keyboards/redscarf_i/redscarf_i.c | 10 +---- keyboards/sneakbox/aliceclone/aliceclone.c | 36 ----------------- keyboards/sneakbox/aliceclone/keyboard.json | 5 +++ .../yiancardesigns/barleycorn/barleycorn.c | 37 ------------------ .../yiancardesigns/barleycorn/keyboard.json | 4 ++ 39 files changed, 77 insertions(+), 533 deletions(-) delete mode 100644 keyboards/bear_face/v1/v1.c delete mode 100644 keyboards/bear_face/v2/v2.c delete mode 100644 keyboards/dztech/bocc/bocc.c delete mode 100644 keyboards/exclusive/e85/hotswap/hotswap.c delete mode 100644 keyboards/fjlabs/bolsa65/bolsa65.c delete mode 100644 keyboards/flx/virgo/virgo.c delete mode 100644 keyboards/handwired/selene/selene.h delete mode 100644 keyboards/handwired/z150/config.h delete mode 100644 keyboards/handwired/z150/z150.c delete mode 100644 keyboards/kabedon/kabedon980/kabedon980.c delete mode 100644 keyboards/noxary/x268/x268.c delete mode 100644 keyboards/punk75/config.h delete mode 100644 keyboards/punk75/punk75.c delete mode 100644 keyboards/sneakbox/aliceclone/aliceclone.c delete mode 100644 keyboards/yiancardesigns/barleycorn/barleycorn.c diff --git a/keyboards/bear_face/info.json b/keyboards/bear_face/info.json index ad12468d56..ad5b1dd7d9 100644 --- a/keyboards/bear_face/info.json +++ b/keyboards/bear_face/info.json @@ -24,6 +24,9 @@ "resync": true } }, + "indicators": { + "caps_lock": "F7" + }, "matrix_pins": { "cols": ["B5", "C7", "C6", "F0", "E6", "B7", "D0", "D1", "D2", "D3", "D5", "D4", "D6", "D7", "B4"], "rows": ["F5", "F6", "F4", "F1", "B0", "B6"] diff --git a/keyboards/bear_face/v1/v1.c b/keyboards/bear_face/v1/v1.c deleted file mode 100644 index b64a63f0b4..0000000000 --- a/keyboards/bear_face/v1/v1.c +++ /dev/null @@ -1,34 +0,0 @@ -/* -Copyright 2020 chemicalwill - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "quantum.h" - -void keyboard_pre_init_kb(void) { - //Sets LED pin as output - gpio_set_pin_output(F7); - - keyboard_pre_init_user(); -} - -bool led_update_kb(led_t led_state) { - // Caps Lock LED indicator toggling code here - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(F7, led_state.caps_lock); - } - return res; -} diff --git a/keyboards/bear_face/v2/v2.c b/keyboards/bear_face/v2/v2.c deleted file mode 100644 index b64a63f0b4..0000000000 --- a/keyboards/bear_face/v2/v2.c +++ /dev/null @@ -1,34 +0,0 @@ -/* -Copyright 2020 chemicalwill - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "quantum.h" - -void keyboard_pre_init_kb(void) { - //Sets LED pin as output - gpio_set_pin_output(F7); - - keyboard_pre_init_user(); -} - -bool led_update_kb(led_t led_state) { - // Caps Lock LED indicator toggling code here - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(F7, led_state.caps_lock); - } - return res; -} diff --git a/keyboards/dztech/bocc/bocc.c b/keyboards/dztech/bocc/bocc.c deleted file mode 100644 index 646a7861f8..0000000000 --- a/keyboards/dztech/bocc/bocc.c +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright 2020 dztech - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" - -void matrix_init_kb(void) { - gpio_set_pin_output(E6); - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(E6, !led_state.caps_lock); - } - return res; -} diff --git a/keyboards/dztech/bocc/keyboard.json b/keyboards/dztech/bocc/keyboard.json index 7e40fde49c..a6208b2bf7 100644 --- a/keyboards/dztech/bocc/keyboard.json +++ b/keyboards/dztech/bocc/keyboard.json @@ -33,6 +33,10 @@ "pin": "B7", "levels": 5 }, + "indicators": { + "caps_lock": "E6", + "on_state": 0 + }, "rgblight": { "saturation_steps": 8, "brightness_steps": 8, diff --git a/keyboards/evyd13/gh80_3700/gh80_3700.c b/keyboards/evyd13/gh80_3700/gh80_3700.c index 6d903e48e1..8c4c81fe64 100644 --- a/keyboards/evyd13/gh80_3700/gh80_3700.c +++ b/keyboards/evyd13/gh80_3700/gh80_3700.c @@ -15,24 +15,16 @@ */ #include "quantum.h" -void led_init_ports(void) { - gpio_set_pin_output(E6); +void keyboard_pre_init_kb(void) { gpio_set_pin_output(B1); gpio_set_pin_output(D0); gpio_set_pin_output(D1); gpio_set_pin_output(F0); - gpio_write_pin_high(E6); gpio_write_pin_high(B1); gpio_write_pin_high(D0); gpio_write_pin_high(D1); gpio_write_pin_high(F0); + + keyboard_pre_init_user(); } - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - gpio_write_pin(E6, !led_state.num_lock); - } - - return true; -} \ No newline at end of file diff --git a/keyboards/evyd13/gh80_3700/keyboard.json b/keyboards/evyd13/gh80_3700/keyboard.json index fa11a482df..a647f46118 100644 --- a/keyboards/evyd13/gh80_3700/keyboard.json +++ b/keyboards/evyd13/gh80_3700/keyboard.json @@ -23,6 +23,10 @@ "resync": true } }, + "indicators": { + "num_lock": "E6", + "on_state": 0 + }, "matrix_pins": { "cols": ["B0", "D7", "D6", "D4"], "rows": ["B3", "C7", "C6", "B6", "B5", "B4"] diff --git a/keyboards/exclusive/e85/hotswap/hotswap.c b/keyboards/exclusive/e85/hotswap/hotswap.c deleted file mode 100644 index 18ca30b44c..0000000000 --- a/keyboards/exclusive/e85/hotswap/hotswap.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright 2020 MechMerlin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -void keyboard_pre_init_kb(void) { - gpio_set_pin_output(C7); - gpio_set_pin_output(B5); - - keyboard_pre_init_user(); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - gpio_write_pin(C7, led_state.caps_lock); - gpio_write_pin(B5, led_state.scroll_lock); - } - return true; -} diff --git a/keyboards/exclusive/e85/hotswap/keyboard.json b/keyboards/exclusive/e85/hotswap/keyboard.json index 4bd8e73882..7fcd61c843 100644 --- a/keyboards/exclusive/e85/hotswap/keyboard.json +++ b/keyboards/exclusive/e85/hotswap/keyboard.json @@ -18,6 +18,10 @@ "levels": 6, "breathing": true }, + "indicators": { + "caps_lock": "C7", + "scroll_lock": "B5" + }, "rgblight": { "saturation_steps": 8, "brightness_steps": 8, diff --git a/keyboards/fjlabs/bolsa65/bolsa65.c b/keyboards/fjlabs/bolsa65/bolsa65.c deleted file mode 100644 index 669404192c..0000000000 --- a/keyboards/fjlabs/bolsa65/bolsa65.c +++ /dev/null @@ -1,28 +0,0 @@ -/* -Copyright 2020 -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#include "quantum.h" - -void matrix_init_kb(void) { - // Initialize indicator LEDs to output - gpio_set_pin_output(F7); // Caps - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(F7, led_state.caps_lock); - } - return res; -} diff --git a/keyboards/fjlabs/bolsa65/keyboard.json b/keyboards/fjlabs/bolsa65/keyboard.json index dfa47e90bb..63281ae9f6 100644 --- a/keyboards/fjlabs/bolsa65/keyboard.json +++ b/keyboards/fjlabs/bolsa65/keyboard.json @@ -8,6 +8,9 @@ "pid": "0x0001", "device_version": "0.0.1" }, + "indicators": { + "caps_lock": "F7" + }, "matrix_pins": { "cols": ["C7", "B1", "B2", "B3", "B7", "D0", "D1", "D2", "D3", "D5", "D4", "D6", "D7", "B4", "B5"], "rows": ["F1", "F0", "F6", "F5", "F4"] diff --git a/keyboards/flx/virgo/keyboard.json b/keyboards/flx/virgo/keyboard.json index 8396ce51da..996425282d 100644 --- a/keyboards/flx/virgo/keyboard.json +++ b/keyboards/flx/virgo/keyboard.json @@ -30,6 +30,11 @@ "pin": "B7", "levels": 5 }, + "indicators": { + "caps_lock": "E6", + "scroll_lock": "B2", + "on_state": 0 + }, "rgblight": { "saturation_steps": 8, "brightness_steps": 8, diff --git a/keyboards/flx/virgo/virgo.c b/keyboards/flx/virgo/virgo.c deleted file mode 100644 index 2f875531d0..0000000000 --- a/keyboards/flx/virgo/virgo.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright 2019 MechMerlin - * Edits etc 2020 Flexerm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - gpio_set_pin_output(E6); - gpio_set_pin_output(B2); - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - gpio_write_pin(E6, !led_state.caps_lock); - gpio_write_pin(B2, !led_state.scroll_lock); - } - return true; -} diff --git a/keyboards/handwired/colorlice/colorlice.c b/keyboards/handwired/colorlice/colorlice.c index ede3fba82f..92914b79bc 100644 --- a/keyboards/handwired/colorlice/colorlice.c +++ b/keyboards/handwired/colorlice/colorlice.c @@ -51,18 +51,3 @@ void suspend_wakeup_init_kb(void) suspend_wakeup_init_user(); } #endif - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - // gpio_write_pin sets the pin high for 1 and low for 0. - // In this example the pins are inverted, setting - // it low/0 turns it on, and high/1 turns the LED off. - // This behavior depends on whether the LED is between the pin - // and VCC or the pin and GND. - gpio_write_pin(B2, !led_state.num_lock); - gpio_write_pin(C6, !led_state.caps_lock); - gpio_write_pin(B7, !led_state.scroll_lock); - } - return res; -} diff --git a/keyboards/handwired/colorlice/keyboard.json b/keyboards/handwired/colorlice/keyboard.json index 77f5ded097..4ccc10527c 100644 --- a/keyboards/handwired/colorlice/keyboard.json +++ b/keyboards/handwired/colorlice/keyboard.json @@ -65,6 +65,12 @@ "build": { "lto": true }, + "indicators": { + "caps_lock": "C6", + "num_lock": "B2", + "scroll_lock": "B7", + "on_state": 0 + }, "features": { "bootmagic": true, "command": false, diff --git a/keyboards/handwired/evk/v1_3/v1_3.c b/keyboards/handwired/evk/v1_3/v1_3.c index a568ba3f86..575bf33759 100644 --- a/keyboards/handwired/evk/v1_3/v1_3.c +++ b/keyboards/handwired/evk/v1_3/v1_3.c @@ -33,12 +33,3 @@ __attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) { gpio_write_pin(D5, layer_state_cmp(state, 1)); return state; } - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if (res) { - // gpio_write_pin sets the pin high for 1 and low for 0. - gpio_write_pin(D4, led_state.caps_lock); - } - return res; -} diff --git a/keyboards/handwired/retro_refit/keyboard.json b/keyboards/handwired/retro_refit/keyboard.json index 1e7812d578..7acdb48b44 100644 --- a/keyboards/handwired/retro_refit/keyboard.json +++ b/keyboards/handwired/retro_refit/keyboard.json @@ -23,6 +23,12 @@ "resync": true } }, + "indicators": { + "caps_lock": "D0", + "num_lock": "D1", + "scroll_lock": "C6", + "on_state": 0 + }, "matrix_pins": { "cols": ["B0", "B1", "B2", "B3", "D2", "D3", "C7", "D5"], "rows": ["D4", "D7", "B4", "B5", "B6", "F7", "F6", "F5", "F4", "F1", "F0"] diff --git a/keyboards/handwired/retro_refit/retro_refit.c b/keyboards/handwired/retro_refit/retro_refit.c index b62d94d741..08e8e1d528 100644 --- a/keyboards/handwired/retro_refit/retro_refit.c +++ b/keyboards/handwired/retro_refit/retro_refit.c @@ -1,5 +1,4 @@ #include "quantum.h" -#include "led.h" void matrix_init_kb(void) { // put your keyboard start-up code here @@ -11,14 +10,3 @@ void matrix_init_kb(void) { matrix_init_user(); }; - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(D0, !led_state.caps_lock); - gpio_write_pin(D1, !led_state.num_lock); - gpio_write_pin(C6, !led_state.scroll_lock); - - } - return res; -} \ No newline at end of file diff --git a/keyboards/handwired/selene/keyboard.json b/keyboards/handwired/selene/keyboard.json index 592b51aaf4..34eec11664 100644 --- a/keyboards/handwired/selene/keyboard.json +++ b/keyboards/handwired/selene/keyboard.json @@ -8,6 +8,11 @@ "pid": "0x0001", "device_version": "0.0.1" }, + "indicators": { + "caps_lock": "A2", + "num_lock": "A0", + "scroll_lock": "A1" + }, "rgblight": { "led_count": 50 }, diff --git a/keyboards/handwired/selene/selene.c b/keyboards/handwired/selene/selene.c index b0924c06f4..3d0ef667cf 100644 --- a/keyboards/handwired/selene/selene.c +++ b/keyboards/handwired/selene/selene.c @@ -15,24 +15,8 @@ */ -#include "selene.h" - -void matrix_init_kb(void){ - gpio_set_pin_output(NUM_LOCK_PIN); - gpio_set_pin_output(CAPS_LOCK_PIN); - gpio_set_pin_output(SCROLL_LOCK_PIN); -} +#include "quantum.h" void keyboard_post_init_user(void) { rgblight_setrgb(0xff, 0xff, 0xff); } - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(NUM_LOCK_PIN, led_state.num_lock); - gpio_write_pin(CAPS_LOCK_PIN, led_state.caps_lock); - gpio_write_pin(SCROLL_LOCK_PIN, led_state.scroll_lock); - } - return res; -} diff --git a/keyboards/handwired/selene/selene.h b/keyboards/handwired/selene/selene.h deleted file mode 100644 index bcd4215e36..0000000000 --- a/keyboards/handwired/selene/selene.h +++ /dev/null @@ -1,23 +0,0 @@ -/* Copyright 2020 Bpendragon - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include "quantum.h" - -#define NUM_LOCK_PIN A0 -#define CAPS_LOCK_PIN A2 -#define SCROLL_LOCK_PIN A1 diff --git a/keyboards/handwired/z150/config.h b/keyboards/handwired/z150/config.h deleted file mode 100644 index 7a054266ea..0000000000 --- a/keyboards/handwired/z150/config.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2020 DmNosachev - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#define NUM_LOCK_LED_PIN B5 -#define SCROLL_LOCK_LED_PIN B4 -#define CAPS_LOCK_LED_PIN B3 - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT diff --git a/keyboards/handwired/z150/keyboard.json b/keyboards/handwired/z150/keyboard.json index 0658bb5233..38c92a6537 100644 --- a/keyboards/handwired/z150/keyboard.json +++ b/keyboards/handwired/z150/keyboard.json @@ -16,6 +16,12 @@ "mousekey": true, "nkro": false }, + "indicators": { + "caps_lock": "B3", + "num_lock": "B5", + "scroll_lock": "B4", + "on_state": 0 + }, "matrix_pins": { "cols": ["B11", "B10", "B1", "B0", "A7", "A6", "A5", "A4"], "rows": ["B13", "B14", "B15", "A8", "A9", "A3", "A10", "A1", "A2", "A15", "A0"] diff --git a/keyboards/handwired/z150/z150.c b/keyboards/handwired/z150/z150.c deleted file mode 100644 index ab6709eed7..0000000000 --- a/keyboards/handwired/z150/z150.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright 2020 DmNosachev - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -void matrix_init_kb(void) { - gpio_set_pin_output(NUM_LOCK_LED_PIN); - gpio_set_pin_output(CAPS_LOCK_LED_PIN); - gpio_set_pin_output(SCROLL_LOCK_LED_PIN); - - gpio_write_pin_low(NUM_LOCK_LED_PIN); - gpio_write_pin_low(CAPS_LOCK_LED_PIN); - gpio_write_pin_low(SCROLL_LOCK_LED_PIN); - - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(NUM_LOCK_LED_PIN, !led_state.num_lock); - gpio_write_pin(CAPS_LOCK_LED_PIN, !led_state.caps_lock); - gpio_write_pin(SCROLL_LOCK_LED_PIN, !led_state.scroll_lock); - } - return res; -} diff --git a/keyboards/kabedon/kabedon980/kabedon980.c b/keyboards/kabedon/kabedon980/kabedon980.c deleted file mode 100644 index 7024a2eaa9..0000000000 --- a/keyboards/kabedon/kabedon980/kabedon980.c +++ /dev/null @@ -1,8 +0,0 @@ -#include "quantum.h" - - bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - gpio_write_pin(E6, !led_state.caps_lock); - } - return true; -} diff --git a/keyboards/kabedon/kabedon980/keyboard.json b/keyboards/kabedon/kabedon980/keyboard.json index cf9def2b8f..b8e100ceac 100644 --- a/keyboards/kabedon/kabedon980/keyboard.json +++ b/keyboards/kabedon/kabedon980/keyboard.json @@ -8,6 +8,10 @@ "pid": "0x3938", "device_version": "0.0.1" }, + "indicators": { + "caps_lock": "E6", + "on_state": 0 + }, "rgblight": { "saturation_steps": 8, "brightness_steps": 8, diff --git a/keyboards/noxary/x268/keyboard.json b/keyboards/noxary/x268/keyboard.json index f5a991deff..7ca5799de2 100644 --- a/keyboards/noxary/x268/keyboard.json +++ b/keyboards/noxary/x268/keyboard.json @@ -32,6 +32,9 @@ "backlight": { "pin": "B7" }, + "indicators": { + "caps_lock": "B0" + }, "rgblight": { "hue_steps": 16, "saturation_steps": 16, diff --git a/keyboards/noxary/x268/x268.c b/keyboards/noxary/x268/x268.c deleted file mode 100644 index 67d6dff89d..0000000000 --- a/keyboards/noxary/x268/x268.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright 2020 Rozakiin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" - -// Optional override functions below. -// You can leave any or all of these undefined. -// These are only required if you want to perform custom actions. - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - gpio_set_pin_output(B0); - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - gpio_write_pin(B0, led_state.caps_lock); - } - return true; -} diff --git a/keyboards/punk75/config.h b/keyboards/punk75/config.h deleted file mode 100644 index 321865330c..0000000000 --- a/keyboards/punk75/config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 2020 dsanchezseco - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#define LED A0 diff --git a/keyboards/punk75/keyboard.json b/keyboards/punk75/keyboard.json index dd084a147c..c7082e564f 100644 --- a/keyboards/punk75/keyboard.json +++ b/keyboards/punk75/keyboard.json @@ -32,6 +32,10 @@ {"pin_a": "B1", "pin_b": "B0"} ] }, + "indicators": { + "caps_lock": "A0", + "on_state": 0 + }, "processor": "atmega32a", "bootloader": "usbasploader", "community_layouts": ["ortho_5x15"], diff --git a/keyboards/punk75/keymaps/default/keymap.c b/keyboards/punk75/keymaps/default/keymap.c index 9a6ef29307..57f00e1e61 100644 --- a/keyboards/punk75/keymaps/default/keymap.c +++ b/keyboards/punk75/keymaps/default/keymap.c @@ -74,7 +74,7 @@ void led_keypress_update(pin_t led_pin, uint16_t keycode, keyrecord_t *record) { bool process_record_user(uint16_t keycode, keyrecord_t *record) { // Update LED state - led_keypress_update(LED, keycode, record); + led_keypress_update(LED_CAPS_LOCK_PIN, keycode, record); return true; } diff --git a/keyboards/punk75/keymaps/via/keymap.c b/keyboards/punk75/keymaps/via/keymap.c index 72ef91fd37..214135b55d 100644 --- a/keyboards/punk75/keymaps/via/keymap.c +++ b/keyboards/punk75/keymaps/via/keymap.c @@ -69,7 +69,7 @@ void led_keypress_update(pin_t led_pin, uint16_t keycode, keyrecord_t *record) { bool process_record_user(uint16_t keycode, keyrecord_t *record) { // Update LED state - led_keypress_update(LED, keycode, record); + led_keypress_update(LED_CAPS_LOCK_PIN, keycode, record); return true; } diff --git a/keyboards/punk75/punk75.c b/keyboards/punk75/punk75.c deleted file mode 100644 index 8d9d09d43c..0000000000 --- a/keyboards/punk75/punk75.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright 2020 dsanchezseco - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -void matrix_init_kb(void) { - // Set our LED pin as output - gpio_set_pin_output(LED); - - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(LED, !led_state.caps_lock); - } - return res; -} diff --git a/keyboards/redscarf_i/keyboard.json b/keyboards/redscarf_i/keyboard.json index 0a268169ef..6a186dff0b 100644 --- a/keyboards/redscarf_i/keyboard.json +++ b/keyboards/redscarf_i/keyboard.json @@ -25,6 +25,10 @@ "backlight": { "pin": "B5" }, + "indicators": { + "num_lock": "F7", + "on_state": 0 + }, "processor": "atmega32u4", "bootloader": "atmel-dfu", "community_layouts": ["ortho_5x4", "ortho_6x4", "numpad_5x4", "numpad_6x4"], diff --git a/keyboards/redscarf_i/redscarf_i.c b/keyboards/redscarf_i/redscarf_i.c index 949bc362ad..7544b89d17 100644 --- a/keyboards/redscarf_i/redscarf_i.c +++ b/keyboards/redscarf_i/redscarf_i.c @@ -18,21 +18,13 @@ void keyboard_pre_init_kb(void) { // initialize top row leds - gpio_set_pin_output(F7); gpio_set_pin_output(F6); gpio_set_pin_output(F5); // and then turn them off - gpio_write_pin_high(F7); gpio_write_pin_high(F6); gpio_write_pin_high(F5); -} -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(F7, !led_state.num_lock); - } - return res; + keyboard_pre_init_user(); } layer_state_t layer_state_set_kb(layer_state_t state) { diff --git a/keyboards/sneakbox/aliceclone/aliceclone.c b/keyboards/sneakbox/aliceclone/aliceclone.c deleted file mode 100644 index 74d19e515c..0000000000 --- a/keyboards/sneakbox/aliceclone/aliceclone.c +++ /dev/null @@ -1,36 +0,0 @@ -/* -Copyright 2020 Bryan Ong - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "quantum.h" - -void keyboard_pre_init_kb(void) { - gpio_set_pin_output(D7); - gpio_set_pin_output(D6); - gpio_set_pin_output(D4); - - keyboard_pre_init_user(); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(D7, led_state.num_lock); - gpio_write_pin(D6, led_state.caps_lock); - gpio_write_pin(D4, led_state.scroll_lock); - } - return res; -} diff --git a/keyboards/sneakbox/aliceclone/keyboard.json b/keyboards/sneakbox/aliceclone/keyboard.json index 869b8bd20b..bb0cd8e4b8 100644 --- a/keyboards/sneakbox/aliceclone/keyboard.json +++ b/keyboards/sneakbox/aliceclone/keyboard.json @@ -36,6 +36,11 @@ "bootmagic": { "matrix": [2, 0] }, + "indicators": { + "caps_lock": "D6", + "num_lock": "D7", + "scroll_lock": "D4" + }, "processor": "atmega32u4", "bootloader": "atmel-dfu", "community_layouts": ["alice", "alice_split_bs"], diff --git a/keyboards/yiancardesigns/barleycorn/barleycorn.c b/keyboards/yiancardesigns/barleycorn/barleycorn.c deleted file mode 100644 index c73c1559c2..0000000000 --- a/keyboards/yiancardesigns/barleycorn/barleycorn.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright 2020 Yiancar - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" - -void keyboard_pre_init_kb(void) { - // Set our LED pins as output - gpio_set_pin_output(B5); - gpio_set_pin_output(C0); - keyboard_pre_init_user(); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - // gpio_write_pin sets the pin high for 1 and low for 0. - // In this example the pins are inverted, setting - // it low/0 turns it on, and high/1 turns the LED off. - // This behavior depends on whether the LED is between the pin - // and VCC or the pin and GND. - gpio_write_pin(B5, led_state.caps_lock); - gpio_write_pin(C0, led_state.num_lock); - } - return res; -} diff --git a/keyboards/yiancardesigns/barleycorn/keyboard.json b/keyboards/yiancardesigns/barleycorn/keyboard.json index a1676840a5..cf041b96c5 100644 --- a/keyboards/yiancardesigns/barleycorn/keyboard.json +++ b/keyboards/yiancardesigns/barleycorn/keyboard.json @@ -19,6 +19,10 @@ "resync": true } }, + "indicators": { + "caps_lock": "B5", + "num_lock": "C0" + }, "processor": "atmega328p", "bootloader": "usbasploader", "layouts": {