Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unconditionally call led_init_ports #12116

Merged
merged 2 commits into from
Aug 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions keyboards/clueboard/66/rev4/rev4.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
#include "rev4.h"

void matrix_init_kb(void) {
led_init_ports();

matrix_init_user();
}

void led_init_ports() {
void led_init_ports(void) {
// Set our LED pins as output
setPinOutput(B13); // LED1
writePinLow(B13);
Expand Down
1 change: 0 additions & 1 deletion keyboards/dk60/dk60.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ void dk60_blink_all_leds(void) {
}

void matrix_init_kb(void) {
led_init_ports();
dk60_blink_all_leds();

matrix_init_user();
Expand Down
13 changes: 0 additions & 13 deletions keyboards/evyd13/atom47/rev2/rev2.c
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
#include "rev2.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<<5);
Expand Down
13 changes: 0 additions & 13 deletions keyboards/evyd13/atom47/rev3/rev3.c
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
#include "rev3.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
DDRE |= (1 << 6);
Expand Down
8 changes: 0 additions & 8 deletions keyboards/evyd13/gh80_3700/gh80_3700.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@
*/
#include "gh80_3700.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(E6);
setPinOutput(B1);
Expand Down
6 changes: 0 additions & 6 deletions keyboards/evyd13/pockettype/pockettype.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@
*/
#include "pockettype.h"

void matrix_init_kb(void) {
led_init_ports();

matrix_init_user();
};

void led_init_ports(void) {
// * Enable LED anodes (Vbus pin is replaced by B0 on some boards)
setPinOutput(B0);
Expand Down
4 changes: 0 additions & 4 deletions keyboards/handwired/jopr/jopr.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#include "jopr.h"
void matrix_init_kb(void) {
matrix_init_user();
led_init_ports();
};

void led_init_ports(void) {
setPinOutput(F0);
Expand Down
4 changes: 2 additions & 2 deletions keyboards/hardlineworks/otd_plus/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW

#define CAPS_LOCK_LED_PIN F4
#define SCROLL_LOCK_LED_PIN D5
#define LED_CAPS_LOCK_PIN F4
#define LED_SCROLL_LOCK_PIN D5

/* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5
Expand Down
11 changes: 0 additions & 11 deletions keyboards/hardlineworks/otd_plus/otd_plus.c
Original file line number Diff line number Diff line change
@@ -1,12 +1 @@
#include "otd_plus.h"

void keyboard_pre_init_kb(void) {
led_init_ports();
keyboard_pre_init_user();
}
void led_init_ports(void) {
setPinOutput(CAPS_LOCK_LED_PIN);
setPinOutput(SCROLL_LOCK_LED_PIN);
}


3 changes: 2 additions & 1 deletion keyboards/id80/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define BACKLIGHT_BREATHING
#define BACKLIGHT_LEVELS 3

#define CAPS_LOCK_LED_PIN C7
#define LED_CAPS_LOCK_PIN C7
#define LED_PIN_ON_STATE 0

#define RGB_DI_PIN E2
#ifdef RGB_DI_PIN
Expand Down
20 changes: 0 additions & 20 deletions keyboards/id80/id80.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,3 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "id80.h"

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

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

bool led_update_kb(led_t led_state) {
bool res = led_update_user(led_state);
if (res) {
writePin(CAPS_LOCK_LED_PIN, !led_state.caps_lock);
}
return res;
}

// partially generated by KBFirmware JSON to QMK Parser
// https://noroadsleft.github.io/kbf_qmk_converter/
2 changes: 1 addition & 1 deletion keyboards/id87/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define BACKLIGHT_LEVELS 3
#endif

#define CAPS_LOCK_LED_PIN C7
#define LED_CAPS_LOCK_PIN C7

/* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5
Expand Down
17 changes: 0 additions & 17 deletions keyboards/id87/id87.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "id87.h"

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

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

bool led_update_kb(led_t led_state) {
bool res = led_update_user(led_state);
if (res) {
writePin(CAPS_LOCK_LED_PIN, led_state.caps_lock);
}
return res;
}
21 changes: 0 additions & 21 deletions keyboards/kmini/kmini.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,6 @@
*/
#include "kmini.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<<1); // OUT
DDRB |= (1<<2); // OUT
Expand Down
4 changes: 2 additions & 2 deletions keyboards/knops/mini/keymaps/default-gsm-newbs/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ void set_layer_led(int layerId) {
}

void matrix_init_user(void) {
led_init_ports();
led_init_ports_user();

PORTB |= (1 << 7);
DDRB &= ~(1<<7);
Expand All @@ -223,7 +223,7 @@ void matrix_init_user(void) {
void matrix_scan_user(void) {
}

void led_init_ports() {
void led_init_ports_user() {
// led voor switch #1
DDRD |= (1<<7);
PORTD &= ~(1<<7);
Expand Down
4 changes: 2 additions & 2 deletions keyboards/knops/mini/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void set_layer_led(int layerId) {
}

void matrix_init_user(void) {
led_init_ports();
led_init_ports_user();

PORTB |= (1 << 7);
DDRB &= ~(1<<7);
Expand All @@ -149,7 +149,7 @@ void matrix_init_user(void) {
void matrix_scan_user(void) {
}

void led_init_ports() {
void led_init_ports_user() {
// led voor switch #1
DDRD |= (1<<7);
PORTD &= ~(1<<7);
Expand Down
4 changes: 2 additions & 2 deletions keyboards/knops/mini/keymaps/knops/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void set_led_state(int ledId, bool state) {
}
}

void led_init_ports() {
void led_init_ports_user() {
PORTB |= (1 << 7);
DDRB &= ~(1<<7);

Expand All @@ -106,7 +106,7 @@ void led_set_layer(int layer) {
}

void matrix_init_user(void) {
led_init_ports();
led_init_ports_user();

led_set_layer(1);

Expand Down
4 changes: 2 additions & 2 deletions keyboards/knops/mini/keymaps/mverteuil/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ void led_set_layer(int layer) {
/*
* Prepare all LED ports for output
*/
void led_init_ports() {
void led_init_ports_user() {
setPinOutput(D7); // Switch 1 LED
setPinOutput(C6); // Switch 2 LED Pin1
setPinOutput(C7); // Switch 2 LED Pin2
Expand All @@ -291,7 +291,7 @@ layer_state_t layer_state_set_user(layer_state_t state) {
}

void matrix_init_user(void) {
led_init_ports();
led_init_ports_user();
led_init_animation();
}

Expand Down
7 changes: 0 additions & 7 deletions keyboards/mechlovin/hannah60rgb/rev1/rev1.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@

#include "hannah60rgb.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();
};

#ifdef RGB_MATRIX_ENABLE
led_config_t g_led_config = { {
//Key Matrix to LED Index
Expand Down
4 changes: 0 additions & 4 deletions keyboards/mechlovin/hannah910/hannah910.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
*/
#include "hannah910.h"

void matrix_init_kb(void) {
matrix_init_user();
led_init_ports();
};
void led_init_ports(void) {
setPinOutput(B2);
setPinOutput(D0);
Expand Down
4 changes: 0 additions & 4 deletions keyboards/mechlovin/infinity87/rev2/rev2.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@

#include "rev2.h"

void matrix_init_kb(void) {
matrix_init_user();
led_init_ports();
};
void led_init_ports(void) {
setPinOutput(A5);
setPinOutput(A6);
Expand Down
7 changes: 0 additions & 7 deletions keyboards/mechlovin/infinityce/infinityce.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@

#include "infinityce.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(B3);
Expand Down
4 changes: 0 additions & 4 deletions keyboards/mechlovin/kanu/kanu.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@

#include "kanu.h"

void matrix_init_kb(void) {
matrix_init_user();
led_init_ports();
};
void led_init_ports(void) {
setPinOutput(B2);
setPinOutput(D0);
Expand Down
17 changes: 0 additions & 17 deletions keyboards/tokyokeyboard/tokyo60/tokyo60.c
Original file line number Diff line number Diff line change
@@ -1,18 +1 @@
#include "tokyo60.h"

void matrix_init_kb(void) {
// Keyboard start-up code goes here
// Runs once when the firmware starts up
matrix_init_user();
led_init_ports();
};

void matrix_scan_kb(void) {
// Looping keyboard code goes here
// This runs every cycle (a lot)
matrix_scan_user();
};

void led_init_ports(void) {
/* LEDs on */
}
4 changes: 4 additions & 0 deletions keyboards/wheatfield/split75/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
#define MATRIX_ROWS 8
#define MATRIX_COLS 14

#define LED_NUM_LOCK_PIN D0
#define LED_CAPS_LOCK_PIN D1
#define LED_SCROLL_LOCK_PIN D6

#define RGBLED_NUM 8
#define RGBLIGHT_ANIMATIONS
#define RGBLIGHT_SLEEP
Expand Down
Loading