Browse Source

Migrate `led_update_kb` implementations to DD (#23985)

Joel Challis 2 years ago
parent
commit
a2176f6a03
39 changed files with 77 additions and 533 deletions
  1. 3 0
      keyboards/bear_face/info.json
  2. 0 34
      keyboards/bear_face/v1/v1.c
  3. 0 34
      keyboards/bear_face/v2/v2.c
  4. 0 29
      keyboards/dztech/bocc/bocc.c
  5. 4 0
      keyboards/dztech/bocc/keyboard.json
  6. 3 11
      keyboards/evyd13/gh80_3700/gh80_3700.c
  7. 4 0
      keyboards/evyd13/gh80_3700/keyboard.json
  8. 0 32
      keyboards/exclusive/e85/hotswap/hotswap.c
  9. 4 0
      keyboards/exclusive/e85/hotswap/keyboard.json
  10. 0 28
      keyboards/fjlabs/bolsa65/bolsa65.c
  11. 3 0
      keyboards/fjlabs/bolsa65/keyboard.json
  12. 5 0
      keyboards/flx/virgo/keyboard.json
  13. 0 34
      keyboards/flx/virgo/virgo.c
  14. 0 15
      keyboards/handwired/colorlice/colorlice.c
  15. 6 0
      keyboards/handwired/colorlice/keyboard.json
  16. 0 9
      keyboards/handwired/evk/v1_3/v1_3.c
  17. 6 0
      keyboards/handwired/retro_refit/keyboard.json
  18. 0 12
      keyboards/handwired/retro_refit/retro_refit.c
  19. 5 0
      keyboards/handwired/selene/keyboard.json
  20. 1 17
      keyboards/handwired/selene/selene.c
  21. 0 23
      keyboards/handwired/selene/selene.h
  22. 0 38
      keyboards/handwired/z150/config.h
  23. 6 0
      keyboards/handwired/z150/keyboard.json
  24. 0 39
      keyboards/handwired/z150/z150.c
  25. 0 8
      keyboards/kabedon/kabedon980/kabedon980.c
  26. 4 0
      keyboards/kabedon/kabedon980/keyboard.json
  27. 3 0
      keyboards/noxary/x268/keyboard.json
  28. 0 34
      keyboards/noxary/x268/x268.c
  29. 0 20
      keyboards/punk75/config.h
  30. 4 0
      keyboards/punk75/keyboard.json
  31. 1 1
      keyboards/punk75/keymaps/default/keymap.c
  32. 1 1
      keyboards/punk75/keymaps/via/keymap.c
  33. 0 32
      keyboards/punk75/punk75.c
  34. 4 0
      keyboards/redscarf_i/keyboard.json
  35. 1 9
      keyboards/redscarf_i/redscarf_i.c
  36. 0 36
      keyboards/sneakbox/aliceclone/aliceclone.c
  37. 5 0
      keyboards/sneakbox/aliceclone/keyboard.json
  38. 0 37
      keyboards/yiancardesigns/barleycorn/barleycorn.c
  39. 4 0
      keyboards/yiancardesigns/barleycorn/keyboard.json

+ 3 - 0
keyboards/bear_face/info.json

@@ -24,6 +24,9 @@
             "resync": true
         }
     },
+    "indicators": {
+        "caps_lock": "F7"
+    },
     "matrix_pins": {
         "cols": ["B5", "C7", "C6", "F0", "E6", "B7", "D0", "D1", "D2", "D3", "D5", "D4", "D6", "D7", "B4"],
         "rows": ["F5", "F6", "F4", "F1", "B0", "B6"]

+ 0 - 34
keyboards/bear_face/v1/v1.c

@@ -1,34 +0,0 @@
-/*
-Copyright 2020 chemicalwill <https://github.com/chemicalwill>
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "quantum.h"
-
-void keyboard_pre_init_kb(void) {
-    //Sets LED pin as output
-    gpio_set_pin_output(F7);
-
-    keyboard_pre_init_user();
-}
-
-bool led_update_kb(led_t led_state) {
-    // Caps Lock LED indicator toggling code here
-    bool res = led_update_user(led_state);
-    if(res) {
-        gpio_write_pin(F7, led_state.caps_lock);
-    }
-    return res;
-}

+ 0 - 34
keyboards/bear_face/v2/v2.c

@@ -1,34 +0,0 @@
-/*
-Copyright 2020 chemicalwill <https://github.com/chemicalwill>
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "quantum.h"
-
-void keyboard_pre_init_kb(void) {
-    //Sets LED pin as output
-    gpio_set_pin_output(F7);
-
-    keyboard_pre_init_user();
-}
-
-bool led_update_kb(led_t led_state) {
-    // Caps Lock LED indicator toggling code here
-    bool res = led_update_user(led_state);
-    if(res) {
-        gpio_write_pin(F7, led_state.caps_lock);
-    }
-    return res;
-}

+ 0 - 29
keyboards/dztech/bocc/bocc.c

@@ -1,29 +0,0 @@
-/* Copyright 2020 dztech
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-#include "quantum.h"
-
-void matrix_init_kb(void) {
-    gpio_set_pin_output(E6);
-    matrix_init_user();
-}
-
-bool led_update_kb(led_t led_state) {
-    bool res = led_update_user(led_state);
-    if(res) {
-        gpio_write_pin(E6, !led_state.caps_lock);
-    }
-    return res;
-}

+ 4 - 0
keyboards/dztech/bocc/keyboard.json

@@ -33,6 +33,10 @@
         "pin": "B7",
         "levels": 5
     },
+    "indicators": {
+        "caps_lock": "E6",
+        "on_state": 0
+    },
     "rgblight": {
         "saturation_steps": 8,
         "brightness_steps": 8,

+ 3 - 11
keyboards/evyd13/gh80_3700/gh80_3700.c

@@ -15,24 +15,16 @@
  */
 #include "quantum.h"
 
-void led_init_ports(void) {
-  gpio_set_pin_output(E6);
+void keyboard_pre_init_kb(void) {
   gpio_set_pin_output(B1);
   gpio_set_pin_output(D0);
   gpio_set_pin_output(D1);
   gpio_set_pin_output(F0);
   
-  gpio_write_pin_high(E6);
   gpio_write_pin_high(B1);
   gpio_write_pin_high(D0);
   gpio_write_pin_high(D1);
   gpio_write_pin_high(F0);
-}
-
-bool led_update_kb(led_t led_state) {
-  if(led_update_user(led_state)) {
-    gpio_write_pin(E6, !led_state.num_lock);
-  }
 
-  return true;
-}
+  keyboard_pre_init_user();
+}

+ 4 - 0
keyboards/evyd13/gh80_3700/keyboard.json

@@ -23,6 +23,10 @@
             "resync": true
         }
     },
+    "indicators": {
+        "num_lock": "E6",
+        "on_state": 0
+    },
     "matrix_pins": {
         "cols": ["B0", "D7", "D6", "D4"],
         "rows": ["B3", "C7", "C6", "B6", "B5", "B4"]

+ 0 - 32
keyboards/exclusive/e85/hotswap/hotswap.c

@@ -1,32 +0,0 @@
-/* Copyright 2020 MechMerlin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "quantum.h"
-
-void keyboard_pre_init_kb(void) {
-    gpio_set_pin_output(C7);
-    gpio_set_pin_output(B5);
-
-    keyboard_pre_init_user();
-}
-
-bool led_update_kb(led_t led_state) {
-    if (led_update_user(led_state)) {
-        gpio_write_pin(C7, led_state.caps_lock);
-        gpio_write_pin(B5, led_state.scroll_lock);
-    }
-    return true;
-}

+ 4 - 0
keyboards/exclusive/e85/hotswap/keyboard.json

@@ -18,6 +18,10 @@
         "levels": 6,
         "breathing": true
     },
+    "indicators": {
+        "caps_lock": "C7",
+        "scroll_lock": "B5"
+    },
     "rgblight": {
         "saturation_steps": 8,
         "brightness_steps": 8,

+ 0 - 28
keyboards/fjlabs/bolsa65/bolsa65.c

@@ -1,28 +0,0 @@
-/*
-Copyright 2020 <me@homedrop.org>
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 2 of the License, or
-(at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-#include "quantum.h"
-
-void matrix_init_kb(void) {
-    // Initialize indicator LEDs to output
-    gpio_set_pin_output(F7); // Caps
-    matrix_init_user();
-}
-
-bool led_update_kb(led_t led_state) {
-    bool res = led_update_user(led_state);
-    if(res) {
-        gpio_write_pin(F7, led_state.caps_lock);
-    }
-    return res;
-}

+ 3 - 0
keyboards/fjlabs/bolsa65/keyboard.json

@@ -8,6 +8,9 @@
         "pid": "0x0001",
         "device_version": "0.0.1"
     },
+    "indicators": {
+        "caps_lock": "F7"
+    },
     "matrix_pins": {
         "cols": ["C7", "B1", "B2", "B3", "B7", "D0", "D1", "D2", "D3", "D5", "D4", "D6", "D7", "B4", "B5"],
         "rows": ["F1", "F0", "F6", "F5", "F4"]

+ 5 - 0
keyboards/flx/virgo/keyboard.json

@@ -30,6 +30,11 @@
         "pin": "B7",
         "levels": 5
     },
+    "indicators": {
+        "caps_lock": "E6",
+        "scroll_lock": "B2",
+        "on_state": 0
+    },
     "rgblight": {
         "saturation_steps": 8,
         "brightness_steps": 8,

+ 0 - 34
keyboards/flx/virgo/virgo.c

@@ -1,34 +0,0 @@
-/* Copyright 2019 MechMerlin
- * Edits etc 2020 Flexerm
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-#include "quantum.h"
-
-void matrix_init_kb(void) {
-    // put your keyboard start-up code here
-    // runs once when the firmware starts up
-
-  gpio_set_pin_output(E6);
-  gpio_set_pin_output(B2);
-  matrix_init_user();
-}
-
-bool led_update_kb(led_t led_state) {
-    if(led_update_user(led_state)) {
-        gpio_write_pin(E6, !led_state.caps_lock);
-        gpio_write_pin(B2, !led_state.scroll_lock);
-    }
-    return true;
-}

+ 0 - 15
keyboards/handwired/colorlice/colorlice.c

@@ -51,18 +51,3 @@ void suspend_wakeup_init_kb(void)
     suspend_wakeup_init_user();
 }
 #endif
-
-bool led_update_kb(led_t led_state) {
-    bool res = led_update_user(led_state);
-    if(res) {
-        // gpio_write_pin sets the pin high for 1 and low for 0.
-        // In this example the pins are inverted, setting
-        // it low/0 turns it on, and high/1 turns the LED off.
-        // This behavior depends on whether the LED is between the pin
-        // and VCC or the pin and GND.
-        gpio_write_pin(B2, !led_state.num_lock);
-        gpio_write_pin(C6, !led_state.caps_lock);
-        gpio_write_pin(B7, !led_state.scroll_lock);
-    }
-    return res;
-}

+ 6 - 0
keyboards/handwired/colorlice/keyboard.json

@@ -65,6 +65,12 @@
     "build": {
         "lto": true
     },
+    "indicators": {
+      "caps_lock": "C6",
+      "num_lock": "B2",
+      "scroll_lock": "B7",
+      "on_state": 0
+    },
     "features": {
         "bootmagic": true,
         "command": false,

+ 0 - 9
keyboards/handwired/evk/v1_3/v1_3.c

@@ -33,12 +33,3 @@ __attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) {
     gpio_write_pin(D5, layer_state_cmp(state, 1));
     return state;
 }
-
-bool led_update_kb(led_t led_state) {
-    bool res = led_update_user(led_state);
-    if (res) {
-        // gpio_write_pin sets the pin high for 1 and low for 0.
-        gpio_write_pin(D4, led_state.caps_lock);
-    }
-    return res;
-}

+ 6 - 0
keyboards/handwired/retro_refit/keyboard.json

@@ -23,6 +23,12 @@
       "resync": true
     }
   },
+  "indicators": {
+    "caps_lock": "D0",
+    "num_lock": "D1",
+    "scroll_lock": "C6",
+    "on_state": 0
+  },
   "matrix_pins": {
     "cols": ["B0", "B1", "B2", "B3", "D2", "D3", "C7", "D5"],
     "rows": ["D4", "D7", "B4", "B5", "B6", "F7", "F6", "F5", "F4", "F1", "F0"]

+ 0 - 12
keyboards/handwired/retro_refit/retro_refit.c

@@ -1,5 +1,4 @@
 #include "quantum.h"
-#include "led.h"
 
 void matrix_init_kb(void) {
     // put your keyboard start-up code here
@@ -11,14 +10,3 @@ void matrix_init_kb(void) {
 
     matrix_init_user();
 };
-
-bool led_update_kb(led_t led_state) {
-    bool res = led_update_user(led_state);
-    if(res) {
-        gpio_write_pin(D0, !led_state.caps_lock);
-        gpio_write_pin(D1, !led_state.num_lock);
-        gpio_write_pin(C6, !led_state.scroll_lock);
-
-    }
-    return res;
-}

+ 5 - 0
keyboards/handwired/selene/keyboard.json

@@ -8,6 +8,11 @@
     "pid": "0x0001",
     "device_version": "0.0.1"
   },
+  "indicators": {
+    "caps_lock": "A2",
+    "num_lock": "A0",
+    "scroll_lock": "A1"
+  },
   "rgblight": {
     "led_count": 50
   },

+ 1 - 17
keyboards/handwired/selene/selene.c

@@ -15,24 +15,8 @@
  */
 
 
-#include "selene.h"
-
-void matrix_init_kb(void){
-    gpio_set_pin_output(NUM_LOCK_PIN);
-    gpio_set_pin_output(CAPS_LOCK_PIN);
-    gpio_set_pin_output(SCROLL_LOCK_PIN);
-}
+#include "quantum.h"
 
 void keyboard_post_init_user(void) {
     rgblight_setrgb(0xff, 0xff, 0xff);
 }
-
-bool led_update_kb(led_t led_state) {
-    bool res = led_update_user(led_state);
-    if(res) {
-        gpio_write_pin(NUM_LOCK_PIN, led_state.num_lock);
-        gpio_write_pin(CAPS_LOCK_PIN, led_state.caps_lock);
-        gpio_write_pin(SCROLL_LOCK_PIN, led_state.scroll_lock);
-    }
-    return res;
-}

+ 0 - 23
keyboards/handwired/selene/selene.h

@@ -1,23 +0,0 @@
-/* Copyright 2020 Bpendragon
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#pragma once
-
-#include "quantum.h"
-
-#define NUM_LOCK_PIN A0
-#define CAPS_LOCK_PIN A2
-#define SCROLL_LOCK_PIN A1

+ 0 - 38
keyboards/handwired/z150/config.h

@@ -1,38 +0,0 @@
-/*
-Copyright 2020 DmNosachev
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#pragma once
-
-#define NUM_LOCK_LED_PIN B5
-#define SCROLL_LOCK_LED_PIN B4
-#define CAPS_LOCK_LED_PIN B3
-
-/*
- * Feature disable options
- *  These options are also useful to firmware size reduction.
- */
-
-/* disable debug print */
-//#define NO_DEBUG
-
-/* disable print */
-//#define NO_PRINT
-
-/* disable action features */
-//#define NO_ACTION_LAYER
-//#define NO_ACTION_TAPPING
-//#define NO_ACTION_ONESHOT

+ 6 - 0
keyboards/handwired/z150/keyboard.json

@@ -16,6 +16,12 @@
         "mousekey": true,
         "nkro": false
     },
+    "indicators": {
+        "caps_lock": "B3",
+        "num_lock": "B5",
+        "scroll_lock": "B4",
+        "on_state": 0
+    },
     "matrix_pins": {
         "cols": ["B11", "B10", "B1", "B0", "A7", "A6", "A5", "A4"],
         "rows": ["B13", "B14", "B15", "A8", "A9", "A3", "A10", "A1", "A2", "A15", "A0"]

+ 0 - 39
keyboards/handwired/z150/z150.c

@@ -1,39 +0,0 @@
-/* Copyright 2020 DmNosachev
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "quantum.h"
-
-void matrix_init_kb(void) {
-    gpio_set_pin_output(NUM_LOCK_LED_PIN);
-    gpio_set_pin_output(CAPS_LOCK_LED_PIN);
-    gpio_set_pin_output(SCROLL_LOCK_LED_PIN);
-
-    gpio_write_pin_low(NUM_LOCK_LED_PIN);
-    gpio_write_pin_low(CAPS_LOCK_LED_PIN);
-    gpio_write_pin_low(SCROLL_LOCK_LED_PIN);
-
-    matrix_init_user();
-}
-
-bool led_update_kb(led_t led_state) {
-    bool res = led_update_user(led_state);
-    if(res) {
-        gpio_write_pin(NUM_LOCK_LED_PIN, !led_state.num_lock);
-        gpio_write_pin(CAPS_LOCK_LED_PIN, !led_state.caps_lock);
-        gpio_write_pin(SCROLL_LOCK_LED_PIN, !led_state.scroll_lock);
-    }
-    return res;
-}

+ 0 - 8
keyboards/kabedon/kabedon980/kabedon980.c

@@ -1,8 +0,0 @@
-#include "quantum.h"
-
- bool led_update_kb(led_t led_state) {
-    if (led_update_user(led_state)) {
-        gpio_write_pin(E6, !led_state.caps_lock);
-    }
-    return true;
-}

+ 4 - 0
keyboards/kabedon/kabedon980/keyboard.json

@@ -8,6 +8,10 @@
         "pid": "0x3938",
         "device_version": "0.0.1"
     },
+    "indicators": {
+        "caps_lock": "E6",
+        "on_state": 0
+    },
     "rgblight": {
         "saturation_steps": 8,
         "brightness_steps": 8,

+ 3 - 0
keyboards/noxary/x268/keyboard.json

@@ -32,6 +32,9 @@
   "backlight": {
     "pin": "B7"
   },
+  "indicators": {
+    "caps_lock": "B0"
+  },
   "rgblight": {
     "hue_steps": 16,
     "saturation_steps": 16,

+ 0 - 34
keyboards/noxary/x268/x268.c

@@ -1,34 +0,0 @@
-/* Copyright 2020 Rozakiin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-#include "quantum.h"
-
-// Optional override functions below.
-// You can leave any or all of these undefined.
-// These are only required if you want to perform custom actions.
-
-void matrix_init_kb(void) {
-	// put your keyboard start-up code here
-	// runs once when the firmware starts up
-    gpio_set_pin_output(B0);
-	matrix_init_user();
-}
-
-bool led_update_kb(led_t led_state) {
-    if(led_update_user(led_state)) {
-        gpio_write_pin(B0, led_state.caps_lock);
-    }
-    return true;
-}

+ 0 - 20
keyboards/punk75/config.h

@@ -1,20 +0,0 @@
-/*
-Copyright 2020 dsanchezseco
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#pragma once
-
-#define LED A0

+ 4 - 0
keyboards/punk75/keyboard.json

@@ -32,6 +32,10 @@
             {"pin_a": "B1", "pin_b": "B0"}
         ]
     },
+    "indicators": {
+        "caps_lock": "A0",
+        "on_state": 0
+    },
     "processor": "atmega32a",
     "bootloader": "usbasploader",
     "community_layouts": ["ortho_5x15"],

+ 1 - 1
keyboards/punk75/keymaps/default/keymap.c

@@ -74,7 +74,7 @@ void led_keypress_update(pin_t led_pin, uint16_t keycode, keyrecord_t *record) {
 
 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
     // Update LED state
-    led_keypress_update(LED, keycode, record);
+    led_keypress_update(LED_CAPS_LOCK_PIN, keycode, record);
     return true;
 }
 

+ 1 - 1
keyboards/punk75/keymaps/via/keymap.c

@@ -69,7 +69,7 @@ void led_keypress_update(pin_t led_pin, uint16_t keycode, keyrecord_t *record) {
 
 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
     // Update LED state
-    led_keypress_update(LED, keycode, record);
+    led_keypress_update(LED_CAPS_LOCK_PIN, keycode, record);
     return true;
 }
 

+ 0 - 32
keyboards/punk75/punk75.c

@@ -1,32 +0,0 @@
-/* Copyright 2020 dsanchezseco
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "quantum.h"
-
-void matrix_init_kb(void) {
-    // Set our LED pin as output
-    gpio_set_pin_output(LED);
-
-    matrix_init_user();
-}
-
-bool led_update_kb(led_t led_state) {
-    bool res = led_update_user(led_state);
-    if(res) {
-        gpio_write_pin(LED, !led_state.caps_lock);
-    }
-    return res;
-}

+ 4 - 0
keyboards/redscarf_i/keyboard.json

@@ -25,6 +25,10 @@
     "backlight": {
         "pin": "B5"
     },
+    "indicators": {
+        "num_lock": "F7",
+        "on_state": 0
+    },
     "processor": "atmega32u4",
     "bootloader": "atmel-dfu",
     "community_layouts": ["ortho_5x4", "ortho_6x4", "numpad_5x4", "numpad_6x4"],

+ 1 - 9
keyboards/redscarf_i/redscarf_i.c

@@ -18,21 +18,13 @@
 
 void keyboard_pre_init_kb(void) {
   // initialize top row leds
-  gpio_set_pin_output(F7);
   gpio_set_pin_output(F6);
   gpio_set_pin_output(F5);
   // and then turn them off
-  gpio_write_pin_high(F7);
   gpio_write_pin_high(F6);
   gpio_write_pin_high(F5);
-}
 
-bool led_update_kb(led_t led_state) {
-    bool res = led_update_user(led_state);
-    if(res) {
-        gpio_write_pin(F7, !led_state.num_lock);
-    }
-    return res;
+  keyboard_pre_init_user();
 }
 
 layer_state_t layer_state_set_kb(layer_state_t state) {

+ 0 - 36
keyboards/sneakbox/aliceclone/aliceclone.c

@@ -1,36 +0,0 @@
-/*
-Copyright 2020 Bryan Ong
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "quantum.h"
-
-void keyboard_pre_init_kb(void) {
-    gpio_set_pin_output(D7);
-    gpio_set_pin_output(D6);
-    gpio_set_pin_output(D4);
-    
-    keyboard_pre_init_user();
-}
-
-bool led_update_kb(led_t led_state) {
-    bool res = led_update_user(led_state);
-    if(res) {
-        gpio_write_pin(D7, led_state.num_lock);
-        gpio_write_pin(D6, led_state.caps_lock);
-        gpio_write_pin(D4, led_state.scroll_lock);
-    }
-    return res;
-}

+ 5 - 0
keyboards/sneakbox/aliceclone/keyboard.json

@@ -36,6 +36,11 @@
   "bootmagic": {
     "matrix": [2, 0]
   },
+  "indicators": {
+    "caps_lock": "D6",
+    "num_lock": "D7",
+    "scroll_lock": "D4"
+  },
   "processor": "atmega32u4",
   "bootloader": "atmel-dfu",
   "community_layouts": ["alice", "alice_split_bs"],

+ 0 - 37
keyboards/yiancardesigns/barleycorn/barleycorn.c

@@ -1,37 +0,0 @@
-/* Copyright 2020 Yiancar
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-#include "quantum.h"
-
-void keyboard_pre_init_kb(void) {
-    // Set our LED pins as output
-    gpio_set_pin_output(B5);
-    gpio_set_pin_output(C0);
-    keyboard_pre_init_user();
-}
-
-bool led_update_kb(led_t led_state) {
-    bool res = led_update_user(led_state);
-    if(res) {
-        // gpio_write_pin sets the pin high for 1 and low for 0.
-        // In this example the pins are inverted, setting
-        // it low/0 turns it on, and high/1 turns the LED off.
-        // This behavior depends on whether the LED is between the pin
-        // and VCC or the pin and GND.
-        gpio_write_pin(B5, led_state.caps_lock);
-        gpio_write_pin(C0, led_state.num_lock);
-    }
-    return res;
-}

+ 4 - 0
keyboards/yiancardesigns/barleycorn/keyboard.json

@@ -19,6 +19,10 @@
             "resync": true
         }
     },
+    "indicators": {
+      "caps_lock": "B5",
+      "num_lock": "C0"
+    },
     "processor": "atmega328p",
     "bootloader": "usbasploader",
     "layouts": {