Unconditionally call led_init_ports (#12116)

* Unconditionally call led_init_ports

* Another call to led_init_ports
This commit is contained in:
Joel Challis 2021-08-03 18:34:32 +01:00 committed by GitHub
parent 2bc7511b9e
commit 3f419dc872
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 20 additions and 215 deletions

View File

@ -1,12 +1,6 @@
#include "rev4.h" #include "rev4.h"
void matrix_init_kb(void) { void led_init_ports(void) {
led_init_ports();
matrix_init_user();
}
void led_init_ports() {
// Set our LED pins as output // Set our LED pins as output
setPinOutput(B13); // LED1 setPinOutput(B13); // LED1
writePinLow(B13); writePinLow(B13);

View File

@ -34,7 +34,6 @@ void dk60_blink_all_leds(void) {
} }
void matrix_init_kb(void) { void matrix_init_kb(void) {
led_init_ports();
dk60_blink_all_leds(); dk60_blink_all_leds();
matrix_init_user(); matrix_init_user();

View File

@ -1,19 +1,6 @@
#include "rev2.h" #include "rev2.h"
#include "led.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) { void led_init_ports(void) {
// * Set our LED pins as output // * Set our LED pins as output
DDRB &= ~(1<<5); DDRB &= ~(1<<5);

View File

@ -1,19 +1,6 @@
#include "rev3.h" #include "rev3.h"
#include "led.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) { void led_init_ports(void) {
// * Set our LED pins as output // * Set our LED pins as output
DDRE |= (1 << 6); DDRE |= (1 << 6);

View File

@ -15,14 +15,6 @@
*/ */
#include "gh80_3700.h" #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) { void led_init_ports(void) {
setPinOutput(E6); setPinOutput(E6);
setPinOutput(B1); setPinOutput(B1);

View File

@ -15,12 +15,6 @@
*/ */
#include "pockettype.h" #include "pockettype.h"
void matrix_init_kb(void) {
led_init_ports();
matrix_init_user();
};
void led_init_ports(void) { void led_init_ports(void) {
// * Enable LED anodes (Vbus pin is replaced by B0 on some boards) // * Enable LED anodes (Vbus pin is replaced by B0 on some boards)
setPinOutput(B0); setPinOutput(B0);

View File

@ -1,8 +1,4 @@
#include "jopr.h" #include "jopr.h"
void matrix_init_kb(void) {
matrix_init_user();
led_init_ports();
};
void led_init_ports(void) { void led_init_ports(void) {
setPinOutput(F0); setPinOutput(F0);

View File

@ -20,8 +20,8 @@
/* COL2ROW or ROW2COL */ /* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW #define DIODE_DIRECTION COL2ROW
#define CAPS_LOCK_LED_PIN F4 #define LED_CAPS_LOCK_PIN F4
#define SCROLL_LOCK_LED_PIN D5 #define LED_SCROLL_LOCK_PIN D5
/* Set 0 if debouncing isn't needed */ /* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5 #define DEBOUNCE 5

View File

@ -1,12 +1 @@
#include "otd_plus.h" #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);
}

View File

@ -57,7 +57,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define BACKLIGHT_BREATHING #define BACKLIGHT_BREATHING
#define BACKLIGHT_LEVELS 3 #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 #define RGB_DI_PIN E2
#ifdef RGB_DI_PIN #ifdef RGB_DI_PIN

View File

@ -14,23 +14,3 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "id80.h" #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/

View File

@ -51,7 +51,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define BACKLIGHT_LEVELS 3 #define BACKLIGHT_LEVELS 3
#endif #endif
#define CAPS_LOCK_LED_PIN C7 #define LED_CAPS_LOCK_PIN C7
/* Set 0 if debouncing isn't needed */ /* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5 #define DEBOUNCE 5

View File

@ -13,20 +13,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "id87.h" #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;
}

View File

@ -15,27 +15,6 @@
*/ */
#include "kmini.h" #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) { void led_init_ports(void) {
DDRB |= (1<<1); // OUT DDRB |= (1<<1); // OUT
DDRB |= (1<<2); // OUT DDRB |= (1<<2); // OUT

View File

@ -204,7 +204,7 @@ void set_layer_led(int layerId) {
} }
void matrix_init_user(void) { void matrix_init_user(void) {
led_init_ports(); led_init_ports_user();
PORTB |= (1 << 7); PORTB |= (1 << 7);
DDRB &= ~(1<<7); DDRB &= ~(1<<7);
@ -223,7 +223,7 @@ void matrix_init_user(void) {
void matrix_scan_user(void) { void matrix_scan_user(void) {
} }
void led_init_ports() { void led_init_ports_user() {
// led voor switch #1 // led voor switch #1
DDRD |= (1<<7); DDRD |= (1<<7);
PORTD &= ~(1<<7); PORTD &= ~(1<<7);

View File

@ -130,7 +130,7 @@ void set_layer_led(int layerId) {
} }
void matrix_init_user(void) { void matrix_init_user(void) {
led_init_ports(); led_init_ports_user();
PORTB |= (1 << 7); PORTB |= (1 << 7);
DDRB &= ~(1<<7); DDRB &= ~(1<<7);
@ -149,7 +149,7 @@ void matrix_init_user(void) {
void matrix_scan_user(void) { void matrix_scan_user(void) {
} }
void led_init_ports() { void led_init_ports_user() {
// led voor switch #1 // led voor switch #1
DDRD |= (1<<7); DDRD |= (1<<7);
PORTD &= ~(1<<7); PORTD &= ~(1<<7);

View File

@ -82,7 +82,7 @@ void set_led_state(int ledId, bool state) {
} }
} }
void led_init_ports() { void led_init_ports_user() {
PORTB |= (1 << 7); PORTB |= (1 << 7);
DDRB &= ~(1<<7); DDRB &= ~(1<<7);
@ -106,7 +106,7 @@ void led_set_layer(int layer) {
} }
void matrix_init_user(void) { void matrix_init_user(void) {
led_init_ports(); led_init_ports_user();
led_set_layer(1); led_set_layer(1);

View File

@ -270,7 +270,7 @@ void led_set_layer(int layer) {
/* /*
* Prepare all LED ports for output * Prepare all LED ports for output
*/ */
void led_init_ports() { void led_init_ports_user() {
setPinOutput(D7); // Switch 1 LED setPinOutput(D7); // Switch 1 LED
setPinOutput(C6); // Switch 2 LED Pin1 setPinOutput(C6); // Switch 2 LED Pin1
setPinOutput(C7); // Switch 2 LED Pin2 setPinOutput(C7); // Switch 2 LED Pin2
@ -291,7 +291,7 @@ layer_state_t layer_state_set_user(layer_state_t state) {
} }
void matrix_init_user(void) { void matrix_init_user(void) {
led_init_ports(); led_init_ports_user();
led_init_animation(); led_init_animation();
} }

View File

@ -16,13 +16,6 @@
#include "hannah60rgb.h" #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 #ifdef RGB_MATRIX_ENABLE
led_config_t g_led_config = { { led_config_t g_led_config = { {
//Key Matrix to LED Index //Key Matrix to LED Index

View File

@ -15,10 +15,6 @@
*/ */
#include "hannah910.h" #include "hannah910.h"
void matrix_init_kb(void) {
matrix_init_user();
led_init_ports();
};
void led_init_ports(void) { void led_init_ports(void) {
setPinOutput(B2); setPinOutput(B2);
setPinOutput(D0); setPinOutput(D0);

View File

@ -16,10 +16,6 @@
#include "rev2.h" #include "rev2.h"
void matrix_init_kb(void) {
matrix_init_user();
led_init_ports();
};
void led_init_ports(void) { void led_init_ports(void) {
setPinOutput(A5); setPinOutput(A5);
setPinOutput(A6); setPinOutput(A6);

View File

@ -16,13 +16,6 @@
#include "infinityce.h" #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) { void led_init_ports(void) {
// * Set our LED pins as output // * Set our LED pins as output
setPinOutput(B3); setPinOutput(B3);

View File

@ -16,10 +16,6 @@
#include "kanu.h" #include "kanu.h"
void matrix_init_kb(void) {
matrix_init_user();
led_init_ports();
};
void led_init_ports(void) { void led_init_ports(void) {
setPinOutput(B2); setPinOutput(B2);
setPinOutput(D0); setPinOutput(D0);

View File

@ -1,18 +1 @@
#include "tokyo60.h" #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 */
}

View File

@ -10,6 +10,10 @@
#define MATRIX_ROWS 8 #define MATRIX_ROWS 8
#define MATRIX_COLS 14 #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 RGBLED_NUM 8
#define RGBLIGHT_ANIMATIONS #define RGBLIGHT_ANIMATIONS
#define RGBLIGHT_SLEEP #define RGBLIGHT_SLEEP

View File

@ -1,25 +1 @@
#include "split75.h" #include "split75.h"
#include "i2c_master.h"
void keyboard_pre_init_kb(void) {
led_init_ports();
keyboard_pre_init_user();
}
void led_init_ports(void) {
setPinOutput(NUMLOCK_LED_PIN);
setPinOutput(CAPSLOCK_LED_PIN);
setPinOutput(SCROLLLOCK_LED_PIN);
}
bool led_update_kb(led_t led_state) {
bool res = led_update_user(led_state);
if(res) {
writePin(NUMLOCK_LED_PIN, led_state.num_lock);
writePin(CAPSLOCK_LED_PIN, led_state.caps_lock);
writePin(SCROLLLOCK_LED_PIN, led_state.scroll_lock);
}
return res;
}

View File

@ -45,7 +45,3 @@
{ K06, K16, K26, K36, K46, KC_NO, KC_NO, KC_NO, K86, K96, KC_NO, K116, K126, K136 }, \ { K06, K16, K26, K36, K46, KC_NO, KC_NO, KC_NO, K86, K96, KC_NO, K116, K126, K136 }, \
{ K07, K17, K27, K37, K47, KC_NO, KC_NO, KC_NO, K87, K97, K107, K117, K127, K137 } \ { K07, K17, K27, K37, K47, KC_NO, KC_NO, KC_NO, K87, K97, K107, K117, K127, K137 } \
} }
#define NUMLOCK_LED_PIN D0
#define CAPSLOCK_LED_PIN D1
#define SCROLLLOCK_LED_PIN D6

View File

@ -23,14 +23,8 @@ void set_led_state(int ledId, bool state)
{ {
} }
void led_init_ports()
{
}
void led_set_layer(int layer) void led_set_layer(int layer)
{ {
led_init_ports();
led_set_layer(0); led_set_layer(0);
/*KNOPS_SIMPLELED_STATES*/ /*KNOPS_SIMPLELED_STATES*/

View File

@ -60,7 +60,7 @@ void set_led_state(int ledId, bool state)
} }
} }
void led_init_ports() void led_init_ports_user()
{ {
// Switch #1 // Switch #1
DDRD |= (1 << 6); DDRD |= (1 << 6);
@ -95,7 +95,7 @@ void led_set_layer(int layer)
void matrix_init_user(void) void matrix_init_user(void)
{ {
led_init_ports(); led_init_ports_user();
led_set_layer(0); led_set_layer(0);

View File

@ -356,10 +356,7 @@ void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3) { layer_st
void matrix_init_quantum() { void matrix_init_quantum() {
magic(); magic();
#if defined(LED_NUM_LOCK_PIN) || defined(LED_CAPS_LOCK_PIN) || defined(LED_SCROLL_LOCK_PIN) || defined(LED_COMPOSE_PIN) || defined(LED_KANA_PIN)
// TODO: remove calls to led_init_ports from keyboards and remove ifdef
led_init_ports(); led_init_ports();
#endif
#ifdef BACKLIGHT_ENABLE #ifdef BACKLIGHT_ENABLE
backlight_init_ports(); backlight_init_ports();
#endif #endif