mirror of
https://github.com/Keychron/qmk_firmware.git
synced 2024-12-24 02:05:01 +06:00
Refactor to use led config - Part 5 (#10975)
* Refactor to use led config * Refactor to use led config * Refactor to use led config
This commit is contained in:
parent
4368611bfd
commit
23222625c2
@ -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);
|
||||
}
|
||||
|
@ -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,\
|
||||
|
@ -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
|
||||
|
@ -1,30 +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);
|
||||
}
|
||||
}
|
||||
|
@ -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 */
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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 },
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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 */
|
||||
|
@ -1,47 +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);
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
@ -1,27 +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);
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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 */
|
||||
|
@ -1,24 +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);
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -1,61 +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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
@ -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.
|
||||
*/
|
||||
|
@ -1,12 +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);
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -1,35 +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);
|
||||
|
||||
}
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -1,24 +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);
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -1,31 +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);
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -1,18 +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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -1,18 +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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user