diff --git a/keyboards/ares/ares.c b/keyboards/ares/ares.c index 95d4b878f10..80d44551795 100644 --- a/keyboards/ares/ares.c +++ b/keyboards/ares/ares.c @@ -16,19 +16,3 @@ along with this program. If not, see . */ #include "ares.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D1); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D1, led_state.caps_lock); - } - return true; -} diff --git a/keyboards/ares/config.h b/keyboards/ares/config.h index ffbe456050d..35e885d6931 100644 --- a/keyboards/ares/config.h +++ b/keyboards/ares/config.h @@ -37,6 +37,8 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW #define DEBOUNCE 5 +#define LED_CAPS_LOCK_PIN D1 + #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/bfake/bfake.c b/keyboards/bfake/bfake.c index 6d0c927462b..5eedcc19463 100644 --- a/keyboards/bfake/bfake.c +++ b/keyboards/bfake/bfake.c @@ -16,19 +16,3 @@ along with this program. If not, see . */ #include "bfake.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D1); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D1, led_state.caps_lock); - } - return true; -} diff --git a/keyboards/bfake/config.h b/keyboards/bfake/config.h index 6c4710a9ec8..54e01ad3dbd 100644 --- a/keyboards/bfake/config.h +++ b/keyboards/bfake/config.h @@ -37,6 +37,8 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW #define DEBOUNCE 5 +#define LED_CAPS_LOCK_PIN D1 + #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/chili/chili.c b/keyboards/chili/chili.c index 40d3528b080..f629a6d60a6 100644 --- a/keyboards/chili/chili.c +++ b/keyboards/chili/chili.c @@ -14,29 +14,3 @@ * along with this program. If not, see . */ #include "chili.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - led_init_ports(); - matrix_init_user(); -} - -void led_init_ports(void) { - setPinOutput(B1); - writePinHigh(B1); - setPinOutput(B2); - writePinHigh(B2); - setPinOutput(B3); - writePinHigh(B3); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - writePin(B1, !led_state.num_lock); - writePin(B2, !led_state.caps_lock); - writePin(B3, !led_state.scroll_lock); - } - return res; -} diff --git a/keyboards/chili/config.h b/keyboards/chili/config.h index 4b6a632cd43..08c24758751 100644 --- a/keyboards/chili/config.h +++ b/keyboards/chili/config.h @@ -42,6 +42,11 @@ along with this program. If not, see . /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW +#define LED_NUM_LOCK_PIN B1 +#define LED_CAPS_LOCK_PIN B2 +#define LED_SCROLL_LOCK_PIN B3 +#define LED_PIN_ON_STATE 0 + #define BACKLIGHT_PIN B7 #define BACKLIGHT_BREATHING #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/coarse/cordillera/config.h b/keyboards/coarse/cordillera/config.h index ac636d5d5e3..33b0d7944a3 100644 --- a/keyboards/coarse/cordillera/config.h +++ b/keyboards/coarse/cordillera/config.h @@ -32,6 +32,10 @@ along with this program. If not, see . #define MATRIX_COL_PINS { B15, B14, B13, B12, B11, B10, B2, B1, B8, B7, B6, B5, B4, B3, A15, A14 } #define DIODE_DIRECTION COL2ROW +#define LED_NUM_LOCK_PIN B0 +#define LED_CAPS_LOCK_PIN A1 +#define LED_SCROLL_LOCK_PIN A0 + #define BACKLIGHT_PIN A8 #define BACKLIGHT_PWM_DRIVER PWMD1 #define BACKLIGHT_PWM_CHANNEL 1 diff --git a/keyboards/coarse/cordillera/cordillera.c b/keyboards/coarse/cordillera/cordillera.c index 5bf07740b5a..437547ff282 100644 --- a/keyboards/coarse/cordillera/cordillera.c +++ b/keyboards/coarse/cordillera/cordillera.c @@ -16,23 +16,3 @@ along with this program. If not, see . */ #include "cordillera.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(B0); - setPinOutput(A1); - setPinOutput(A0); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(B0, led_state.num_lock); - writePin(A1, led_state.caps_lock); - writePin(A0, led_state.scroll_lock); - } - return true; -} diff --git a/keyboards/crazy_keyboard_68/config.h b/keyboards/crazy_keyboard_68/config.h index 2558e757918..e1304e18ed5 100644 --- a/keyboards/crazy_keyboard_68/config.h +++ b/keyboards/crazy_keyboard_68/config.h @@ -52,6 +52,9 @@ along with this program. If not, see . */ //#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 +#define LED_CAPS_LOCK_PIN B2 +#define LED_PIN_ON_STATE 0 + //#define BACKLIGHT_PIN B7 //#define BACKLIGHT_LEVELS 3 //#define BACKLIGHT_BREATHING diff --git a/keyboards/crazy_keyboard_68/crazy_keyboard_68.c b/keyboards/crazy_keyboard_68/crazy_keyboard_68.c index f4f8515b7c5..cbea93fb85d 100644 --- a/keyboards/crazy_keyboard_68/crazy_keyboard_68.c +++ b/keyboards/crazy_keyboard_68/crazy_keyboard_68.c @@ -15,22 +15,3 @@ */ #include "crazy_keyboard_68.h" - -void matrix_init_kb(void) { - led_init_ports(); - - matrix_init_user(); -} - -void led_init_ports(void) { - // Caps lock pin - setPinOutput(B0); - writePinHigh(B0); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - writePin(B0, !led_state.caps_lock); - } - return true; -} diff --git a/keyboards/daisy/config.h b/keyboards/daisy/config.h index a41e158f1c7..ea56f948eef 100644 --- a/keyboards/daisy/config.h +++ b/keyboards/daisy/config.h @@ -52,6 +52,9 @@ along with this program. If not, see . */ //#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 +#define LED_CAPS_LOCK_PIN C6 +#define LED_PIN_ON_STATE 0 + #define BACKLIGHT_PIN D0 // #define BACKLIGHT_BREATHING #define BACKLIGHT_LEVELS 6 diff --git a/keyboards/daisy/daisy.c b/keyboards/daisy/daisy.c index 4e365ed4621..98b7ac84b3e 100644 --- a/keyboards/daisy/daisy.c +++ b/keyboards/daisy/daisy.c @@ -15,21 +15,3 @@ */ #include "daisy.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(C6); - writePinHigh(C6); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(C6, !led_state.caps_lock); - } - - return true; -} diff --git a/keyboards/do60/config.h b/keyboards/do60/config.h index ef6c55c3e1a..f3ee1ed0455 100644 --- a/keyboards/do60/config.h +++ b/keyboards/do60/config.h @@ -45,6 +45,9 @@ along with this program. If not, see . #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B7, F4, B4, D7, D6, B3, B0 } #define UNUSED_PINS +#define LED_CAPS_LOCK_PIN B2 +#define LED_PIN_ON_STATE 0 + /* Backlight Setup */ #define BACKLIGHT_PIN B5 #define BACKLIGHT_LEVELS 6 diff --git a/keyboards/do60/do60.c b/keyboards/do60/do60.c index 3dba9b53593..b19fc59828f 100644 --- a/keyboards/do60/do60.c +++ b/keyboards/do60/do60.c @@ -2,26 +2,9 @@ extern inline void setdefaultrgb(void); - void matrix_init_kb(void) { // Keyboard start-up code goes here // Runs once when the firmware starts up matrix_init_user(); - led_init_ports(); setdefaultrgb(); }; - -void led_init_ports(void) { - // Set caps lock LED pin as output - setPinOutput(B2); - // Default to off - writePinHigh(B2); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - writePin(B2, !led_state.caps_lock); - } - - return true; -} diff --git a/keyboards/donutcables/budget96/budget96.c b/keyboards/donutcables/budget96/budget96.c index 5f3436dc610..8c7b894bc4d 100644 --- a/keyboards/donutcables/budget96/budget96.c +++ b/keyboards/donutcables/budget96/budget96.c @@ -15,21 +15,3 @@ */ #include "budget96.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D0); - setPinOutput(D1); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D0, led_state.num_lock); - writePin(D1, led_state.caps_lock); - } - return true; -} diff --git a/keyboards/donutcables/budget96/config.h b/keyboards/donutcables/budget96/config.h index e04cc8b78d1..39b661dda75 100644 --- a/keyboards/donutcables/budget96/config.h +++ b/keyboards/donutcables/budget96/config.h @@ -37,6 +37,9 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW #define DEBOUNCE 5 +#define LED_NUM_LOCK_PIN D0 +#define LED_CAPS_LOCK_PIN D1 + #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/eve/meteor/config.h b/keyboards/eve/meteor/config.h index 1e8c6ca052b..a6b2c9b69d9 100644 --- a/keyboards/eve/meteor/config.h +++ b/keyboards/eve/meteor/config.h @@ -36,5 +36,7 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW #define DEBOUNCE 5 +#define LED_CAPS_LOCK_PIN D1 + #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/eve/meteor/meteor.c b/keyboards/eve/meteor/meteor.c index 1d080b389cc..6bdb117f3a6 100644 --- a/keyboards/eve/meteor/meteor.c +++ b/keyboards/eve/meteor/meteor.c @@ -15,19 +15,3 @@ */ #include "meteor.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D1); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D1, led_state.caps_lock); - } - return true; -} diff --git a/keyboards/evyd13/eon75/config.h b/keyboards/evyd13/eon75/config.h index 707665140db..d7d84de2a36 100644 --- a/keyboards/evyd13/eon75/config.h +++ b/keyboards/evyd13/eon75/config.h @@ -51,6 +51,11 @@ */ // #define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 +#define LED_NUM_LOCK_PIN B7 +#define LED_CAPS_LOCK_PIN D5 +#define LED_SCROLL_LOCK_PIN B0 +#define LED_PIN_ON_STATE 0 + // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/evyd13/eon75/eon75.c b/keyboards/evyd13/eon75/eon75.c index 67e9fe66a2e..38620a63620 100644 --- a/keyboards/evyd13/eon75/eon75.c +++ b/keyboards/evyd13/eon75/eon75.c @@ -14,32 +14,3 @@ * along with this program. If not, see . */ #include "eon75.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - matrix_init_user(); - led_init_ports(); -}; - -void led_init_ports(void) { - // * Set our LED pins as output and high - setPinOutput(D5); - writePinHigh(D5); - - setPinOutput(B7); - writePinHigh(B7); - - setPinOutput(B0); - writePinHigh(B0); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - writePin(D5, !led_state.caps_lock); - writePin(B7, !led_state.num_lock); - writePin(B0, !led_state.scroll_lock); - } - - return true; -} diff --git a/keyboards/evyd13/eon95/config.h b/keyboards/evyd13/eon95/config.h index eb44d8957e9..2d9ede3ee27 100644 --- a/keyboards/evyd13/eon95/config.h +++ b/keyboards/evyd13/eon95/config.h @@ -51,6 +51,11 @@ */ // #define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 +#define LED_NUM_LOCK_PIN B7 +#define LED_CAPS_LOCK_PIN D5 +#define LED_SCROLL_LOCK_PIN B0 +#define LED_PIN_ON_STATE 0 + // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/evyd13/eon95/eon95.c b/keyboards/evyd13/eon95/eon95.c index 5eec86cc11b..603d84a1391 100644 --- a/keyboards/evyd13/eon95/eon95.c +++ b/keyboards/evyd13/eon95/eon95.c @@ -14,32 +14,3 @@ * along with this program. If not, see . */ #include "eon95.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - matrix_init_user(); - led_init_ports(); -} - -void led_init_ports(void) { - // * Set our LED pins as output and high - setPinOutput(D5); - writePinHigh(D5); - - setPinOutput(B7); - writePinHigh(B7); - - setPinOutput(B0); - writePinHigh(B0); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - writePin(D5, !led_state.caps_lock); - writePin(B7, !led_state.num_lock); - writePin(B0, !led_state.scroll_lock); - } - - return true; -} diff --git a/keyboards/evyd13/gh80_1800/config.h b/keyboards/evyd13/gh80_1800/config.h index c230aa9af86..26ad8a8b137 100644 --- a/keyboards/evyd13/gh80_1800/config.h +++ b/keyboards/evyd13/gh80_1800/config.h @@ -51,6 +51,11 @@ */ // #define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 +#define LED_NUM_LOCK_PIN D6 +#define LED_CAPS_LOCK_PIN D7 +#define LED_SCROLL_LOCK_PIN D4 +#define LED_PIN_ON_STATE 0 + // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/evyd13/gh80_1800/gh80_1800.c b/keyboards/evyd13/gh80_1800/gh80_1800.c index 770c6f78bf2..1691b3949ea 100644 --- a/keyboards/evyd13/gh80_1800/gh80_1800.c +++ b/keyboards/evyd13/gh80_1800/gh80_1800.c @@ -14,31 +14,3 @@ * along with this program. If not, see . */ #include "gh80_1800.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); - led_init_ports(); -} - -void led_init_ports(void) { - setPinOutput(D6); - setPinOutput(D7); - setPinOutput(D4); - - writePinHigh(D6); - writePinHigh(D7); - writePinHigh(D4); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - writePin(D6, !led_state.num_lock); - writePin(D7, !led_state.caps_lock); - writePin(D4, !led_state.scroll_lock); - } - - return true; -} diff --git a/keyboards/evyd13/minitomic/config.h b/keyboards/evyd13/minitomic/config.h index c041e86a2a9..f26b4d1d956 100644 --- a/keyboards/evyd13/minitomic/config.h +++ b/keyboards/evyd13/minitomic/config.h @@ -51,6 +51,9 @@ */ // #define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 +#define LED_CAPS_LOCK_PIN C7 +#define LED_PIN_ON_STATE 0 + // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/evyd13/minitomic/minitomic.c b/keyboards/evyd13/minitomic/minitomic.c index 8d5f11a50d1..15f28296486 100644 --- a/keyboards/evyd13/minitomic/minitomic.c +++ b/keyboards/evyd13/minitomic/minitomic.c @@ -14,37 +14,3 @@ * along with this program. If not, see . */ #include "minitomic.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); - led_init_ports(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -void led_init_ports(void) { - //Set led pin as output, then high (off) - writePinHigh(C7); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - // writePin 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. - writePin(C7, !led_state.caps_lock); - } - return res; -} - diff --git a/keyboards/evyd13/mx5160/config.h b/keyboards/evyd13/mx5160/config.h index 926095a5d22..c65f81b8794 100644 --- a/keyboards/evyd13/mx5160/config.h +++ b/keyboards/evyd13/mx5160/config.h @@ -55,6 +55,11 @@ */ // #define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 +#define LED_NUM_LOCK_PIN B2 +#define LED_CAPS_LOCK_PIN B1 +#define LED_SCROLL_LOCK_PIN B3 +#define LED_PIN_ON_STATE 0 + // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/evyd13/mx5160/mx5160.c b/keyboards/evyd13/mx5160/mx5160.c index c9e412da246..298c44fd499 100644 --- a/keyboards/evyd13/mx5160/mx5160.c +++ b/keyboards/evyd13/mx5160/mx5160.c @@ -14,45 +14,3 @@ * along with this program. If not, see . */ #include "mx5160.h" - - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); - led_init_ports(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -void led_init_ports(void) { - //Set led pin as output, then high (off) - - //Caps lock - setPinOutput(B1); - writePinHigh(B1); - - //Num lock - setPinOutput(B2); - writePinHigh(B2); - - //Scroll lock - setPinOutput(B3); - writePinHigh(B3); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if (res) { - writePin(B2, !led_state.num_lock); - writePin(B1, !led_state.caps_lock); - writePin(B3, !led_state.scroll_lock); - } - return res; -} diff --git a/keyboards/evyd13/nt660/config.h b/keyboards/evyd13/nt660/config.h index 0d9bbd3300e..86388471425 100644 --- a/keyboards/evyd13/nt660/config.h +++ b/keyboards/evyd13/nt660/config.h @@ -53,6 +53,8 @@ along with this program. If not, see . */ // #define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 +#define LED_CAPS_LOCK_PIN D0 + // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/evyd13/nt660/nt660.c b/keyboards/evyd13/nt660/nt660.c index 2a8ebfb46c8..f89fa579c3e 100644 --- a/keyboards/evyd13/nt660/nt660.c +++ b/keyboards/evyd13/nt660/nt660.c @@ -14,19 +14,3 @@ * along with this program. If not, see . */ #include "nt660.h" -void matrix_init_kb(void) { - matrix_init_user(); - led_init_ports(); -} - -void led_init_ports(void) { - setPinOutput(D0); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - writePin(D0, !led_state.caps_lock); - } - - return true; -} diff --git a/keyboards/evyd13/quackfire/config.h b/keyboards/evyd13/quackfire/config.h index 22083e81187..151219a016f 100644 --- a/keyboards/evyd13/quackfire/config.h +++ b/keyboards/evyd13/quackfire/config.h @@ -52,6 +52,10 @@ along with this program. If not, see . */ //#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 +#define LED_CAPS_LOCK_PIN F7 +#define LED_SCROLL_LOCK_PIN F6 +#define LED_PIN_ON_STATE 0 + // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 5 diff --git a/keyboards/evyd13/quackfire/quackfire.c b/keyboards/evyd13/quackfire/quackfire.c index ab233bd6d44..634d4187c6d 100644 --- a/keyboards/evyd13/quackfire/quackfire.c +++ b/keyboards/evyd13/quackfire/quackfire.c @@ -14,31 +14,3 @@ * along with this program. If not, see . */ #include "quackfire.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 - - matrix_init_user(); - led_init_ports(); -} - -void led_init_ports(void) { - setPinOutput(F6); - setPinOutput(F7); - writePinHigh(F6); - writePinHigh(F7); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - writePin(F7, !led_state.caps_lock); - writePin(F6, !led_state.scroll_lock); - } - - return true; -} diff --git a/keyboards/evyd13/wasdat/config.h b/keyboards/evyd13/wasdat/config.h index c064d18a589..75b75a0d2ab 100644 --- a/keyboards/evyd13/wasdat/config.h +++ b/keyboards/evyd13/wasdat/config.h @@ -57,6 +57,11 @@ along with this program. If not, see . */ //#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 +#define LED_NUM_LOCK_PIN B2 +#define LED_CAPS_LOCK_PIN B0 +#define LED_SCROLL_LOCK_PIN B1 +#define LED_PIN_ON_STATE 0 + // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/evyd13/wasdat/wasdat.c b/keyboards/evyd13/wasdat/wasdat.c index 2d0e999c4e8..6aaa1b84276 100644 --- a/keyboards/evyd13/wasdat/wasdat.c +++ b/keyboards/evyd13/wasdat/wasdat.c @@ -14,34 +14,3 @@ * along with this program. If not, see . */ #include "wasdat.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 - - matrix_init_user(); - led_init_ports(); -} - -void led_init_ports(void) { - setPinOutput(B0); - writePinHigh(B0); - setPinOutput(B1); - writePinHigh(B1); - setPinOutput(B2); - writePinHigh(B2); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - writePin(B0, !led_state.caps_lock); - writePin(B1, !led_state.scroll_lock); - writePin(B2, !led_state.num_lock); - } - - return true; -} diff --git a/keyboards/evyd13/wasdat_code/config.h b/keyboards/evyd13/wasdat_code/config.h index 804839ee9a9..4ac77f217df 100644 --- a/keyboards/evyd13/wasdat_code/config.h +++ b/keyboards/evyd13/wasdat_code/config.h @@ -57,6 +57,11 @@ along with this program. If not, see . */ //#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 +#define LED_NUM_LOCK_PIN B3 +#define LED_CAPS_LOCK_PIN B1 +#define LED_SCROLL_LOCK_PIN B2 +#define LED_PIN_ON_STATE 0 + #define BACKLIGHT_PIN B7 #define BACKLIGHT_BREATHING #define BACKLIGHT_LEVELS 5 diff --git a/keyboards/evyd13/wasdat_code/wasdat_code.c b/keyboards/evyd13/wasdat_code/wasdat_code.c index 33551c2d0cb..c1cdadea9e1 100644 --- a/keyboards/evyd13/wasdat_code/wasdat_code.c +++ b/keyboards/evyd13/wasdat_code/wasdat_code.c @@ -14,34 +14,3 @@ * along with this program. If not, see . */ #include "wasdat_code.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 - - matrix_init_user(); - led_init_ports(); -} - -void led_init_ports(void) { - setPinOutput(B1); - setPinOutput(B2); - setPinOutput(B3); - writePinHigh(B1); - writePinHigh(B2); - writePinHigh(B3); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - writePin(B1, !led_state.caps_lock); - writePin(B2, !led_state.scroll_lock); - writePin(B3, !led_state.num_lock); - } - - return true; -} diff --git a/keyboards/evyd13/wonderland/config.h b/keyboards/evyd13/wonderland/config.h index 908c8a78552..c5c7a8b6c66 100644 --- a/keyboards/evyd13/wonderland/config.h +++ b/keyboards/evyd13/wonderland/config.h @@ -43,6 +43,11 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 +#define LED_NUM_LOCK_PIN B1 +#define LED_CAPS_LOCK_PIN B2 +#define LED_SCROLL_LOCK_PIN B3 +#define LED_PIN_ON_STATE 0 + /* Backlight configuration */ #define RGB_DI_PIN B7 diff --git a/keyboards/evyd13/wonderland/wonderland.c b/keyboards/evyd13/wonderland/wonderland.c index 44154438161..f2a53a17a43 100644 --- a/keyboards/evyd13/wonderland/wonderland.c +++ b/keyboards/evyd13/wonderland/wonderland.c @@ -1,34 +1 @@ #include "wonderland.h" - -__attribute__ ((weak)) -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - matrix_init_user(); - led_init_ports(); -}; - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - matrix_scan_user(); -}; - -__attribute__ ((weak)) -void led_init_ports(void) { - // * Set our LED pins as output - setPinOutput(B1); - setPinOutput(B2); - setPinOutput(B3); -} - -bool led_update_kb(led_t led_state) { - bool runDefault = led_update_user(led_state); - if (runDefault) { - writePin(B1, !led_state.num_lock); - writePin(B2, !led_state.caps_lock); - writePin(B3, !led_state.scroll_lock); - } - return runDefault; -} diff --git a/keyboards/exclusive/e65/config.h b/keyboards/exclusive/e65/config.h index bc0f1a1ed71..1d43011b80f 100644 --- a/keyboards/exclusive/e65/config.h +++ b/keyboards/exclusive/e65/config.h @@ -39,6 +39,9 @@ /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW +#define LED_CAPS_LOCK_PIN B6 +#define LED_PIN_ON_STATE 0 + /* number of backlight levels */ #define BACKLIGHT_PIN B7 #ifdef BACKLIGHT_PIN diff --git a/keyboards/exclusive/e65/e65.c b/keyboards/exclusive/e65/e65.c index e01a0614c52..feb0e654382 100644 --- a/keyboards/exclusive/e65/e65.c +++ b/keyboards/exclusive/e65/e65.c @@ -15,24 +15,3 @@ */ #include "e65.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); - led_init_ports(); -} - -void led_init_ports(void) { - setPinOutput(B6); - writePinHigh(B6); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - writePin(B6, !led_state.caps_lock); - } - - return true; -} diff --git a/keyboards/exclusive/e6v2/le_bmc/config.h b/keyboards/exclusive/e6v2/le_bmc/config.h index e9e8c9e533a..8115f4ae121 100644 --- a/keyboards/exclusive/e6v2/le_bmc/config.h +++ b/keyboards/exclusive/e6v2/le_bmc/config.h @@ -44,6 +44,8 @@ along with this program. If not, see . #define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, C2, C3, C4, C5, D7 } #define DIODE_DIRECTION COL2ROW +#define LED_CAPS_LOCK_PIN D1 + #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/exclusive/e6v2/le_bmc/le_bmc.c b/keyboards/exclusive/e6v2/le_bmc/le_bmc.c index df79cc5dcf8..e36cfd645d2 100644 --- a/keyboards/exclusive/e6v2/le_bmc/le_bmc.c +++ b/keyboards/exclusive/e6v2/le_bmc/le_bmc.c @@ -15,19 +15,3 @@ */ #include "le_bmc.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D1); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D1, led_state.caps_lock); - } - return true; -} diff --git a/keyboards/exclusive/e6v2/oe_bmc/config.h b/keyboards/exclusive/e6v2/oe_bmc/config.h index f4abd2112d9..3f2a50cdef1 100644 --- a/keyboards/exclusive/e6v2/oe_bmc/config.h +++ b/keyboards/exclusive/e6v2/oe_bmc/config.h @@ -44,6 +44,8 @@ along with this program. If not, see . #define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, C2, C3, C4, C5, D7 } #define DIODE_DIRECTION COL2ROW +#define LED_CAPS_LOCK_PIN D1 + #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/exclusive/e6v2/oe_bmc/oe_bmc.c b/keyboards/exclusive/e6v2/oe_bmc/oe_bmc.c index ea74d87cb1d..10dd1a26edf 100644 --- a/keyboards/exclusive/e6v2/oe_bmc/oe_bmc.c +++ b/keyboards/exclusive/e6v2/oe_bmc/oe_bmc.c @@ -15,19 +15,3 @@ */ #include "oe_bmc.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D1); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D1, led_state.caps_lock); - } - return true; -} diff --git a/keyboards/exent/config.h b/keyboards/exent/config.h index 6b37bdd1c8f..16a49e78fef 100644 --- a/keyboards/exent/config.h +++ b/keyboards/exent/config.h @@ -38,6 +38,10 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW #define DEBOUNCE 5 +#define LED_NUM_LOCK_PIN D0 +#define LED_CAPS_LOCK_PIN D1 +#define LED_SCROLL_LOCK_PIN D6 + #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/exent/exent.c b/keyboards/exent/exent.c index a935e9e67fa..82066f7e855 100644 --- a/keyboards/exent/exent.c +++ b/keyboards/exent/exent.c @@ -15,23 +15,3 @@ */ #include "exent.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D0); - setPinOutput(D1); - setPinOutput(D6); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D0, led_state.num_lock); - writePin(D1, led_state.caps_lock); - writePin(D6, led_state.scroll_lock); - } - return true; -} diff --git a/keyboards/facew/config.h b/keyboards/facew/config.h index 5966429cac9..14583dc8316 100644 --- a/keyboards/facew/config.h +++ b/keyboards/facew/config.h @@ -37,6 +37,9 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW #define DEBOUNCE 5 +#define LED_NUM_LOCK_PIN D0 +#define LED_CAPS_LOCK_PIN D1 + #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/facew/facew.c b/keyboards/facew/facew.c index 2f091ae6bdd..373dbc6cd6a 100644 --- a/keyboards/facew/facew.c +++ b/keyboards/facew/facew.c @@ -16,21 +16,3 @@ along with this program. If not, see . */ #include "facew.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D0); - setPinOutput(D1); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D0, led_state.num_lock); - writePin(D1, led_state.caps_lock); - } - return true; -} diff --git a/keyboards/foxlab/key65/hotswap/config.h b/keyboards/foxlab/key65/hotswap/config.h index a5ada6bd01c..43f883fce9a 100644 --- a/keyboards/foxlab/key65/hotswap/config.h +++ b/keyboards/foxlab/key65/hotswap/config.h @@ -45,6 +45,9 @@ /* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW +#define LED_SCROLL_LOCK_PIN E6 +#define LED_PIN_ON_STATE 0 + #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING #define BACKLIGHT_LEVELS 5 diff --git a/keyboards/foxlab/key65/hotswap/hotswap.c b/keyboards/foxlab/key65/hotswap/hotswap.c index 6b3950d3612..31fb011ad5e 100644 --- a/keyboards/foxlab/key65/hotswap/hotswap.c +++ b/keyboards/foxlab/key65/hotswap/hotswap.c @@ -15,20 +15,3 @@ */ #include "hotswap.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(E6); - writePinHigh(E6); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(E6, !led_state.caps_lock); - } - return true; -} diff --git a/keyboards/foxlab/key65/universal/config.h b/keyboards/foxlab/key65/universal/config.h index a3c01cd75bd..315af667629 100644 --- a/keyboards/foxlab/key65/universal/config.h +++ b/keyboards/foxlab/key65/universal/config.h @@ -45,6 +45,9 @@ /* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW +#define LED_SCROLL_LOCK_PIN E6 +#define LED_PIN_ON_STATE 0 + #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING #define BACKLIGHT_LEVELS 5 diff --git a/keyboards/foxlab/key65/universal/universal.c b/keyboards/foxlab/key65/universal/universal.c index 361f3ad7f21..5fa9e8f1717 100644 --- a/keyboards/foxlab/key65/universal/universal.c +++ b/keyboards/foxlab/key65/universal/universal.c @@ -15,20 +15,3 @@ */ #include "universal.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(E6); - writePinHigh(E6); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(E6, !led_state.caps_lock); - } - return true; -} diff --git a/keyboards/freyr/config.h b/keyboards/freyr/config.h index a4e34ea477c..d912b3cc1a3 100644 --- a/keyboards/freyr/config.h +++ b/keyboards/freyr/config.h @@ -47,6 +47,10 @@ along with this program. If not, see . /* COL2ROW, ROW2COL */ #define DIODE_DIRECTION COL2ROW +#define LED_CAPS_LOCK_PIN B3 +#define LED_SCROLL_LOCK_PIN B7 +#define LED_PIN_ON_STATE 0 + #define BACKLIGHT_PIN B6 #define BACKLIGHT_LEVELS 3 #define BACKLIGHT_BREATHING diff --git a/keyboards/freyr/freyr.c b/keyboards/freyr/freyr.c index 336b3271100..a856521e7f3 100644 --- a/keyboards/freyr/freyr.c +++ b/keyboards/freyr/freyr.c @@ -15,22 +15,3 @@ */ #include "freyr.h" - -void matrix_init_kb(void) { - matrix_init_user(); - led_init_ports(); -} - -void led_init_ports(void) { - setPinOutput(B3); - setPinOutput(B7); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(B3, !led_state.caps_lock); - writePin(B7, !led_state.scroll_lock); - } - - return true; -} diff --git a/keyboards/ft/mars80/config.h b/keyboards/ft/mars80/config.h index 3aabc926d83..e56d4439b36 100644 --- a/keyboards/ft/mars80/config.h +++ b/keyboards/ft/mars80/config.h @@ -37,6 +37,9 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW #define DEBOUNCE 5 +#define LED_CAPS_LOCK_PIN D1 +#define LED_SCROLL_LOCK_PIN D6 + #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/ft/mars80/mars80.c b/keyboards/ft/mars80/mars80.c index 2c628a6a236..5c95d04e355 100644 --- a/keyboards/ft/mars80/mars80.c +++ b/keyboards/ft/mars80/mars80.c @@ -15,21 +15,3 @@ */ #include "mars80.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D1); - setPinOutput(D6); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D1, led_state.caps_lock); - writePin(D6, led_state.scroll_lock); - } - return true; -} diff --git a/keyboards/gray_studio/hb85/config.h b/keyboards/gray_studio/hb85/config.h index 9309012a410..0e1f0aff42e 100644 --- a/keyboards/gray_studio/hb85/config.h +++ b/keyboards/gray_studio/hb85/config.h @@ -34,5 +34,9 @@ along with this program. If not, see . #define RGBLED_NUM 5 #define RGBLIGHT_ANIMATIONS +#define LED_NUM_LOCK_PIN D0 +#define LED_CAPS_LOCK_PIN D1 +#define LED_SCROLL_LOCK_PIN D6 + #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/gray_studio/hb85/hb85.c b/keyboards/gray_studio/hb85/hb85.c index 4b3ff64f1e0..964234d6b49 100644 --- a/keyboards/gray_studio/hb85/hb85.c +++ b/keyboards/gray_studio/hb85/hb85.c @@ -17,23 +17,3 @@ along with this program. If not, see . */ #include "hb85.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D0); - setPinOutput(D1); - setPinOutput(D6); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D0, led_state.num_lock); - writePin(D1, led_state.caps_lock); - writePin(D6, led_state.scroll_lock); - } - return true; -} diff --git a/keyboards/handwired/tritium_numpad/config.h b/keyboards/handwired/tritium_numpad/config.h index a53c27d43bc..1424c6b4918 100644 --- a/keyboards/handwired/tritium_numpad/config.h +++ b/keyboards/handwired/tritium_numpad/config.h @@ -36,6 +36,9 @@ along with this program. If not, see . #define MATRIX_COL_PINS { F4, F6, B1, B2 } #define UNUSED_PINS +#define LED_NUM_LOCK_PIN D5 +#define LED_PIN_ON_STATE 0 + #define BACKLIGHT_PIN B6 /* COL2ROW or ROW2COL */ diff --git a/keyboards/handwired/tritium_numpad/tritium_numpad.c b/keyboards/handwired/tritium_numpad/tritium_numpad.c index 7193a934d60..c9f86eda7e9 100644 --- a/keyboards/handwired/tritium_numpad/tritium_numpad.c +++ b/keyboards/handwired/tritium_numpad/tritium_numpad.c @@ -1,29 +1 @@ #include "tritium_numpad.h" -#include "led.h" - -void keyboard_pre_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - keyboard_pre_init_user(); - led_init_ports(); -}; - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - matrix_scan_user(); -}; - -void led_init_ports(void) { - // * Set our LED pins as output - // Numlock LED - setPinOutput(D5); -} - -void led_set_kb(uint8_t usb_led) { - if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { - writePinLow(D5); - } else { - writePinHigh(D5); - } -} diff --git a/keyboards/hid_liber/config.h b/keyboards/hid_liber/config.h index f35799b1ac0..e0f92dee842 100755 --- a/keyboards/hid_liber/config.h +++ b/keyboards/hid_liber/config.h @@ -34,6 +34,10 @@ // HID Liberation Device uses custom matrix code to accomodate a 74HC238 3 to 8 decoder on pins B1, B2 and B3. //#define DIODE_DIRECTION +#define LED_CAPS_LOCK_PIN B5 +#define LED_SCROLL_LOCK_PIN B6 +#define LED_PIN_ON_STATE 0 + // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/hid_liber/hid_liber.c b/keyboards/hid_liber/hid_liber.c index 2d2130743f1..2e4ddb32938 100755 --- a/keyboards/hid_liber/hid_liber.c +++ b/keyboards/hid_liber/hid_liber.c @@ -16,24 +16,3 @@ * along with this program. If not, see . */ #include "hid_liber.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - led_init_ports(); - matrix_init_user(); -} - -void led_init_ports(void) { - setPinOutput(B5); - setPinOutput(B6); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - writePin(B5, !led_state.caps_lock); - writePin(B6, !led_state.scroll_lock); - } - return res; -} diff --git a/keyboards/j80/config.h b/keyboards/j80/config.h index c4276431cf3..fb17a7fd1e8 100644 --- a/keyboards/j80/config.h +++ b/keyboards/j80/config.h @@ -35,6 +35,10 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW #define DEBOUNCE 5 +#define LED_NUM_LOCK_PIN D0 +#define LED_CAPS_LOCK_PIN D1 +#define LED_SCROLL_LOCK_PIN D6 + #define BACKLIGHT_LEVELS 3 #define BACKLIGHT_PIN D4 diff --git a/keyboards/j80/j80.c b/keyboards/j80/j80.c index bed30cdecc4..fd49e913e0f 100644 --- a/keyboards/j80/j80.c +++ b/keyboards/j80/j80.c @@ -15,23 +15,3 @@ */ #include "j80.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D0); - setPinOutput(D1); - setPinOutput(D6); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D0, led_state.num_lock); - writePin(D1, led_state.caps_lock); - writePin(D6, led_state.scroll_lock); - } - return true; -} diff --git a/keyboards/jc65/v32a/config.h b/keyboards/jc65/v32a/config.h index 6cf71ab3af0..d6907c96c33 100644 --- a/keyboards/jc65/v32a/config.h +++ b/keyboards/jc65/v32a/config.h @@ -32,6 +32,8 @@ along with this program. If not, see . #define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, D7 } #define DIODE_DIRECTION COL2ROW +#define LED_CAPS_LOCK_PIN D1 + #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/jc65/v32a/v32a.c b/keyboards/jc65/v32a/v32a.c index f195e8f61e9..aa7233ba2ac 100644 --- a/keyboards/jc65/v32a/v32a.c +++ b/keyboards/jc65/v32a/v32a.c @@ -16,19 +16,3 @@ along with this program. If not, see . */ #include "v32a.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D1); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D1, led_state.caps_lock); - } - return true; -} diff --git a/keyboards/kb_elmo/aek2_usb/aek2_usb.c b/keyboards/kb_elmo/aek2_usb/aek2_usb.c index b83faf5dad5..6ce5d21df7a 100644 --- a/keyboards/kb_elmo/aek2_usb/aek2_usb.c +++ b/keyboards/kb_elmo/aek2_usb/aek2_usb.c @@ -15,23 +15,3 @@ */ #include "aek2_usb.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(B0); - setPinOutput(B1); - setPinOutput(B2); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(B0, led_state.scroll_lock); - writePin(B1, led_state.caps_lock); - writePin(B2, led_state.num_lock); - } - return true; -} \ No newline at end of file diff --git a/keyboards/kb_elmo/aek2_usb/config.h b/keyboards/kb_elmo/aek2_usb/config.h index e0fc83f17ad..cf8c9d66f9a 100644 --- a/keyboards/kb_elmo/aek2_usb/config.h +++ b/keyboards/kb_elmo/aek2_usb/config.h @@ -40,6 +40,10 @@ along with this program. If not, see . /* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW +#define LED_NUM_LOCK_PIN B2 +#define LED_CAPS_LOCK_PIN B1 +#define LED_SCROLL_LOCK_PIN B0 + /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ #define DEBOUNCE 5 diff --git a/keyboards/kbdfans/kbdpad/mk1/config.h b/keyboards/kbdfans/kbdpad/mk1/config.h index 1646a1af1fa..80a1abef570 100644 --- a/keyboards/kbdfans/kbdpad/mk1/config.h +++ b/keyboards/kbdfans/kbdpad/mk1/config.h @@ -33,6 +33,8 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW +#define LED_NUM_LOCK_PIN D0 + #define BACKLIGHT_PIN D4 #define BACKLIGHT_BREATHING diff --git a/keyboards/kbdfans/kbdpad/mk1/mk1.c b/keyboards/kbdfans/kbdpad/mk1/mk1.c index 540ba358925..5635b0a589f 100644 --- a/keyboards/kbdfans/kbdpad/mk1/mk1.c +++ b/keyboards/kbdfans/kbdpad/mk1/mk1.c @@ -15,19 +15,3 @@ */ #include "mk1.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D0); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D0, led_state.num_lock); - } - return true; -} diff --git a/keyboards/kinesis/kint2pp/config.h b/keyboards/kinesis/kint2pp/config.h index 2acaf9be6e5..902c9b24a06 100644 --- a/keyboards/kinesis/kint2pp/config.h +++ b/keyboards/kinesis/kint2pp/config.h @@ -25,7 +25,12 @@ /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW - + +#define LED_NUM_LOCK_PIN C5 +#define LED_CAPS_LOCK_PIN C1 +#define LED_SCROLL_LOCK_PIN C4 +#define LED_COMPOSE_PIN C3 +#define LED_PIN_ON_STATE 0 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ #define DEBOUNCE 5 diff --git a/keyboards/kinesis/kint2pp/kint2pp.c b/keyboards/kinesis/kint2pp/kint2pp.c index 7e2b4348c55..856e29c31ef 100644 --- a/keyboards/kinesis/kint2pp/kint2pp.c +++ b/keyboards/kinesis/kint2pp/kint2pp.c @@ -1,26 +1 @@ #include "kint2pp.h" - -void matrix_init_kb(void) { - led_init_ports(); - - - matrix_init_user(); -} -void led_init_ports() { - // * Set our LED pins as output - setPinOutput(C3); // Keypad LED - setPinOutput(C4); // ScrLock LED - setPinOutput(C5); // NumLock LED - setPinOutput(C1); // CapsLock LED -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - writePin(C3, !led_state.compose); - writePin(C4, !led_state.scroll_lock); - writePin(C5, !led_state.num_lock); - writePin(C1, !led_state.caps_lock); - } - return res; -} diff --git a/keyboards/kinesis/nguyenvietyen/config.h b/keyboards/kinesis/nguyenvietyen/config.h index f221acd7e71..52f4c8054ba 100644 --- a/keyboards/kinesis/nguyenvietyen/config.h +++ b/keyboards/kinesis/nguyenvietyen/config.h @@ -25,3 +25,9 @@ /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW + +#define LED_NUM_LOCK_PIN D4 +#define LED_CAPS_LOCK_PIN E6 +#define LED_SCROLL_LOCK_PIN C6 +#define LED_COMPOSE_PIN D7 +#define LED_PIN_ON_STATE 0 diff --git a/keyboards/kinesis/nguyenvietyen/nguyenvietyen.c b/keyboards/kinesis/nguyenvietyen/nguyenvietyen.c index 1919412e936..3f014793890 100644 --- a/keyboards/kinesis/nguyenvietyen/nguyenvietyen.c +++ b/keyboards/kinesis/nguyenvietyen/nguyenvietyen.c @@ -1,31 +1 @@ #include "nguyenvietyen.h" - -void matrix_init_kb(void) { - led_init_ports(); - matrix_init_user(); -} - -void led_init_ports() { - // * Set our LED pins as output - setPinOutput(D7); // Keypad LED - setPinOutput(C6); // ScrLock LED - setPinOutput(D4); // NumLock LED - setPinOutput(E6); // CapsLock LED - - // turn all LEDs off by default - writePinHigh(D7); - writePinHigh(C6); - writePinHigh(D4); - writePinHigh(E6); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if (res) { - writePin(D7, !led_state.compose); - writePin(C6, !led_state.scroll_lock); - writePin(D4, !led_state.num_lock); - writePin(E6, !led_state.caps_lock); - } - return res; -} diff --git a/keyboards/kira80/config.h b/keyboards/kira80/config.h index 725b68d6e66..d61d23ab614 100644 --- a/keyboards/kira80/config.h +++ b/keyboards/kira80/config.h @@ -38,6 +38,9 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW #define DEBOUNCE 5 +#define LED_CAPS_LOCK_PIN D1 +#define LED_SCROLL_LOCK_PIN D6 + #define BACKLIGHT_PIN D4 #define BACKLIGHT_BREATHING #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/kira80/kira80.c b/keyboards/kira80/kira80.c index a76f4001efa..b3ebcae29aa 100644 --- a/keyboards/kira80/kira80.c +++ b/keyboards/kira80/kira80.c @@ -15,21 +15,3 @@ */ #include "kira80.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D1); - setPinOutput(D6); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D1, led_state.caps_lock); - writePin(D6, led_state.scroll_lock); - } - return true; -} \ No newline at end of file diff --git a/keyboards/kona_classic/kona_classic.c b/keyboards/kona_classic/kona_classic.c index 71cee7baafb..af4ea06e6d3 100644 --- a/keyboards/kona_classic/kona_classic.c +++ b/keyboards/kona_classic/kona_classic.c @@ -14,32 +14,3 @@ * along with this program. If not, see . */ #include "kona_classic.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - led_init_ports(); - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_init_ports(void) { -// DDRB |= (1<<6) | (1<<7); // OUT -} - -void led_set_kb(uint8_t usb_led) { -// led_set_user(usb_led); -} diff --git a/keyboards/mechlovin/adelais/adelais.c b/keyboards/mechlovin/adelais/adelais.c index da5f68f62bf..b9df471d335 100644 --- a/keyboards/mechlovin/adelais/adelais.c +++ b/keyboards/mechlovin/adelais/adelais.c @@ -15,30 +15,3 @@ */ #include "adelais.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); - led_init_ports(); -} - -void led_init_ports(void) { - setPinOutput(B2); - writePinLow(B2); - setPinOutput(C15); - writePinLow(C15); - setPinOutput(B9); - writePinLow(B9); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - writePin(B2, led_state.caps_lock); - writePin(B9, led_state.scroll_lock); - writePin(C15, led_state.num_lock); - } - - return true; -} diff --git a/keyboards/mechlovin/adelais/config.h b/keyboards/mechlovin/adelais/config.h index 875eba51487..3ec5c491327 100644 --- a/keyboards/mechlovin/adelais/config.h +++ b/keyboards/mechlovin/adelais/config.h @@ -30,3 +30,7 @@ along with this program. If not, see . /* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW + +#define LED_NUM_LOCK_PIN C15 +#define LED_CAPS_LOCK_PIN B2 +#define LED_SCROLL_LOCK_PIN B9 diff --git a/keyboards/mechlovin/delphine/config.h b/keyboards/mechlovin/delphine/config.h index b3a084f67e7..a642f37f9ba 100644 --- a/keyboards/mechlovin/delphine/config.h +++ b/keyboards/mechlovin/delphine/config.h @@ -41,4 +41,6 @@ along with this program. If not, see . #define MATRIX_ROW_PINS { F0, F1, F4, F5, F6, D3 } #define MATRIX_COL_PINS { F7, D7, D6, D2 } -#define DIODE_DIRECTION COL2ROW \ No newline at end of file +#define DIODE_DIRECTION COL2ROW + +#define LED_NUM_LOCK_PIN B5 diff --git a/keyboards/mechlovin/delphine/delphine.c b/keyboards/mechlovin/delphine/delphine.c index 52292b3c922..8e33b6603c9 100644 --- a/keyboards/mechlovin/delphine/delphine.c +++ b/keyboards/mechlovin/delphine/delphine.c @@ -15,21 +15,3 @@ */ #include "delphine.h" - -void matrix_init_kb(void) { - matrix_init_user(); - led_init_ports(); -} - -void led_init_ports(void) { - setPinOutput(B5); - writePinLow(B5); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - writePin(B5, led_state.num_lock); - } - - return true; -} diff --git a/keyboards/mechlovin/hannah65/config.h b/keyboards/mechlovin/hannah65/config.h index 6801c30a3d3..8c94fe4b35b 100644 --- a/keyboards/mechlovin/hannah65/config.h +++ b/keyboards/mechlovin/hannah65/config.h @@ -41,6 +41,8 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW +#define LED_CAPS_LOCK_PIN B9 + #define BACKLIGHT_PIN B8 #define BACKLIGHT_BREATHING #define BACKLIGHT_PWM_DRIVER PWMD3 diff --git a/keyboards/mechlovin/hannah65/hannah65.c b/keyboards/mechlovin/hannah65/hannah65.c index 4f937d8a2af..92e0917ebe0 100644 --- a/keyboards/mechlovin/hannah65/hannah65.c +++ b/keyboards/mechlovin/hannah65/hannah65.c @@ -15,21 +15,3 @@ */ #include "hannah65.h" - -void matrix_init_kb(void) { - matrix_init_user(); - led_init_ports(); -} - -void led_init_ports(void) { - setPinOutput(B9); - writePinLow(B9); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - writePin(B9, led_state.caps_lock); - } - - return true; -} diff --git a/keyboards/mechlovin/infinity87/config.h b/keyboards/mechlovin/infinity87/config.h index 703a06f8de9..ccb9f675667 100644 --- a/keyboards/mechlovin/infinity87/config.h +++ b/keyboards/mechlovin/infinity87/config.h @@ -45,6 +45,8 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW +#define LED_NUM_LOCK_PIN A3 +#define LED_CAPS_LOCK_PIN A4 #define BACKLIGHT_PIN B0 #define BACKLIGHT_BREATHING diff --git a/keyboards/mechlovin/infinity87/infinity87.c b/keyboards/mechlovin/infinity87/infinity87.c index 2de528bc366..434e7960915 100644 --- a/keyboards/mechlovin/infinity87/infinity87.c +++ b/keyboards/mechlovin/infinity87/infinity87.c @@ -15,24 +15,3 @@ */ #include "infinity87.h" - -void matrix_init_kb(void) { - matrix_init_user(); - led_init_ports(); -} - -void led_init_ports(void) { - setPinOutput(A3); - writePinLow(A3); - setPinOutput(A4); - writePinLow(A4); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - writePin(A4, led_state.caps_lock); - writePin(A3, led_state.num_lock); - } - - return true; -} diff --git a/keyboards/mechlovin/infinity88/config.h b/keyboards/mechlovin/infinity88/config.h index df1ea4957b9..a387b763865 100644 --- a/keyboards/mechlovin/infinity88/config.h +++ b/keyboards/mechlovin/infinity88/config.h @@ -45,6 +45,8 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW +#define LED_NUM_LOCK_PIN A3 +#define LED_CAPS_LOCK_PIN A4 #define BACKLIGHT_PIN B0 #define BACKLIGHT_BREATHING diff --git a/keyboards/mechlovin/infinity88/infinity88.c b/keyboards/mechlovin/infinity88/infinity88.c index d342ce9eea7..4d352358a76 100644 --- a/keyboards/mechlovin/infinity88/infinity88.c +++ b/keyboards/mechlovin/infinity88/infinity88.c @@ -15,25 +15,3 @@ */ #include "infinity88.h" - -void matrix_init_kb(void) { - matrix_init_user(); - led_init_ports(); -} - -void led_init_ports(void) { - setPinOutput(A3); - writePinLow(A3); - setPinOutput(A4); - writePinLow(A4); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - writePin(A4, led_state.caps_lock); - writePin(A3, led_state.num_lock); - } - - return true; -} - diff --git a/keyboards/mechlovin/pisces/config.h b/keyboards/mechlovin/pisces/config.h index 14f6404a7fb..1debf021c80 100644 --- a/keyboards/mechlovin/pisces/config.h +++ b/keyboards/mechlovin/pisces/config.h @@ -45,6 +45,8 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW +#define LED_CAPS_LOCK_PIN B2 + #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/mechlovin/pisces/pisces.c b/keyboards/mechlovin/pisces/pisces.c index 2a0a97f6d40..b43bf2aaa4f 100644 --- a/keyboards/mechlovin/pisces/pisces.c +++ b/keyboards/mechlovin/pisces/pisces.c @@ -15,28 +15,3 @@ */ #include "pisces.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 - - matrix_init_user(); - led_init_ports(); -} - -void led_init_ports(void) { - setPinOutput(B2); - writePinLow(B2); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - writePin(B2, led_state.caps_lock); - } - - return true; -} diff --git a/keyboards/mehkee96/config.h b/keyboards/mehkee96/config.h index dc8c593ada9..44ded13a575 100644 --- a/keyboards/mehkee96/config.h +++ b/keyboards/mehkee96/config.h @@ -16,6 +16,10 @@ #define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, D7 } #define DIODE_DIRECTION COL2ROW +#define LED_NUM_LOCK_PIN D0 +#define LED_CAPS_LOCK_PIN D1 +#define LED_PIN_ON_STATE 0 + #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/mehkee96/mehkee96.c b/keyboards/mehkee96/mehkee96.c index ae83a1bb50d..d9e2bac7a59 100644 --- a/keyboards/mehkee96/mehkee96.c +++ b/keyboards/mehkee96/mehkee96.c @@ -16,21 +16,3 @@ along with this program. If not, see . */ #include "mehkee96.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D0); - setPinOutput(D1); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D0, led_state.num_lock); - writePin(D1, led_state.caps_lock); - } - return true; -} diff --git a/keyboards/nightly_boards/alter/rev1/config.h b/keyboards/nightly_boards/alter/rev1/config.h index 30fe4b52124..4f9bade717e 100644 --- a/keyboards/nightly_boards/alter/rev1/config.h +++ b/keyboards/nightly_boards/alter/rev1/config.h @@ -44,6 +44,10 @@ along with this program. If not, see . /* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW +#define LED_NUM_LOCK_PIN D7 +#define LED_CAPS_LOCK_PIN D6 +#define LED_SCROLL_LOCK_PIN B4 + // #define BACKLIGHT_PIN F1 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/nightly_boards/alter/rev1/rev1.c b/keyboards/nightly_boards/alter/rev1/rev1.c index df3dd6aed88..b250d32d12c 100644 --- a/keyboards/nightly_boards/alter/rev1/rev1.c +++ b/keyboards/nightly_boards/alter/rev1/rev1.c @@ -15,23 +15,3 @@ */ #include "rev1.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D7); - setPinOutput(D6); - setPinOutput(B4); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D7, led_state.num_lock); - writePin(D6, led_state.caps_lock); - writePin(B4, led_state.scroll_lock); - } - return true; -} diff --git a/keyboards/panc60/config.h b/keyboards/panc60/config.h index 002ff7cf967..495f5a2d4d3 100644 --- a/keyboards/panc60/config.h +++ b/keyboards/panc60/config.h @@ -37,6 +37,8 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW #define DEBOUNCE 5 +#define LED_CAPS_LOCK_PIN D1 + #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/panc60/panc60.c b/keyboards/panc60/panc60.c index d7ff52963cc..16f298eb8d8 100644 --- a/keyboards/panc60/panc60.c +++ b/keyboards/panc60/panc60.c @@ -15,19 +15,3 @@ */ #include "panc60.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D1); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D1, led_state.caps_lock); - } - return true; -} diff --git a/keyboards/pandora/config.h b/keyboards/pandora/config.h index 873f6dd150b..3a44129c49a 100644 --- a/keyboards/pandora/config.h +++ b/keyboards/pandora/config.h @@ -47,6 +47,9 @@ along with this program. If not, see . /* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW +#define LED_CAPS_LOCK_PIN E6 +#define LED_PIN_ON_STATE 0 + /* Encoder Function */ #define ENCODERS_PAD_A { F6 } #define ENCODERS_PAD_B { F5 } diff --git a/keyboards/pandora/pandora.c b/keyboards/pandora/pandora.c index 6c5d8a166fd..3d166646b8c 100644 --- a/keyboards/pandora/pandora.c +++ b/keyboards/pandora/pandora.c @@ -15,21 +15,3 @@ */ #include "pandora.h" - -void matrix_init_kb(void) { - matrix_init_user(); - led_init_ports(); -}; - -void led_init_ports(void) { - setPinOutput(E6); - writePinHigh(E6); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - writePin(E6, !led_state.caps_lock); - } - return res; -} diff --git a/keyboards/pearl/config.h b/keyboards/pearl/config.h index a42b0a5fa52..09e0c8e1e41 100644 --- a/keyboards/pearl/config.h +++ b/keyboards/pearl/config.h @@ -25,6 +25,10 @@ along with this program. If not, see . #define MANUFACTURER Pearl Boards #define PRODUCT Pearl +#define LED_NUM_LOCK_PIN D0 +#define LED_CAPS_LOCK_PIN D1 +#define LED_SCROLL_LOCK_PIN D6 + #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 12 diff --git a/keyboards/pearl/pearl.c b/keyboards/pearl/pearl.c index b08ee6f8880..18ed9835d88 100644 --- a/keyboards/pearl/pearl.c +++ b/keyboards/pearl/pearl.c @@ -16,23 +16,3 @@ along with this program. If not, see . */ #include "pearl.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D0); - setPinOutput(D1); - setPinOutput(D6); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D0, led_state.num_lock); - writePin(D1, led_state.caps_lock); - writePin(D6, led_state.scroll_lock); - } - return true; -} diff --git a/keyboards/percent/canoe/canoe.c b/keyboards/percent/canoe/canoe.c index dd31640e6d9..572ff50b010 100644 --- a/keyboards/percent/canoe/canoe.c +++ b/keyboards/percent/canoe/canoe.c @@ -16,19 +16,3 @@ along with this program. If not, see . */ #include "canoe.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D1); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D1, led_state.caps_lock); - } - return true; -} diff --git a/keyboards/percent/canoe/config.h b/keyboards/percent/canoe/config.h index b8a306b7e16..c349c1106c7 100644 --- a/keyboards/percent/canoe/config.h +++ b/keyboards/percent/canoe/config.h @@ -38,6 +38,8 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW #define DEBOUNCE 5 +#define LED_CAPS_LOCK_PIN D1 + #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/percent/skog/config.h b/keyboards/percent/skog/config.h index 047bac02e82..524fdc5ccfd 100644 --- a/keyboards/percent/skog/config.h +++ b/keyboards/percent/skog/config.h @@ -32,6 +32,9 @@ along with this program. If not, see . #define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2 } #define DIODE_DIRECTION COL2ROW +#define LED_CAPS_LOCK_PIN D1 +#define LED_SCROLL_LOCK_PIN D6 + #define RGBLED_NUM 2 #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/percent/skog/skog.c b/keyboards/percent/skog/skog.c index 152fc568450..c44f0373fbf 100644 --- a/keyboards/percent/skog/skog.c +++ b/keyboards/percent/skog/skog.c @@ -18,21 +18,3 @@ ps2avrGB support code by Kenneth A. (bminiex/.[ch]) */ #include "skog.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D1); - setPinOutput(D6); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D1, led_state.caps_lock); - writePin(D6, led_state.scroll_lock); - } - return true; -} diff --git a/keyboards/percent/skog_lite/config.h b/keyboards/percent/skog_lite/config.h index e28dcfcd2f3..15de9bbb898 100644 --- a/keyboards/percent/skog_lite/config.h +++ b/keyboards/percent/skog_lite/config.h @@ -38,6 +38,9 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW #define DEBOUNCE 5 +#define LED_CAPS_LOCK_PIN D1 +#define LED_SCROLL_LOCK_PIN D6 + #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/percent/skog_lite/skog_lite.c b/keyboards/percent/skog_lite/skog_lite.c index 95d39821130..c69843e617e 100644 --- a/keyboards/percent/skog_lite/skog_lite.c +++ b/keyboards/percent/skog_lite/skog_lite.c @@ -15,21 +15,3 @@ */ #include "skog_lite.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D1); - setPinOutput(D6); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D1, led_state.caps_lock); - writePin(D6, led_state.scroll_lock); - } - return true; -} diff --git a/keyboards/phantom/config.h b/keyboards/phantom/config.h index a5d135a4bf7..a948987d18c 100644 --- a/keyboards/phantom/config.h +++ b/keyboards/phantom/config.h @@ -47,6 +47,9 @@ along with this program. If not, see . /* COL2ROW, ROW2COL */ #define DIODE_DIRECTION ROW2COL +#define LED_CAPS_LOCK_PIN B6 +#define LED_SCROLL_LOCK_PIN B7 + // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_LEVELS 3 // #define BACKLIGHT_BREATHING diff --git a/keyboards/phantom/phantom.c b/keyboards/phantom/phantom.c index 1017de0093c..5c478f82aad 100644 --- a/keyboards/phantom/phantom.c +++ b/keyboards/phantom/phantom.c @@ -15,23 +15,3 @@ */ #include "phantom.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(B6); - setPinOutput(B7); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(B6, led_state.caps_lock); - writePin(B7, led_state.scroll_lock); - } - - return true; -} diff --git a/keyboards/rart/rartlice/config.h b/keyboards/rart/rartlice/config.h index 26f9324bd8f..fc6fbaa117a 100644 --- a/keyboards/rart/rartlice/config.h +++ b/keyboards/rart/rartlice/config.h @@ -43,6 +43,11 @@ along with this program. If not, see . /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE +#define LED_NUM_LOCK_PIN A8 +#define LED_CAPS_LOCK_PIN B14 +#define LED_SCROLL_LOCK_PIN A9 +#define LED_PIN_ON_STATE 0 + #define RGBLIGHT_ANIMATIONS #define RGB_DI_PIN B15 #define RGBLED_NUM 11 diff --git a/keyboards/rart/rartlice/rartlice.c b/keyboards/rart/rartlice/rartlice.c index be805da33e6..a970e968679 100644 --- a/keyboards/rart/rartlice/rartlice.c +++ b/keyboards/rart/rartlice/rartlice.c @@ -14,23 +14,3 @@ */ #include "rartlice.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(A8); - setPinOutput(B14); - setPinOutput(A9); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(A8, !led_state.num_lock); - writePin(B14, !led_state.caps_lock); - writePin(A9, !led_state.scroll_lock); - } - return true; -} diff --git a/keyboards/redscarf_iiplus/verd/config.h b/keyboards/redscarf_iiplus/verd/config.h index 06d606f557a..abc3ae37809 100644 --- a/keyboards/redscarf_iiplus/verd/config.h +++ b/keyboards/redscarf_iiplus/verd/config.h @@ -52,6 +52,10 @@ along with this program. If not, see . */ //#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 +#define LED_NUM_LOCK_PIN E6 +#define LED_CAPS_LOCK_PIN C6 +#define LED_PIN_ON_STATE 0 + #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/redscarf_iiplus/verd/verd.c b/keyboards/redscarf_iiplus/verd/verd.c index c16a5a97407..fa5ef6bd2b6 100644 --- a/keyboards/redscarf_iiplus/verd/verd.c +++ b/keyboards/redscarf_iiplus/verd/verd.c @@ -13,30 +13,3 @@ * along with this program. If not, see . */ #include "verd.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 - - matrix_init_user(); - led_init_ports(); -} - -void led_init_ports(void) { - setPinOutput(C7); - writePinHigh(C7); - setPinOutput(E6); - writePinHigh(E6); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(C7, !led_state.caps_lock); - writePin(E6, !led_state.num_lock); - } - return true; -} diff --git a/keyboards/reversestudio/decadepad/config.h b/keyboards/reversestudio/decadepad/config.h index 78fd40c405b..383a539d787 100644 --- a/keyboards/reversestudio/decadepad/config.h +++ b/keyboards/reversestudio/decadepad/config.h @@ -42,6 +42,9 @@ along with this program. If not, see . /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST +#define LED_NUM_LOCK_PIN D4 +#define LED_PIN_ON_STATE 0 + /* number of backlight levels */ /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 diff --git a/keyboards/reversestudio/decadepad/decadepad.c b/keyboards/reversestudio/decadepad/decadepad.c index 32a66e295cb..699a4476bb1 100644 --- a/keyboards/reversestudio/decadepad/decadepad.c +++ b/keyboards/reversestudio/decadepad/decadepad.c @@ -1,16 +1 @@ #include "decadepad.h" -void matrix_init_kb(void) { - led_init_ports(); - matrix_init_user(); -}; - -void led_init_ports(void) { - setPinOutput(D4); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)){ - writePin(D4, !led_state.num_lock); - } - return true; -} \ No newline at end of file diff --git a/keyboards/singa/config.h b/keyboards/singa/config.h index 408f88b2a43..1d3ed105e16 100644 --- a/keyboards/singa/config.h +++ b/keyboards/singa/config.h @@ -37,6 +37,8 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW #define DEBOUNCE 5 +#define LED_CAPS_LOCK_PIN D1 + #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/singa/singa.c b/keyboards/singa/singa.c index 360b214a31d..8605d6f471d 100644 --- a/keyboards/singa/singa.c +++ b/keyboards/singa/singa.c @@ -15,19 +15,3 @@ */ #include "singa.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D1); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D1, led_state.caps_lock); - } - return true; -} diff --git a/keyboards/stella/config.h b/keyboards/stella/config.h index 04ba08239c4..512b7571d54 100644 --- a/keyboards/stella/config.h +++ b/keyboards/stella/config.h @@ -47,6 +47,10 @@ along with this program. If not, see . /* COL2ROW, ROW2COL */ #define DIODE_DIRECTION COL2ROW +#define LED_CAPS_LOCK_PIN B3 +#define LED_SCROLL_LOCK_PIN B7 +#define LED_PIN_ON_STATE 0 + #define BACKLIGHT_PIN B6 #define BACKLIGHT_LEVELS 3 #define BACKLIGHT_BREATHING diff --git a/keyboards/stella/stella.c b/keyboards/stella/stella.c index 363c327d6b1..5eb55b36687 100644 --- a/keyboards/stella/stella.c +++ b/keyboards/stella/stella.c @@ -15,22 +15,3 @@ */ #include "stella.h" - -void matrix_init_kb(void) { - matrix_init_user(); - led_init_ports(); -}; - -void led_init_ports(void) { - setPinOutput(B3); - setPinOutput(B7); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(B3, !led_state.caps_lock); - writePin(B7, !led_state.scroll_lock); - } - - return true; -} diff --git a/keyboards/tgr/910/910.c b/keyboards/tgr/910/910.c index 63b4a13f7de..8e0c7853859 100644 --- a/keyboards/tgr/910/910.c +++ b/keyboards/tgr/910/910.c @@ -15,23 +15,3 @@ */ #include "910.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D0); - setPinOutput(D1); - setPinOutput(D6); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D0, led_state.num_lock); - writePin(D1, led_state.caps_lock); - writePin(D6, led_state.scroll_lock); - } - return true; -} diff --git a/keyboards/tgr/910/config.h b/keyboards/tgr/910/config.h index 8cd46a413a3..7ba412be355 100644 --- a/keyboards/tgr/910/config.h +++ b/keyboards/tgr/910/config.h @@ -38,6 +38,10 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW #define DEBOUNCE 5 +#define LED_NUM_LOCK_PIN D0 +#define LED_CAPS_LOCK_PIN D1 +#define LED_SCROLL_LOCK_PIN D6 + #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/tgr/910ce/910ce.c b/keyboards/tgr/910ce/910ce.c index 4b39131794d..7538158c89a 100644 --- a/keyboards/tgr/910ce/910ce.c +++ b/keyboards/tgr/910ce/910ce.c @@ -15,19 +15,3 @@ */ #include "910ce.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D1); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D1, led_state.caps_lock); - } - return true; -} \ No newline at end of file diff --git a/keyboards/tgr/910ce/config.h b/keyboards/tgr/910ce/config.h index 6d3fe7a4948..fd21a2de768 100644 --- a/keyboards/tgr/910ce/config.h +++ b/keyboards/tgr/910ce/config.h @@ -38,6 +38,8 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW #define DEBOUNCE 5 +#define LED_CAPS_LOCK_PIN D1 + #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 3 #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/tgr/alice/alice.c b/keyboards/tgr/alice/alice.c index a4a5c787c61..39aed2cf567 100644 --- a/keyboards/tgr/alice/alice.c +++ b/keyboards/tgr/alice/alice.c @@ -16,23 +16,3 @@ along with this program. If not, see . */ #include "alice.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D0); - setPinOutput(D1); - setPinOutput(D6); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D0, led_state.num_lock); - writePin(D1, led_state.caps_lock); - writePin(D6, led_state.scroll_lock); - } - return true; -} diff --git a/keyboards/tgr/alice/config.h b/keyboards/tgr/alice/config.h index 20f4c5970e1..26ed2e79730 100644 --- a/keyboards/tgr/alice/config.h +++ b/keyboards/tgr/alice/config.h @@ -31,6 +31,10 @@ along with this program. If not, see . #define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, D7 } #define DIODE_DIRECTION COL2ROW +#define LED_NUM_LOCK_PIN D0 +#define LED_CAPS_LOCK_PIN D1 +#define LED_SCROLL_LOCK_PIN D6 + #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/tgr/jane/config.h b/keyboards/tgr/jane/config.h index ed8b39c38a3..0132a716d34 100644 --- a/keyboards/tgr/jane/config.h +++ b/keyboards/tgr/jane/config.h @@ -36,5 +36,8 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW #define DEBOUNCE 5 +#define LED_CAPS_LOCK_PIN D1 +#define LED_SCROLL_LOCK_PIN D6 + #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/tgr/jane/jane.c b/keyboards/tgr/jane/jane.c index fabdc0e90c2..d4cdebaa259 100644 --- a/keyboards/tgr/jane/jane.c +++ b/keyboards/tgr/jane/jane.c @@ -15,21 +15,3 @@ */ #include "jane.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D1); - setPinOutput(D6); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D1, led_state.caps_lock); - writePin(D6, led_state.scroll_lock); - } - return true; -} diff --git a/keyboards/tgr/tris/config.h b/keyboards/tgr/tris/config.h index 4ae3b967cce..16e862a222b 100644 --- a/keyboards/tgr/tris/config.h +++ b/keyboards/tgr/tris/config.h @@ -34,6 +34,8 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW #define DEBOUNCE 5 +#define LED_NUM_LOCK_PIN D0 + #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/tgr/tris/tris.c b/keyboards/tgr/tris/tris.c index f354d7a3934..c2147b29c60 100644 --- a/keyboards/tgr/tris/tris.c +++ b/keyboards/tgr/tris/tris.c @@ -15,19 +15,3 @@ */ #include "tris.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D0); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D0, led_state.num_lock); - } - return true; -} diff --git a/keyboards/unikorn/config.h b/keyboards/unikorn/config.h index c68a857d5e9..1029a777bbc 100644 --- a/keyboards/unikorn/config.h +++ b/keyboards/unikorn/config.h @@ -36,6 +36,8 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW #define DEBOUNCE 5 +#define LED_CAPS_LOCK_PIN D1 + #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/unikorn/unikorn.c b/keyboards/unikorn/unikorn.c index c2c85eb984a..d803ebf9da1 100644 --- a/keyboards/unikorn/unikorn.c +++ b/keyboards/unikorn/unikorn.c @@ -15,19 +15,3 @@ */ #include "unikorn.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D1); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D1, led_state.caps_lock); - } - return true; -} diff --git a/keyboards/vn66/config.h b/keyboards/vn66/config.h index e30c1b19d34..d8095418417 100644 --- a/keyboards/vn66/config.h +++ b/keyboards/vn66/config.h @@ -47,6 +47,9 @@ along with this program. If not, see . /* COL2ROW, ROW2COL */ #define DIODE_DIRECTION COL2ROW +#define LED_CAPS_LOCK_PIN E6 +#define LED_PIN_ON_STATE 0 + #define BACKLIGHT_PIN B6 #define BACKLIGHT_LEVELS 4 #define BACKLIGHT_BREATHING diff --git a/keyboards/vn66/vn66.c b/keyboards/vn66/vn66.c index 77fe23aefe3..5631359040a 100644 --- a/keyboards/vn66/vn66.c +++ b/keyboards/vn66/vn66.c @@ -15,20 +15,3 @@ */ #include "vn66.h" - -void matrix_init_kb(void) { - led_init_ports(); - matrix_init_user(); -} - -void led_init_ports(void) { - setPinOutput(E6); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(E6, !led_state.caps_lock); - } - - return true; -} diff --git a/keyboards/winkeyless/bface/bface.c b/keyboards/winkeyless/bface/bface.c index 7d27096bad1..c1fcbe53b2f 100644 --- a/keyboards/winkeyless/bface/bface.c +++ b/keyboards/winkeyless/bface/bface.c @@ -15,23 +15,3 @@ */ #include "bface.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D0); - setPinOutput(D1); - setPinOutput(D6); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D0, led_state.num_lock); - writePin(D1, led_state.caps_lock); - writePin(D6, led_state.scroll_lock); - } - return true; -} diff --git a/keyboards/winkeyless/bface/config.h b/keyboards/winkeyless/bface/config.h index 27ee761e9b7..83fcfa0276e 100644 --- a/keyboards/winkeyless/bface/config.h +++ b/keyboards/winkeyless/bface/config.h @@ -35,6 +35,10 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW +#define LED_NUM_LOCK_PIN D0 +#define LED_CAPS_LOCK_PIN D1 +#define LED_SCROLL_LOCK_PIN D6 + #define RGBLED_NUM 16 #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/winkeyless/bmini/bmini.c b/keyboards/winkeyless/bmini/bmini.c index 6529d440333..f44fd36a8cc 100644 --- a/keyboards/winkeyless/bmini/bmini.c +++ b/keyboards/winkeyless/bmini/bmini.c @@ -16,23 +16,3 @@ along with this program. If not, see . */ #include "bmini.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D0); - setPinOutput(D1); - setPinOutput(D6); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D0, led_state.num_lock); - writePin(D1, led_state.caps_lock); - writePin(D6, led_state.scroll_lock); - } - return true; -} diff --git a/keyboards/winkeyless/bmini/config.h b/keyboards/winkeyless/bmini/config.h index 6e91241af8e..1f7759faf9d 100644 --- a/keyboards/winkeyless/bmini/config.h +++ b/keyboards/winkeyless/bmini/config.h @@ -34,6 +34,10 @@ along with this program. If not, see . #define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, D7 } #define DIODE_DIRECTION COL2ROW +#define LED_NUM_LOCK_PIN D0 +#define LED_CAPS_LOCK_PIN D1 +#define LED_SCROLL_LOCK_PIN D6 + #define RGBLIGHT_ANIMATIONS #define BACKLIGHT_PIN D4 diff --git a/keyboards/winkeyless/bminiex/bminiex.c b/keyboards/winkeyless/bminiex/bminiex.c index 676f88ebf53..db127e030de 100644 --- a/keyboards/winkeyless/bminiex/bminiex.c +++ b/keyboards/winkeyless/bminiex/bminiex.c @@ -16,23 +16,3 @@ along with this program. If not, see . */ #include "bminiex.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D0); - setPinOutput(D1); - setPinOutput(D6); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D0, led_state.num_lock); - writePin(D1, led_state.caps_lock); - writePin(D6, led_state.scroll_lock); - } - return true; -} diff --git a/keyboards/winkeyless/bminiex/config.h b/keyboards/winkeyless/bminiex/config.h index 7c9c11c1116..412d10a2aab 100644 --- a/keyboards/winkeyless/bminiex/config.h +++ b/keyboards/winkeyless/bminiex/config.h @@ -34,6 +34,10 @@ along with this program. If not, see . #define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, D7 } #define DIODE_DIRECTION COL2ROW +#define LED_NUM_LOCK_PIN D0 +#define LED_CAPS_LOCK_PIN D1 +#define LED_SCROLL_LOCK_PIN D6 + #define RGBLIGHT_ANIMATIONS #define BACKLIGHT_PIN D4 diff --git a/keyboards/xbows/knight/config.h b/keyboards/xbows/knight/config.h index a6d0d80664f..fbe15043983 100644 --- a/keyboards/xbows/knight/config.h +++ b/keyboards/xbows/knight/config.h @@ -20,6 +20,10 @@ /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST +#define LED_NUM_LOCK_PIN D1 +#define LED_CAPS_LOCK_PIN C7 +#define LED_PIN_ON_STATE 0 + /* number of backlight levels */ // #define BACKLIGHT_LEVELS 3 #define BACKLIGHT_PIN B7 diff --git a/keyboards/xbows/knight/knight.c b/keyboards/xbows/knight/knight.c index dcc5035d516..cb79d9d584d 100644 --- a/keyboards/xbows/knight/knight.c +++ b/keyboards/xbows/knight/knight.c @@ -1,23 +1 @@ #include "knight.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); - led_init_ports(); -} - -void led_init_ports(void) { - setPinOutput(D1); - writePinHigh(D1); - setPinOutput(C7); - writePinHigh(C7); -} -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - writePin(C7, !led_state.caps_lock); - writePin(D1, !led_state.num_lock); - } - return true; -} diff --git a/keyboards/xd68/config.h b/keyboards/xd68/config.h index 5c450c68aec..4fbb66b8153 100644 --- a/keyboards/xd68/config.h +++ b/keyboards/xd68/config.h @@ -47,6 +47,9 @@ along with this program. If not, see . /* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW +#define LED_CAPS_LOCK_PIN B2 +#define LED_PIN_ON_STATE 0 + #define BACKLIGHT_PIN F5 #define BACKLIGHT_LEVELS 6 #define BACKLIGHT_BREATHING diff --git a/keyboards/xd68/xd68.c b/keyboards/xd68/xd68.c index 2a5a52bdae2..45e8a2b958d 100755 --- a/keyboards/xd68/xd68.c +++ b/keyboards/xd68/xd68.c @@ -1,22 +1 @@ #include "xd68.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - matrix_init_user(); - led_init_ports(); -} - -void led_init_ports(void) { - // * Set our LED pins as output - setPinOutput(B2); - writePinHigh(B2); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - writePin(B2, !led_state.caps_lock); - } - return true; -} - diff --git a/keyboards/xd87/config.h b/keyboards/xd87/config.h index 7ed104c23fe..aa07e3225ce 100644 --- a/keyboards/xd87/config.h +++ b/keyboards/xd87/config.h @@ -49,6 +49,9 @@ along with this program. If not, see . /* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW +#define LED_CAPS_LOCK_PIN E2 +#define LED_PIN_ON_STATE 0 + #define BACKLIGHT_PIN D0 // #define BACKLIGHT_BREATHING #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/xd87/xd87.c b/keyboards/xd87/xd87.c index a41b4f2dba0..1d21357e666 100644 --- a/keyboards/xd87/xd87.c +++ b/keyboards/xd87/xd87.c @@ -14,38 +14,3 @@ * along with this program. If not, see . */ #include "xd87.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - led_init_ports(); - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - - if (res) { - writePin(E2, !led_state.caps_lock); - } - - return res; -} - -void led_init_ports(void) { - setPinOutput(E2); -} diff --git a/keyboards/ymd75/config.h b/keyboards/ymd75/config.h index 79dcdc6c439..a828c4d64b5 100644 --- a/keyboards/ymd75/config.h +++ b/keyboards/ymd75/config.h @@ -29,6 +29,8 @@ along with this program. If not, see . #define BACKLIGHT_LEVELS 12 +#define LED_CAPS_LOCK_PIN D1 + #define RGB_DI_PIN E2 #define RGBLED_NUM 16 #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/ymd75/rev1/rev1.c b/keyboards/ymd75/rev1/rev1.c index 0870a6cc027..c1ad021b15e 100644 --- a/keyboards/ymd75/rev1/rev1.c +++ b/keyboards/ymd75/rev1/rev1.c @@ -16,19 +16,3 @@ along with this program. If not, see . */ #include "ymd75.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D1); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D1, led_state.caps_lock); - } - return true; -} diff --git a/keyboards/ymd75/rev2/rev2.c b/keyboards/ymd75/rev2/rev2.c index 0870a6cc027..c1ad021b15e 100644 --- a/keyboards/ymd75/rev2/rev2.c +++ b/keyboards/ymd75/rev2/rev2.c @@ -16,19 +16,3 @@ along with this program. If not, see . */ #include "ymd75.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D1); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D1, led_state.caps_lock); - } - return true; -} diff --git a/keyboards/ymd75/rev3/rev3.c b/keyboards/ymd75/rev3/rev3.c index 96e1a47549f..c1ad021b15e 100644 --- a/keyboards/ymd75/rev3/rev3.c +++ b/keyboards/ymd75/rev3/rev3.c @@ -16,17 +16,3 @@ along with this program. If not, see . */ #include "ymd75.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { setPinOutput(D1); } - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D1, led_state.caps_lock); - } - return true; -} diff --git a/keyboards/ymd96/config.h b/keyboards/ymd96/config.h index 6f50c7324dd..55c5beaf3ee 100644 --- a/keyboards/ymd96/config.h +++ b/keyboards/ymd96/config.h @@ -35,6 +35,10 @@ along with this program. If not, see . /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW +#define LED_NUM_LOCK_PIN D0 +#define LED_CAPS_LOCK_PIN D1 +#define LED_PIN_ON_STATE 0 + #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 12 #define BACKLIGHT_BREATHING diff --git a/keyboards/ymd96/ymd96.c b/keyboards/ymd96/ymd96.c index 5841decdab3..0c212f4abbf 100644 --- a/keyboards/ymd96/ymd96.c +++ b/keyboards/ymd96/ymd96.c @@ -17,21 +17,3 @@ along with this program. If not, see . */ #include "ymd96.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D0); - setPinOutput(D1); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D0, led_state.num_lock); - writePin(D1, led_state.caps_lock); - } - return true; -} diff --git a/keyboards/ymdk/bface/bface.c b/keyboards/ymdk/bface/bface.c index b35b3337639..fabc10498a8 100644 --- a/keyboards/ymdk/bface/bface.c +++ b/keyboards/ymdk/bface/bface.c @@ -15,19 +15,3 @@ * along with this program. If not, see . */ #include "quantum.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D1); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D1, led_state.caps_lock); - } - return true; -} diff --git a/keyboards/ymdk/bface/config.h b/keyboards/ymdk/bface/config.h index 3d9605b75aa..6be1c866231 100644 --- a/keyboards/ymdk/bface/config.h +++ b/keyboards/ymdk/bface/config.h @@ -34,6 +34,8 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW +#define LED_CAPS_LOCK_PIN D1 + #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 6 diff --git a/keyboards/ymdk_np21/config.h b/keyboards/ymdk_np21/config.h index 1ea6fb0ce35..83423792b05 100644 --- a/keyboards/ymdk_np21/config.h +++ b/keyboards/ymdk_np21/config.h @@ -46,6 +46,8 @@ along with this program. If not, see . /* COL2ROW, ROW2COL */ #define DIODE_DIRECTION COL2ROW +#define LED_NUM_LOCK_PIN D0 + #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 12 #define BACKLIGHT_BREATHING diff --git a/keyboards/ymdk_np21/ymdk_np21.c b/keyboards/ymdk_np21/ymdk_np21.c index 63812c9360e..3ca0e8baa04 100644 --- a/keyboards/ymdk_np21/ymdk_np21.c +++ b/keyboards/ymdk_np21/ymdk_np21.c @@ -17,19 +17,3 @@ along with this program. If not, see . */ #include "ymdk_np21.h" - -void keyboard_pre_init_kb(void) { - led_init_ports(); - keyboard_pre_init_user(); -} - -void led_init_ports(void) { - setPinOutput(D0); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - writePin(D0, led_state.num_lock); - } - return true; -}