From 790f94533c936409e6be56e8b638969b42350180 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Wed, 10 Mar 2021 22:48:18 +0000 Subject: [PATCH] Refactor to use led config - Part 6 (#12115) * Convert to config * Convert to config * Convert to config * Convert to config * Convert to config * Convert to config * Convert to config * Convert to config * revert changes --- keyboards/ares/ares.c | 16 ------- keyboards/ares/config.h | 2 + keyboards/bfake/bfake.c | 16 ------- keyboards/bfake/config.h | 2 + keyboards/chili/chili.c | 26 ------------ keyboards/chili/config.h | 5 +++ keyboards/coarse/cordillera/config.h | 4 ++ keyboards/coarse/cordillera/cordillera.c | 20 --------- keyboards/crazy_keyboard_68/config.h | 3 ++ .../crazy_keyboard_68/crazy_keyboard_68.c | 19 --------- keyboards/daisy/config.h | 3 ++ keyboards/daisy/daisy.c | 18 -------- keyboards/do60/config.h | 3 ++ keyboards/do60/do60.c | 17 -------- keyboards/donutcables/budget96/budget96.c | 18 -------- keyboards/donutcables/budget96/config.h | 3 ++ keyboards/eve/meteor/config.h | 2 + keyboards/eve/meteor/meteor.c | 16 ------- keyboards/evyd13/eon75/config.h | 5 +++ keyboards/evyd13/eon75/eon75.c | 29 ------------- keyboards/evyd13/eon95/config.h | 5 +++ keyboards/evyd13/eon95/eon95.c | 29 ------------- keyboards/evyd13/gh80_1800/config.h | 5 +++ keyboards/evyd13/gh80_1800/gh80_1800.c | 28 ------------- keyboards/evyd13/minitomic/config.h | 3 ++ keyboards/evyd13/minitomic/minitomic.c | 34 --------------- keyboards/evyd13/mx5160/config.h | 5 +++ keyboards/evyd13/mx5160/mx5160.c | 42 ------------------- keyboards/evyd13/nt660/config.h | 2 + keyboards/evyd13/nt660/nt660.c | 16 ------- keyboards/evyd13/quackfire/config.h | 4 ++ keyboards/evyd13/quackfire/quackfire.c | 28 ------------- keyboards/evyd13/wasdat/config.h | 5 +++ keyboards/evyd13/wasdat/wasdat.c | 31 -------------- keyboards/evyd13/wasdat_code/config.h | 5 +++ keyboards/evyd13/wasdat_code/wasdat_code.c | 31 -------------- keyboards/evyd13/wonderland/config.h | 5 +++ keyboards/evyd13/wonderland/wonderland.c | 33 --------------- keyboards/exclusive/e65/config.h | 3 ++ keyboards/exclusive/e65/e65.c | 21 ---------- keyboards/exclusive/e6v2/le_bmc/config.h | 2 + keyboards/exclusive/e6v2/le_bmc/le_bmc.c | 16 ------- keyboards/exclusive/e6v2/oe_bmc/config.h | 2 + keyboards/exclusive/e6v2/oe_bmc/oe_bmc.c | 16 ------- keyboards/exent/config.h | 4 ++ keyboards/exent/exent.c | 20 --------- keyboards/facew/config.h | 3 ++ keyboards/facew/facew.c | 18 -------- keyboards/foxlab/key65/hotswap/config.h | 3 ++ keyboards/foxlab/key65/hotswap/hotswap.c | 17 -------- keyboards/foxlab/key65/universal/config.h | 3 ++ keyboards/foxlab/key65/universal/universal.c | 17 -------- keyboards/freyr/config.h | 4 ++ keyboards/freyr/freyr.c | 19 --------- keyboards/ft/mars80/config.h | 3 ++ keyboards/ft/mars80/mars80.c | 18 -------- keyboards/gray_studio/hb85/config.h | 4 ++ keyboards/gray_studio/hb85/hb85.c | 20 --------- keyboards/handwired/tritium_numpad/config.h | 3 ++ .../handwired/tritium_numpad/tritium_numpad.c | 28 ------------- keyboards/hid_liber/config.h | 4 ++ keyboards/hid_liber/hid_liber.c | 21 ---------- keyboards/j80/config.h | 4 ++ keyboards/j80/j80.c | 20 --------- keyboards/jc65/v32a/config.h | 2 + keyboards/jc65/v32a/v32a.c | 16 ------- keyboards/kb_elmo/aek2_usb/aek2_usb.c | 20 --------- keyboards/kb_elmo/aek2_usb/config.h | 4 ++ keyboards/kbdfans/kbdpad/mk1/config.h | 2 + keyboards/kbdfans/kbdpad/mk1/mk1.c | 16 ------- keyboards/kinesis/kint2pp/config.h | 7 +++- keyboards/kinesis/kint2pp/kint2pp.c | 25 ----------- keyboards/kinesis/nguyenvietyen/config.h | 6 +++ .../kinesis/nguyenvietyen/nguyenvietyen.c | 30 ------------- keyboards/kira80/config.h | 3 ++ keyboards/kira80/kira80.c | 18 -------- keyboards/kona_classic/kona_classic.c | 29 ------------- keyboards/mechlovin/adelais/adelais.c | 27 ------------ keyboards/mechlovin/adelais/config.h | 4 ++ keyboards/mechlovin/delphine/config.h | 4 +- keyboards/mechlovin/delphine/delphine.c | 18 -------- keyboards/mechlovin/hannah65/config.h | 2 + keyboards/mechlovin/hannah65/hannah65.c | 18 -------- keyboards/mechlovin/infinity87/config.h | 2 + keyboards/mechlovin/infinity87/infinity87.c | 21 ---------- keyboards/mechlovin/infinity88/config.h | 2 + keyboards/mechlovin/infinity88/infinity88.c | 22 ---------- keyboards/mechlovin/pisces/config.h | 2 + keyboards/mechlovin/pisces/pisces.c | 25 ----------- keyboards/mehkee96/config.h | 4 ++ keyboards/mehkee96/mehkee96.c | 18 -------- keyboards/nightly_boards/alter/rev1/config.h | 4 ++ keyboards/nightly_boards/alter/rev1/rev1.c | 20 --------- keyboards/panc60/config.h | 2 + keyboards/panc60/panc60.c | 16 ------- keyboards/pandora/config.h | 3 ++ keyboards/pandora/pandora.c | 18 -------- keyboards/pearl/config.h | 4 ++ keyboards/pearl/pearl.c | 20 --------- keyboards/percent/canoe/canoe.c | 16 ------- keyboards/percent/canoe/config.h | 2 + keyboards/percent/skog/config.h | 3 ++ keyboards/percent/skog/skog.c | 18 -------- keyboards/percent/skog_lite/config.h | 3 ++ keyboards/percent/skog_lite/skog_lite.c | 18 -------- keyboards/phantom/config.h | 3 ++ keyboards/phantom/phantom.c | 20 --------- keyboards/rart/rartlice/config.h | 5 +++ keyboards/rart/rartlice/rartlice.c | 20 --------- keyboards/redscarf_iiplus/verd/config.h | 4 ++ keyboards/redscarf_iiplus/verd/verd.c | 27 ------------ keyboards/reversestudio/decadepad/config.h | 3 ++ keyboards/reversestudio/decadepad/decadepad.c | 15 ------- keyboards/singa/config.h | 2 + keyboards/singa/singa.c | 16 ------- keyboards/stella/config.h | 4 ++ keyboards/stella/stella.c | 19 --------- keyboards/tgr/910/910.c | 20 --------- keyboards/tgr/910/config.h | 4 ++ keyboards/tgr/910ce/910ce.c | 16 ------- keyboards/tgr/910ce/config.h | 2 + keyboards/tgr/alice/alice.c | 20 --------- keyboards/tgr/alice/config.h | 4 ++ keyboards/tgr/jane/config.h | 3 ++ keyboards/tgr/jane/jane.c | 18 -------- keyboards/tgr/tris/config.h | 2 + keyboards/tgr/tris/tris.c | 16 ------- keyboards/unikorn/config.h | 2 + keyboards/unikorn/unikorn.c | 16 ------- keyboards/vn66/config.h | 3 ++ keyboards/vn66/vn66.c | 17 -------- keyboards/winkeyless/bface/bface.c | 20 --------- keyboards/winkeyless/bface/config.h | 4 ++ keyboards/winkeyless/bmini/bmini.c | 20 --------- keyboards/winkeyless/bmini/config.h | 4 ++ keyboards/winkeyless/bminiex/bminiex.c | 20 --------- keyboards/winkeyless/bminiex/config.h | 4 ++ keyboards/xbows/knight/config.h | 4 ++ keyboards/xbows/knight/knight.c | 22 ---------- keyboards/xd68/config.h | 3 ++ keyboards/xd68/xd68.c | 21 ---------- keyboards/xd87/config.h | 3 ++ keyboards/xd87/xd87.c | 35 ---------------- keyboards/ymd75/config.h | 2 + keyboards/ymd75/rev1/rev1.c | 16 ------- keyboards/ymd75/rev2/rev2.c | 16 ------- keyboards/ymd75/rev3/rev3.c | 14 ------- keyboards/ymd96/config.h | 4 ++ keyboards/ymd96/ymd96.c | 18 -------- keyboards/ymdk/bface/bface.c | 16 ------- keyboards/ymdk/bface/config.h | 2 + keyboards/ymdk_np21/config.h | 2 + keyboards/ymdk_np21/ymdk_np21.c | 16 ------- 153 files changed, 249 insertions(+), 1623 deletions(-) diff --git a/keyboards/ares/ares.c b/keyboards/ares/ares.c index 95d4b878f10f8529ebdc7dfd2839bb1fd51ad3dd..80d44551795f00cf3eccb9436ccecc461200e367 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 ffbe456050d4a11969a436233dcfc68bf6806558..35e885d69310c78e939e32f545c163a8be4ce858 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 6d0c927462bc0f3948594045a512f8d65596f520..5eedcc1946306b459e303f58e9543a40326555de 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 6c4710a9ec882193a2359f6b38e9bf4aacba37cb..54e01ad3dbd9f8b0569b5e41eb50831b0cccee6a 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 40d3528b08059026b1e6e149e1666d4df5411b8d..f629a6d60a640635ba0ddca85cda0ef73e6d4703 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 4b6a632cd43a71b0e19dee853eb84878849fcda3..08c24758751eaca8314791ae6a289ddffe41e02b 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 ac636d5d5e3c579f678667698fef82cf94fb434e..33b0d7944a3afb03ff6f965a1b4005609b69c52e 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 5bf07740b5a394cebac2e432ba79fc1de824808c..437547ff2827e43aecdb23f7e2760948c0f6c116 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 2558e75791816a2b75326ad90f498a6f95206c29..e1304e18ed597e26525aaa6f5d7a2ec07c705e9a 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 f4f8515b7c5723b0415d74df72f128e37bde0dd3..cbea93fb85d8057788d5cf41a5850e8cbc6d2a9a 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 a41e158f1c7a887ca2c31f1247da62a213cd878d..ea56f948eef74e9372bd5f890fc1f2011b6ae459 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 4e365ed4621329816bb419b968c3f14fc1ac0501..98b7ac84b3efa40bda322e79246ab677b03656e2 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 ef6c55c3e1af43c4facd7cd79f7861964cd4e80f..f3ee1ed04552e9bf1a45a96747ad124eabc4bf37 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 3dba9b53593a8d50c5fd57c800c6d5a8c7b1ccff..b19fc59828f87deef3f3638b2fa2fa85aeb46728 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 5f3436dc6103611cf4f9d91d507da68eeda7e7bc..8c7b894bc4df9625ec6fa07210db17203947de15 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 e04cc8b78d10319f12fac831e1f765804477c8da..39b661dda75459786c5e12e922b3c9f3c0d7f3b7 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 1e8c6ca052b75208bbe6c4ca41f95c0611935c2c..a6b2c9b69d9b71c6e4c36c2a22533010351aa5b0 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 1d080b389cc2104e5bf0e1fb646ffa6a8e415504..6bdb117f3a6ccf8e8e1a1fa2e9c852c344c0762c 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 707665140dbcac62878aa478800db0593339c799..d7d84de2a363c19a314786c907854d946f16d2e0 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 67e9fe66a2e73ba8866629aa9be5ce4e36bff020..38620a6362009fd84764e4f965549b417d3158a4 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 eb44d8957e9875b1163dad0b30f0c1b42422f18c..2d9ede3ee27ab605f7fd5ccac9a1ff59670838e4 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 5eec86cc11b17ab071389e026d3f13868e08ef92..603d84a13910c0c3d4cb31a98112f89e85dd6197 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 c230aa9af860def39f981ae986957cfaadca3a12..26ad8a8b1375ddac950d202d90420b9d1c074d44 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 770c6f78bf2da81583e6ca1acddc82fe6532cfda..1691b3949ea1dc939de8884cd6b763ac49846213 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 c041e86a2a9b1352466214be9d56b07cc0277246..f26b4d1d956c6f6c712ed78fac1fb6a49765326b 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 8d5f11a50d12b626fa758c6c3e84c385d48be5e9..15f28296486ce58c1b8092e3be8b59c0bb364d78 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 926095a5d221d63841c905ff4624124566a6d7cb..c65f81b879414edadeeac2d05eb7653c21d96e0c 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 c9e412da2467350c9ce73f77fadb10aef1c3aecd..298c44fd499f072e8cf7a1bce11c9c866e249341 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 0d9bbd3300e6f123dbcacc020eea3345e3cc39d4..8638847142595a5cd956ab745a484ef2aa9112fb 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 2a8ebfb46c82cb7f12988372423a958945f37909..f89fa579c3e2d56322aa0f6517e5bdb3b4557def 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 22083e8118744ef86cbb7c12135856bdd3b10ba8..151219a016f56a539e442ca56c154dbb413756e9 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 ab233bd6d44a843e4e45e9f6100b46ab9f51c800..634d4187c6dc4e53d4740289a3c550c7cb29c6d5 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 c064d18a589ff47e0c23985bbd7797192938c483..75b75a0d2ab858cbdbf401c4a8ee7b462007c5d1 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 2d0e999c4e8c88dc4c220b1159cbd5bde70e6c03..6aaa1b84276131db067445f520dd211bf0bb6e74 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 804839ee9a9ef92526ada04ce0736a103c156b8e..4ac77f217dfb700fb6902afc4c35e6fd1f6be96c 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 33551c2d0cb1e8166918fe59360bee3a3a7d81dc..c1cdadea9e1cc612faf77d4a39e1ae6d55028a50 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 908c8a78552ffb9e11839d17a90838919bfc6baa..c5c7a8b6c66e8966fb1a178fe45e874f2b441d74 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 441544381619ed0db9ab50095a86194d4de80650..f2a53a17a431527dc8f0019816eec9b964fa9b36 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 bc0f1a1ed71039b85695bf853e8fc9d2d6422b8e..1d43011b80f09ca15c6f2f33a56fbbc4c7ce51f4 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 e01a0614c52967bd2fb16ed8a2d27a15014be5a2..feb0e654382144a775ba40059b4b9f180481ad3b 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 e9e8c9e533ae22457a68aa5df883b684f00a3ee8..8115f4ae12137ba3438281eaf3c0f93e7a4fc9a5 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 df79cc5dcf8e7bf800b4c687f7d22834972d6825..e36cfd645d250d05a1ebbf53825ae87a1fc02166 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 f4abd2112d9dd7a9ee6c3752efbf37f847b83e08..3f2a50cdef1a9bf3aa2f1bd534afce1d2e0cf870 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 ea74d87cb1df2bdadefd846bd6120d12c6fead6d..10dd1a26edfba9cf7203d3abdff4f26556259171 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 6b37bdd1c8f18ad0e65458caf5e7d75aed9fb323..16a49e78fef1529dc84058aa5a86c237d1ef4ea7 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 a935e9e67fa09bf2ae99a5260aa0de7da621ca79..82066f7e85536ed78ccf8cfb18c4898526bbc8f5 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 5966429cac91e425fcbbd096359cd29ac6a05aa5..14583dc8316c28df388f878ed3fca69e6702277c 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 2f091ae6bdde517290f4ff74c856e1523f3a5f73..373dbc6cd6a046cc3550185417c8917cbb2962a6 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 a5ada6bd01cade68f11324cc931956c3e0bf77d2..43f883fce9a6933232cbafa68113db5c02ac2c53 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 6b3950d36128049e57ae2fee7326ff83ede4b543..31fb011ad5e83d0963bab4c5889796dd9bf0fcb4 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 a3c01cd75bd5fafc2210c651eea6a471617907f5..315af667629a1f3688d947775a6801ab5849eeae 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 361f3ad7f21fe3aac5c00bd58837d487147c149c..5fa9e8f17172c1c7e3d4a06b3b853697b79abd70 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 a4e34ea477cfad6379fd36c652fd4ea1b3796217..d912b3cc1a32c74f539a967ff65e87fe404d4406 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 336b3271100d85ef2922047eb17b583e6980ec02..a856521e7f3948de5dd1b2cc3c2c65f3490a0998 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 3aabc926d83e2471a47b439add415fb26195bde9..e56d4439b36c1bd9a531061d4e8253f40f4a137b 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 2c628a6a236762cf073715f004fc87a4c5e4f739..5c95d04e35594e895e1e413620e9fff77877183c 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 9309012a4105141c18db3de2110819ec111054a0..0e1f0aff42e4f1e9cda18e2b4d100266443eb8d8 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 4b3ff64f1e0ededc1a96ca4b0696bc2b5d40dc7b..964234d6b49aea65da6d6bd2a0a6c6e56c4b15b7 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 a53c27d43bc2b1ffd097318803a0db7ad780fabd..1424c6b4918356b40c3d80ca5d16736ba09f617e 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 7193a934d609cb2d2cafa49d83da3f65f26c1b66..c9f86eda7e9eeb827b6fc812c9095ea9d0b62ebc 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 f35799b1ac0c6dcbdb8c1d8d98e162d93a4bec7b..e0f92dee84278d7522e92aa9dd4f79b1b31af56b 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 2d2130743f1c99cd00b889f725948851a11c383d..2e4ddb32938de3481665dc5dceec2c15f3f162d0 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 c4276431cf3a4a76f6a8a9b6411926d7b226f2b7..fb17a7fd1e8ae6a6194ecc767c1681f48988a1a4 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 bed30cdecc484b297077984842b93608496bc896..fd49e913e0f570d10c84bebaa9c15c16a692a94e 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 6cf71ab3af0d026c4c5254eb87f87c06820a2311..d6907c96c33c0609fd12a95d0b923c0cce6f4973 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 f195e8f61e910f895ce4ce53b41cbbadf915c861..aa7233ba2acc0021efef5ea849d6bf6091f81f3c 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 b83faf5dad5d1e249b35bbb167bdc88765c80122..6ce5d21df7a212ced4f4f359aca7464dde8d4e02 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 e0fc83f17ade8411abcfb6d8faeafe043fbce494..cf8c9d66f9adc8857da2a73e68ffe7698c115ec0 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 1646a1af1fa9dd8388fef70eaff306d3ec033a28..80a1abef570326b1de3df1c01d1433d371668081 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 540ba358925fcc5270466495399f4006f3957b29..5635b0a589f039347bc5e959111c03bcf0134758 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 2acaf9be6e51f4a717fa3ba78dd9365e5f6c8b43..902c9b24a0651938324434bcb8dede7f5f6d1a4a 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 7e2b4348c55f87888eb60e33c3e7d13ffa9327bc..856e29c31efe89ba7799823dc19e322c4a3cfc59 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 f221acd7e71dec0a5d68fdb810330994e4a883ac..52f4c8054bafd2bf89858d0d5c7f87d334a9a2fb 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 1919412e9365551e2289b9a1ef2fc18d5fcaed8f..3f0147938906c5236089804013a99742aea36e1a 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 725b68d6e66e8759a84099559fbf9e77f0c40d1f..d61d23ab614d8d5fab2fa0eaa5ff32da6b3bd2c1 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 a76f4001efa1d3352573086775507284051f1c29..b3ebcae29aa8654a799e2678ebafce43af6394a7 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 71cee7baafbb12f8244c7bafb24b00b7761c4749..af4ea06e6d38ed452259a98ff55d6aff51e4fb4e 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 da5f68f62bf3b3f5389aae8c21b46f3640ad281d..b9df471d33517a21ebc91c68487670886b892f48 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 875eba51487c745f332abf67f04db2906ed7efa4..3ec5c49132724493339799e2a65c7e7b1a8a956d 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 b3a084f67e7546ad78c0a4979f61c198d9d13a3b..a642f37f9ba6e2cf9b2db32a006bdd5c13238125 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 52292b3c9228831c1e46827b10ea502177f3dc57..8e33b6603c9eebd1c9815d09bdc66323e49f2287 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 6801c30a3d36a1fce79450f1053071bf17c48cf7..8c94fe4b35b41cc2061743582bc285fb8444924d 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 4f937d8a2af53a07a79ffcf43dcf9cb0959b3917..92e0917ebe0c4436e0cf7cfd91c217f1b5bab46e 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 703a06f8de9b1b89782aa2f302351b30bbce4fc1..ccb9f67566783b14099b79601985b2ba373a1488 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 2de528bc366a2825e598d2d26142f347af401ba7..434e79609151f69442646b13e4d9d45f8521a724 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 df1ea4957b921b884cdbd46b2e5d931638c6f2bb..a387b763865471f93240fdcc6e85f2ec3f59a99a 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 d342ce9eea75b9381ada474e6aa0f5a272703643..4d352358a76417d36cdb1089bf7cafd7c68a37c5 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 14f6404a7fb823c832ae72d5027aa04b02a113c4..1debf021c808b4aabc067dfcc63cb2efba3c0521 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 2a0a97f6d40216c2ef6e42b1685bd686ceae2c0c..b43bf2aaa4f36b97b220c534d59b6c5d47d5cfb0 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 dc8c593ada9ef064be976dfc9a04f4c869e0a99a..44ded13a575ed702e596af7678f5f9066e276b43 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 ae83a1bb50d77c0d79d22984673bcde4fbcdfee8..d9e2bac7a5953a7e6fd047c9ff783772ed92cc6d 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 30fe4b5212433408b6947530cdad0e000cdf2735..4f9bade717e4b7fa92b97b75d41d45d4035a8af4 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 df3dd6aed8884e6830145b701ac3a0fecd544850..b250d32d12ced396784826f29fd674fea7fe63d3 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 002ff7cf9672139d1af387650d56b3da2124cc1e..495f5a2d4d3eaf40b923bf1c09bb8e3f6785e671 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 d7ff52963cc97e1b785b985135def20e55372449..16f298eb8d8cd81beede5dc5772b8d7887ff1d5a 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 873f6dd150bd3663030ffd24266479f50c9135c8..3a44129c49af44716f6e12d4d99abb989b708fe6 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 6c5d8a166fd283db24c2132ec074160b517e75d1..3d166646b8ccda401a117330469fcafb2e3fa8b1 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 a42b0a5fa52f5b603408e292f5859b5c80f5b0ff..09e0c8e1e414f1c2c316c584f0c7df736167933c 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 b08ee6f88807db9db3214f795ea147d53092e2a0..18ed9835d882fc15e33842c2b49907230e539c68 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 dd31640e6d9bb0b54e695a2a48a8858ae206c0b7..572ff50b0108e689c1419f1e688491f9b8c2faea 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 b8a306b7e163c2405129361cab95325a0d831618..c349c1106c7787efaeab971a925eb0fb1eeb925b 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 047bac02e82f91e5a50eee4f2bb7639a4d4a48f6..524fdc5ccfd9f7d4db8e73aaa010b923da6a981e 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 152fc568450006847f00edfe883a06b89d4218cc..c44f0373fbf1074534d0afbb80a50544cbcee241 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 e28dcfcd2f348f7c0bad765990f90971d8015e79..15de9bbb898cd92ac35ae6dd5720e81b4959e97e 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 95d39821130b311682942702f45475d96fed6862..c69843e617e5ed92a715af7a276354e6da7a734d 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 a5d135a4bf793dc1b5f7dd762d4edd00f1ed19c8..a948987d18c54491e94ec6c86eaaf9375d2050e5 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 1017de0093cca40fe77d1f1741de035c5db52048..5c478f82aad47390c042708522df8c4aaa3ba5f7 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 26f9324bd8fa0818ff1ec9babd1208edbbc080ad..fc6fbaa117af4c6394a7d04d9477c710447620d9 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 be805da33e6b3a67bdd8442fef3ad0d81529090d..a970e96867970c571e0866d04ab28fe2aa4c2e5d 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 06d606f557aa8d3635c8bca9eea31dc0762ca57c..abc3ae37809033be9aaf5af2b755aee98dec75e9 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 c16a5a97407f3def565cc49622b34ff297f3857f..fa5ef6bd2b63127518c479f8a22b7adfc41548cf 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 78fd40c405b8227ef2458adb912694f34b1f4437..383a539d787bb604583e033b7d56830cfd299da8 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 32a66e295cb0b0a85c9d32b7c030f53a164c5da3..699a4476bb11211d062089a4bfebf0bcabfcfe60 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 408f88b2a436fb945e0689074f4bd520127e760e..1d3ed105e164f139a0e617a2dd09e62f486a53e9 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 360b214a31dfcc24ce5d9d2be30512078ddb0253..8605d6f471d3f70cff212f293097b9a59a9c50da 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 04ba08239c448f9a82acb2f3bbd4facc41575c82..512b7571d548a877b9775e529f6364794b32cbf4 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 363c327d6b1baa12dc2b3a52f22ac15288f6514e..5eb55b3668753138f68299b50839ff2cf578ec2e 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 63b4a13f7dee6390e8405bbc902f61287e58201e..8e0c7853859240ff2f7fe44b29d8339d2323f591 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 8cd46a413a3b6c2fa9b1da7c5680ccb671f38f27..7ba412be355ae289c9adb8cd7b266378a2f1f0f6 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 4b39131794d722806c5aa7835bc332fe7da95469..7538158c89a6800c47f3e85e241f52a33528b1da 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 6d3fe7a4948eee5aa706070a60770882c5d269dc..fd21a2de76880372eaf31e85187a22499c90711e 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 a4a5c787c617203c0b725a77593224918a793512..39aed2cf5676d972211fdf2e37965a48ca38c298 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 20f4c5970e13351567a1ebf63facb8c192fade67..26ed2e7973026f9178200cc12dda6ced4f1bce8d 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 ed8b39c38a301f81061036c103769c3372cc245f..0132a716d3426f0188742f279d7f660961d9e5ba 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 fabdc0e90c2dc129590d6d256c95625bc59e8ce4..d4cdebaa259073321a9c88b5b0180ef026786f12 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 4ae3b967cce8ec9aae812f7f93fa4ed16b23b8e1..16e862a222be7f5f1e068228f37db9818f732fa8 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 f354d7a3934da986cda21595298b175d7fd8d5ac..c2147b29c60a3b0f1c6da43aa12a8d83421c757f 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 c68a857d5e9bc48a69e371daaa63ed7e902991b1..1029a777bbc798b8d64047c5d6332779280f310e 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 c2c85eb984afcd84556559cdfd0b8f81b089c53d..d803ebf9da1314cd11146a21d347e2c7a4b53a83 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 e30c1b19d34760aba085120d09517315e998202c..d8095418417e27fd57e243c79918a20c42095711 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 77fe23aefe3bdc95291e6b24649f612300131236..5631359040a48b81508bb9c0eb7ed5b9e22a8ca7 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 7d27096bad1d4000878241a78b4b800449fd328f..c1fcbe53b2f00a6e92af0e298fd5d346bccd9644 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 27ee761e9b796ba863327f63047ca0d0b853c5aa..83fcfa0276e5c5207154773cea43544742e855f5 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 6529d440333ebad260dc3eb8f30bc3fef70da056..f44fd36a8cc743698592fcb53159c51dece9adb2 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 6e91241af8e3c8dfddfffc064f8eddb854613191..1f7759faf9d5a9058f68aac144d6689aa93401d7 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 676f88ebf53903447508131a3024fe5794c7fa51..db127e030deb2d1dec0452b2e9f3005b9d1250ce 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 7c9c11c111609eab68dc926d59470a020dcaa466..412d10a2aab05aebb21a634c8a49b2db0e4d926e 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 a6d0d80664f916acad5bdbc5f047baef05ad2809..fbe15043983407459474bda7d32bd6f0230f3bb1 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 dcc5035d51650841fed0efc1a9c63c72e185b42a..cb79d9d584dfa154a2582dc8000eecd8f78b60bb 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 5c450c68aec56b13e4f5bb17c94974d82ddb2ce0..4fbb66b81533f8d727e167c59e5346742876bf5a 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 2a5a52bdae2faeadcf31bf5562d7dc3d513751cc..45e8a2b958d480a18256d02297fd19da22d8f10d 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 7ed104c23fe7acc8423eca02b94afe196664a6ab..aa07e3225ce90e43d34f8a6a50b65ac01ead1f6d 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 a41b4f2dba01fbad7ac4326cdbfb7204b756e881..1d21357e666166e800aec6ec7d2d9d901691d508 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 79dcdc6c43992e3e47ea4eeb7e0d8b9a955d56ad..a828c4d64b5c6a0cbf8543b9d39a58c99104e469 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 0870a6cc0270579083da827fabc7b80f5fe4c73b..c1ad021b15eb7bf07b541ca0f3fa6a8e463045eb 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 0870a6cc0270579083da827fabc7b80f5fe4c73b..c1ad021b15eb7bf07b541ca0f3fa6a8e463045eb 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 96e1a47549fccedde8e25173635490fd2d5f79f3..c1ad021b15eb7bf07b541ca0f3fa6a8e463045eb 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 6f50c7324ddaeb2f790831d8f48d3cae95168a3c..55c5beaf3ee208779eea23ab4d1d9e7a98eae3c8 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 5841decdab31f3ec96bc46454b398125bafebc46..0c212f4abbf5a7be9c749d5ec885d5e14900f77e 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 b35b33376399529737ebb449d3c2374c06f1ab6b..fabc10498a80553d64a1de86a5f0be1c89267b9b 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 3d9605b75aa26b9427f23ab535e9ea266b0b471b..6be1c866231775a1dfc8dc86d2ebf3475ac2855a 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 1ea6fb0ce351d5566234cfe59757b4caa2eff62b..83423792b05fdf1e725c7809439bbea95e66901e 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 63812c9360e2f408882db55ecd8da2a9b5b2fc7c..3ca0e8baa04ac5221e28c9254f06f11b0cdf2d5e 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; -}