~ruther/qmk_firmware

23222625c201cd960a5b4a99ee52e74d4c13bba9 — Joel Challis 4 years ago 4368611
Refactor to use led config - Part 5 (#10975)

* Refactor to use led config

* Refactor to use led config

* Refactor to use led config
M keyboards/al1/al1.c => keyboards/al1/al1.c +0 -24
@@ 14,27 14,3 @@
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#include "al1.h"

bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
	return process_record_user(keycode, record);
}

void led_set_kb(uint8_t usb_led) {
    CONFIG_LED_IO;
    print_dec(usb_led);
    if (usb_led & (1<<USB_LED_CAPS_LOCK))
        PORTB &= ~(1<<7);
    else
        PORTB |=  (1<<7);

    if (usb_led & (1<<USB_LED_NUM_LOCK))
        PORTD &= ~(1<<0);
    else
        PORTD |=  (1<<0);

    if (usb_led & (1<<USB_LED_SCROLL_LOCK))
        PORTD &= ~(1<<1);
    else
        PORTD |=  (1<<1);
	led_set_user(usb_led);
}

M keyboards/al1/al1.h => keyboards/al1/al1.h +0 -5
@@ 18,11 18,6 @@

#include "quantum.h"

#define CONFIG_LED_IO \
  DDRB |= (1<<7) | (1<<6); \
  DDRD |= (1<<0) | (1<<1);


#define LAYOUT( \
               K500, K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, K415, K414,\
               K501, K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K215, K413,\

M keyboards/al1/config.h => keyboards/al1/config.h +5 -0
@@ 46,6 46,11 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
/* COL2ROW, ROW2COL*/
#define DIODE_DIRECTION COL2ROW

#define LED_NUM_LOCK_PIN D0
#define LED_CAPS_LOCK_PIN B7
#define LED_SCROLL_LOCK_PIN D1
#define LED_PIN_ON_STATE 0

#define BACKLIGHT_PIN B6
#define BACKLIGHT_BREATHING
#define BACKLIGHT_LEVELS 3

M keyboards/amj40/amj40.c => keyboards/amj40/amj40.c +0 -29
@@ 1,30 1,1 @@
#include "amj40.h"
#include "led.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 our LED pins as output
    DDRB |= (1<<2);
}

void led_set_kb(uint8_t usb_led) {
    if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
        // Turn capslock on
        PORTB &= ~(1<<2);
    } else {
        // Turn capslock off
        PORTB |= (1<<2);
    }
}

M keyboards/amj40/config.h => keyboards/amj40/config.h +3 -0
@@ 38,6 38,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
#define MATRIX_COL_PINS { F1, F0, E6, C7, C6, B0, D4, B1, B7, B5, B4, D7}
#define UNUSED_PINS

#define LED_CAPS_LOCK_PIN B2
#define LED_PIN_ON_STATE 0

#define BACKLIGHT_PIN B6

/* COL2ROW or ROW2COL */

M keyboards/doro67/multi/config.h => keyboards/doro67/multi/config.h +3 -0
@@ 29,5 29,8 @@

#define DIODE_DIRECTION COL2ROW

#define LED_CAPS_LOCK_PIN E6
#define LED_PIN_ON_STATE 0

#define BACKLIGHT_PIN B7
#define BACKLIGHT_LEVELS 7

M keyboards/doro67/multi/multi.c => keyboards/doro67/multi/multi.c +0 -34
@@ 14,37 14,3 @@
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#include "multi.h"

void matrix_init_kb(void) {
	// put your keyboard start-up code here
	// runs once when the firmware starts up

    setPinOutput(E6);
	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_set_kb(uint8_t usb_led) {
	// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here

	if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
		writePinLow(E6);
	} else {
		writePinHigh(E6);
	}

	led_set_user(usb_led);
}

M keyboards/doro67/regular/config.h => keyboards/doro67/regular/config.h +3 -0
@@ 28,3 28,6 @@
#define MATRIX_COL_PINS { B0, B1, B2, B3, D4, D6, D7, B4, B5, B6, C6, C7, F5, F6, F7 }

#define DIODE_DIRECTION COL2ROW

#define LED_CAPS_LOCK_PIN E6
#define LED_PIN_ON_STATE 0

M keyboards/doro67/regular/regular.c => keyboards/doro67/regular/regular.c +0 -31
@@ 14,34 14,3 @@
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#include "regular.h"

void matrix_init_kb(void) {
	// put your keyboard start-up code here
	// runs once when the firmware starts up
  setPinOutput(E6);
	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_set_kb(uint8_t usb_led) {
	// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
  if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
    writePinLow(E6);
  } else {
    writePinHigh(E6);
  }
	led_set_user(usb_led);
}

M keyboards/doro67/rgb/config.h => keyboards/doro67/rgb/config.h +3 -0
@@ 48,6 48,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
/* COL2ROW, ROW2COL*/
#define DIODE_DIRECTION COL2ROW

#define LED_CAPS_LOCK_PIN E6
#define LED_PIN_ON_STATE 0

// The pin connected to the data pin of the LEDs
#define RGB_DI_PIN B7
// The number of LEDs connected

M keyboards/doro67/rgb/rgb.c => keyboards/doro67/rgb/rgb.c +0 -37
@@ 16,43 16,6 @@
#include "rgb.h"
#include "rgb_matrix_types.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
  setPinOutput(E6);
  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_set_kb(uint8_t usb_led) {
	// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
  if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
    writePinLow(E6);
  } else {
    writePinHigh(E6);
  }
	led_set_user(usb_led);
}

led_config_t g_led_config = { {
  {   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14 },
  {  15,  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29 },

M keyboards/espectro/config.h => keyboards/espectro/config.h +5 -0
@@ 38,6 38,11 @@
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW

#define LED_NUM_LOCK_PIN B0
#define LED_CAPS_LOCK_PIN B2
#define LED_SCROLL_LOCK_PIN B1
#define LED_PIN_ON_STATE 0

/* number of backlight levels */
#define BACKLIGHT_PIN B6
#define BACKLIGHT_LEVELS 5

M keyboards/espectro/espectro.c => keyboards/espectro/espectro.c +1 -60
@@ 14,63 14,4 @@
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */


#include QMK_KEYBOARD_H
#include "quantum.h"


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_set_kb(uint8_t usb_led) {
	// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here

	led_set_user(usb_led);
}

__attribute__ ((weak))
void led_set_user(uint8_t usb_led) {

	if (usb_led & (1 << USB_LED_NUM_LOCK)) {
		DDRB |= (1 << 0); PORTB &= ~(1 << 0);
	} else {
		DDRB &= ~(1 << 0); PORTB &= ~(1 << 0);
	}

	if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
		DDRB |= (1 << 2); PORTB &= ~(1 << 2);
	} else {
		DDRB &= ~(1 << 2); PORTB &= ~(1 << 2);
	}

	if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
		DDRB |= (1 << 1); PORTB &= ~(1 << 1);
	} else {
		DDRB &= ~(1 << 1); PORTB &= ~(1 << 1);
	}

	if (usb_led & (1 << USB_LED_COMPOSE)) {

	} else {

	}

	if (usb_led & (1 << USB_LED_KANA)) {

	} else {

	}

}

#include "espectro.h"

M keyboards/evil80/config.h => keyboards/evil80/config.h +5 -4
@@ 19,16 19,17 @@
#define MATRIX_COL_PINS { B2, D0, D1, D2, D3, D5, D4, D6, D7, B4, B1, C6, C7, E6, F6, F7 }
#define UNUSED_PINS

#define BACKLIGHT_PIN B5
#define BACKLIGHT_BREATHING

/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW

/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST

/* number of backlight levels */
#define LED_CAPS_LOCK_PIN B6
#define LED_SCROLL_LOCK_PIN B7

#define BACKLIGHT_PIN B5
#define BACKLIGHT_BREATHING
#define BACKLIGHT_LEVELS 3

/* Set 0 if debouncing isn't needed */

M keyboards/evil80/evil80.c => keyboards/evil80/evil80.c +0 -46
@@ 1,47 1,1 @@
#include "evil80.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) {
    if (usb_led & (1<<USB_LED_CAPS_LOCK))
    {
        PORTB |= (1<<6); // HI
    }
    else
    {
        PORTB &= ~(1<<6); // LO
    }

    if (usb_led & (1<<USB_LED_SCROLL_LOCK))
    {
        PORTB |= (1<<7); // HI
    }
    else
    {
        PORTB &= ~(1<<7); // LO
    }

    led_set_user(usb_led);
}

M keyboards/fc660c/config.h => keyboards/fc660c/config.h +3 -0
@@ 37,6 37,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST

#define LED_CAPS_LOCK_PIN B6
#define LED_PIN_ON_STATE 0

/* number of backlight levels */
// #define BACKLIGHT_LEVELS  1


M keyboards/fc660c/fc660c.c => keyboards/fc660c/fc660c.c +0 -27
@@ 21,36 21,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
#endif

void matrix_init_kb(void) {
	// put your keyboard start-up code here
	// runs once when the firmware starts up

#ifdef ACTUATION_DEPTH_ADJUSTMENT
    adjust_actuation_point(ACTUATION_DEPTH_ADJUSTMENT);
#endif

	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_set_kb(uint8_t usb_led) {
    if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
        PORTB &= ~(1<<6);
    } else {
        PORTB |=  (1<<6);
    }

	led_set_user(usb_led);
}

M keyboards/gh60/revc/config.h => keyboards/gh60/revc/config.h +3 -0
@@ 57,6 57,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* define if matrix has ghost (lacks anti-ghosting diodes) */
//#define MATRIX_HAS_GHOST

#define LED_CAPS_LOCK_PIN B2
#define LED_PIN_ON_STATE 0

/* number of backlight levels */
#define BACKLIGHT_LEVELS 3


M keyboards/gh60/revc/revc.c => keyboards/gh60/revc/revc.c +0 -26
@@ 1,27 1,1 @@
#include "revc.h"


extern inline void gh60_caps_led_on(void);
extern inline void gh60_poker_leds_on(void);
extern inline void gh60_fn_led_on(void);
extern inline void gh60_esc_led_on(void);
extern inline void gh60_wasd_leds_on(void);

extern inline void gh60_caps_led_off(void);
extern inline void gh60_poker_leds_off(void);
extern inline void gh60_fn_led_off(void);
extern inline void gh60_esc_led_off(void);
extern inline void gh60_wasd_leds_off(void);


void led_set_kb(uint8_t usb_led) {
    // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here

    if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
        gh60_caps_led_on();
    } else {
        gh60_caps_led_off();
    }

    led_set_user(usb_led);
}

M keyboards/gh60/revc/revc.h => keyboards/gh60/revc/revc.h +10 -10
@@ 12,17 12,17 @@
 *   B2 Capslock LED
 *   B0 not connected
 */
inline void gh60_caps_led_on(void)      { setPinOutput(B2); writePinLow(B2); }
inline void gh60_poker_leds_on(void)    { setPinOutput(F4); writePinLow(F4); }
inline void gh60_fn_led_on(void)        { setPinOutput(F5); writePinLow(F5); }
inline void gh60_esc_led_on(void)       { setPinOutput(F6); writePinLow(F6); }
inline void gh60_wasd_leds_on(void)     { setPinOutput(F7); writePinLow(F7); }
static inline void gh60_caps_led_on(void)      { setPinOutput(B2); writePinLow(B2); }
static inline void gh60_poker_leds_on(void)    { setPinOutput(F4); writePinLow(F4); }
static inline void gh60_fn_led_on(void)        { setPinOutput(F5); writePinLow(F5); }
static inline void gh60_esc_led_on(void)       { setPinOutput(F6); writePinLow(F6); }
static inline void gh60_wasd_leds_on(void)     { setPinOutput(F7); writePinLow(F7); }

inline void gh60_caps_led_off(void)     { setPinInput(B2); }
inline void gh60_poker_leds_off(void)   { setPinInput(F4); }
inline void gh60_fn_led_off(void)       { setPinInput(F5); }
inline void gh60_esc_led_off(void)      { setPinInput(F6); }
inline void gh60_wasd_leds_off(void)    { setPinInput(F7); }
static inline void gh60_caps_led_off(void)     { setPinInput(B2); }
static inline void gh60_poker_leds_off(void)   { setPinInput(F4); }
static inline void gh60_fn_led_off(void)       { setPinInput(F5); }
static inline void gh60_esc_led_off(void)      { setPinInput(F6); }
static inline void gh60_wasd_leds_off(void)    { setPinInput(F7); }

/* GH60 keymap definition macro
 * K2C, K31 and  K3C are extra keys for ISO

M keyboards/gh60/satan/config.h => keyboards/gh60/satan/config.h +3 -0
@@ 37,6 37,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B7, D4, B1, B0, B5, B4, D7, D6, B3 }
#define UNUSED_PINS

#define LED_NUM_LOCK_PIN B2
#define LED_PIN_ON_STATE 0

#define BACKLIGHT_PIN B6

/* COL2ROW or ROW2COL */

M keyboards/gh60/satan/satan.c => keyboards/gh60/satan/satan.c +0 -23
@@ 1,24 1,1 @@
#include "satan.h"

void matrix_init_kb(void) {
  matrix_init_user();
  led_init_ports();
};

void matrix_scan_kb(void) {
  matrix_scan_user();
};

void led_init_ports(void) {
  setPinOutput(B2);
}

void led_set_kb(uint8_t usb_led) {
  if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
    // Turn Caps Lock LED on
    writePinLow(B2);
  } else {
    // Turn Caps Lock LED off
    writePinHigh(B2);
  }
}

M keyboards/kinesis/stapelberg/config.h => keyboards/kinesis/stapelberg/config.h +6 -1
@@ 27,7 27,12 @@

/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
 

#define LED_NUM_LOCK_PIN F2
#define LED_CAPS_LOCK_PIN F3
#define LED_SCROLL_LOCK_PIN F1
#define LED_COMPOSE_PIN F0
#define LED_PIN_ON_STATE 0

/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5

M keyboards/kinesis/stapelberg/stapelberg.c => keyboards/kinesis/stapelberg/stapelberg.c +0 -60
@@ 1,61 1,1 @@
#include "stapelberg.h"

void matrix_init_kb(void) {
	// put your keyboard start-up code here
	// runs once when the firmware starts up
    // * Set our LED pins as output
    DDRF |= (1<<0); // Keypad LED
    DDRF |= (1<<1); // ScrLock LED
    DDRF |= (1<<2); // NumLock LED
    DDRF |= (1<<3); // CapsLock LED

	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() {
  // * Set our LED pins as output
  DDRF |= (1<<0); // Keypad LED
  DDRF |= (1<<1); // ScrLock LED
  DDRF |= (1<<2); // NumLock LED
  DDRF |= (1<<3); // CapsLock LED
}

void led_set_kb(uint8_t usb_led) {
  if (usb_led & (1<<USB_LED_COMPOSE)) {
      PORTF &= ~(1<<0);
  } else {
      PORTF |= (1<<0);
  }

  if (usb_led & (1<<USB_LED_SCROLL_LOCK)) {
      PORTF &= ~(1<<1);
  } else {
      PORTF |= (1<<1);
  }

  if (usb_led & (1<<USB_LED_NUM_LOCK)) {
      PORTF &= ~(1<<2);
  } else {
      PORTF |= (1<<2);
  }

  if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
      PORTF &= ~(1<<3);
  } else {
      PORTF |= (1<<3);
  }
}

M keyboards/noxary/260/260.c => keyboards/noxary/260/260.c +0 -45
@@ 14,48 14,3 @@
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#include "260.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
  setPinOutput(B1);
	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_set_kb(uint8_t usb_led) {
  // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here

  led_set_user(usb_led);
}

*/

void led_set_kb(uint8_t usb_led) {
  if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
    writePinLow(B1);
  } else {
    writePinHigh(B1);
  }

	led_set_user(usb_led);
}
\ No newline at end of file

M keyboards/noxary/260/config.h => keyboards/noxary/260/config.h +3 -0
@@ 48,6 48,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
/* COL2ROW, ROW2COL*/
#define DIODE_DIRECTION COL2ROW

#define LED_CAPS_LOCK_PIN B1
#define LED_PIN_ON_STATE 0

/*
 * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN.
 */

M keyboards/playkbtw/ca66/ca66.c => keyboards/playkbtw/ca66/ca66.c +0 -11
@@ 1,12 1,1 @@
#include "ca66.h"

void led_set_kb(uint8_t usb_led) {
	// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
  if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
    writePinHigh(D1);
  } else {
    writePinLow(D1);
  }

	led_set_user(usb_led);
}

M keyboards/playkbtw/ca66/config.h => keyboards/playkbtw/ca66/config.h +2 -0
@@ 22,6 22,8 @@
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW

#define LED_CAPS_LOCK_PIN D1

/* number of backlight levels */

#define BACKLIGHT_PIN F0

M keyboards/playkbtw/pk60/config.h => keyboards/playkbtw/pk60/config.h +3 -0
@@ 23,6 23,9 @@
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW

#define LED_CAPS_LOCK_PIN F4
#define LED_PIN_ON_STATE 0

/* number of backlight levels */
#define BACKLIGHT_PIN B7
#ifdef BACKLIGHT_PIN

M keyboards/playkbtw/pk60/pk60.c => keyboards/playkbtw/pk60/pk60.c +0 -34
@@ 1,35 1,1 @@
#include "pk60.h"
#include "led.h"

void matrix_init_kb (void) {

  matrix_init_user();
  led_init_ports();

}

void matrix_scan_kb(void) {

  matrix_scan_user();

};

void led_init_ports(void) {
  // Set capslock LED pin as pinout
  DDRF |= (1 << 4);
  PORTF |= (1 << 4);

}

void led_set_kb(uint8_t usb_led) {
    
  if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
      // Turn capslock on
      PORTF &= ~(1 << 4);
  } else {
      // Turn capslock off
      PORTF |= (1 << 4);
  }
  led_set_user(usb_led);

}
\ No newline at end of file

M keyboards/redscarf_iiplus/verc/config.h => keyboards/redscarf_iiplus/verc/config.h +3 -4
@@ 49,10 49,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
/* COL2ROW, ROW2COL*/
#define DIODE_DIRECTION COL2ROW

/*
 * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN.
 */
//#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6
#define LED_NUM_LOCK_PIN E6
#define LED_CAPS_LOCK_PIN C7
#define LED_PIN_ON_STATE 0

#define BACKLIGHT_PIN B7
//   #define BACKLIGHT_BREATHING

M keyboards/redscarf_iiplus/verc/verc.c => keyboards/redscarf_iiplus/verc/verc.c +0 -35
@@ 14,38 14,3 @@
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#include "verc.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);
	setPinOutput(E6);
}

void led_set_kb(uint8_t usb_led) {
    // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here

    if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
        writePinLow(C7);
    } else {
        writePinHigh(C7);
    }

    if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) {
        writePinLow(E6);
    } else {
        writePinHigh(E6);
    }

    led_set_user(usb_led);
}

M keyboards/sentraq/s65_plus/config.h => keyboards/sentraq/s65_plus/config.h +3 -0
@@ 20,6 20,9 @@
#define MATRIX_COL_PINS { F6, F5, F4, F1, F0, E6, B0, B1, D5, B2, B3, D0, D1, D2, D4, D6, D7, F7 }
#define UNUSED_PINS

#define LED_CAPS_LOCK_PIN B7
#define LED_PIN_ON_STATE 0

/* number of backlight levels */
#define BACKLIGHT_PIN B7
#define BACKLIGHT_LEVELS 3

M keyboards/sentraq/s65_plus/s65_plus.c => keyboards/sentraq/s65_plus/s65_plus.c +0 -23
@@ 1,24 1,1 @@
#include "s65_plus.h"
#include "led.h"

void matrix_init_kb(void) {
  // put your keyboard start-up code here
  // runs once when the firmware starts up
  matrix_init_user();
};

void matrix_scan_kb(void) {
  // put your looping keyboard code here
  // runs every cycle (a lot)
  matrix_scan_user();
};

void led_set_kb(uint8_t usb_led) {
  if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
    // Turn capslock on
    PORTB &= ~(1<<7);
  } else {
    // Turn capslock off
    PORTB |= (1<<7);
  }
}

M keyboards/tada68/config.h => keyboards/tada68/config.h +3 -0
@@ 51,6 51,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE

#define LED_CAPS_LOCK_PIN B2
#define LED_PIN_ON_STATE 0

/* Backlight configuration */
#define BACKLIGHT_PIN B6
#define BACKLIGHT_BREATHING

M keyboards/tada68/tada68.c => keyboards/tada68/tada68.c +0 -30
@@ 1,31 1,1 @@
#include "tada68.h"
#include "led.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 our LED pins as output
    DDRB |= (1<<2);
}

void led_set_kb(uint8_t usb_led) {
	if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
        // Turn capslock on
        PORTB &= ~(1<<2);
    } else {
        // Turn capslock off
        PORTB |= (1<<2);
    }
	led_set_user(usb_led);
}

M keyboards/toad/config.h => keyboards/toad/config.h +4 -0
@@ 23,6 23,10 @@
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW

#define LED_CAPS_LOCK_PIN B6
#define LED_SCROLL_LOCK_PIN B5
#define LED_PIN_ON_STATE 0

/* number of backlight levels */

#ifdef BACKLIGHT_PIN

M keyboards/toad/toad.c => keyboards/toad/toad.c +0 -17
@@ 1,18 1,1 @@
#include "toad.h"

void led_set_user(uint8_t usb_led) {

	//LED1
	if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
		DDRB |= (1 << 6); PORTB &= ~(1 << 6);
	} else {
		DDRB &= ~(1 << 6); PORTB &= ~(1 << 6);
	}

	//LED2
	if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
		DDRB |= (1 << 5); PORTB &= ~(1 << 5);
	} else {
		DDRB &= ~(1 << 5); PORTB &= ~(1 << 5);
	}
}

M keyboards/westfoxtrot/aanzee/aanzee.c => keyboards/westfoxtrot/aanzee/aanzee.c +0 -38
@@ 1,55 1,17 @@
/* Copyright 2019 westfoxtrot

*

* 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 "aanzee.h"

void keyboard_pre_init_kb(void) {

    // Call the keyboard pre init code.
    // Set our LED pins as output
    setPinOutput(B2);

    keyboard_pre_init_user();
}

void led_set_kb(uint8_t usb_led) {

    if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {

        // Turn capslock on
        writePinLow(B2);
    } else {

        // Turn capslock off
        writePinHigh(B2);
    }

    led_set_user(usb_led);
}

M keyboards/westfoxtrot/aanzee/config.h => keyboards/westfoxtrot/aanzee/config.h +3 -0
@@ 40,6 40,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW

#define LED_CAPS_LOCK_PIN B2
#define LED_PIN_ON_STATE 0

#define BACKLIGHT_PIN B7
#define BACKLIGHT_BREATHING
#define BACKLIGHT_LEVELS 5

M keyboards/xmmx/config.h => keyboards/xmmx/config.h +4 -0
@@ 23,6 23,10 @@
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW

#define LED_CAPS_LOCK_PIN B6
#define LED_SCROLL_LOCK_PIN B5
#define LED_PIN_ON_STATE 0

/* number of backlight levels */

#ifdef BACKLIGHT_PIN

M keyboards/xmmx/xmmx.c => keyboards/xmmx/xmmx.c +0 -17
@@ 1,18 1,1 @@
#include "xmmx.h"

void led_set_user(uint8_t usb_led) {

	//LED1
	if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
		DDRB |= (1 << 6); PORTB &= ~(1 << 6);
	} else {
		DDRB &= ~(1 << 6); PORTB &= ~(1 << 6);
	}

	//LED2
	if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
		DDRB |= (1 << 5); PORTB &= ~(1 << 5);
	} else {
		DDRB &= ~(1 << 5); PORTB &= ~(1 << 5);
	}
}