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
This commit is contained in:
@ -16,19 +16,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#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;
|
||||
}
|
||||
|
@ -37,6 +37,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
#define DEBOUNCE 5
|
||||
|
||||
#define LED_CAPS_LOCK_PIN D1
|
||||
|
||||
#define BACKLIGHT_PIN D4
|
||||
#define BACKLIGHT_LEVELS 3
|
||||
|
||||
|
@ -16,19 +16,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#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;
|
||||
}
|
||||
|
@ -37,6 +37,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
#define DEBOUNCE 5
|
||||
|
||||
#define LED_CAPS_LOCK_PIN D1
|
||||
|
||||
#define BACKLIGHT_PIN D4
|
||||
#define BACKLIGHT_LEVELS 3
|
||||
|
||||
|
@ -14,29 +14,3 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#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;
|
||||
}
|
||||
|
@ -42,6 +42,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
/* 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
|
||||
|
@ -32,6 +32,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#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
|
||||
|
@ -16,23 +16,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#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;
|
||||
}
|
||||
|
@ -52,6 +52,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
//#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
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -52,6 +52,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
//#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
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -45,6 +45,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#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
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -37,6 +37,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#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
|
||||
|
||||
|
@ -36,5 +36,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
#define DEBOUNCE 5
|
||||
|
||||
#define LED_CAPS_LOCK_PIN D1
|
||||
|
||||
#define BACKLIGHT_PIN D4
|
||||
#define BACKLIGHT_LEVELS 3
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -14,32 +14,3 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#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;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -14,32 +14,3 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#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;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -14,31 +14,3 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#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;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -14,37 +14,3 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#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;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -14,45 +14,3 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#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;
|
||||
}
|
||||
|
@ -53,6 +53,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
// #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
|
||||
|
@ -14,19 +14,3 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#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;
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user