* Refactor to use led config * Refactor to use led config * Refactor to use led config * Refactor to use led configpull/10975/head
@ -1,21 +1 @@ | |||
#include "v1.h" | |||
void led_set_kb(uint8_t usb_led) { | |||
#ifndef CONVERT_TO_PROTON_C | |||
/* Map RXLED to USB_LED_NUM_LOCK */ | |||
if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { | |||
setPinOutput(B0); | |||
writePinLow(B0); | |||
} else { | |||
setPinInput(B0); | |||
} | |||
/* Map TXLED to USB_LED_CAPS_LOCK */ | |||
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { | |||
setPinOutput(D5); | |||
writePinLow(D5); | |||
} else { | |||
setPinInput(D5); | |||
} | |||
#endif | |||
} |
@ -1,30 +1 @@ | |||
#include "amjpad.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 | |||
DDRD |= (1<<6); | |||
} | |||
void led_set_kb(uint8_t usb_led) { | |||
if (usb_led & (1<<USB_LED_NUM_LOCK)) { | |||
// Turn numlock on | |||
PORTD &= ~(1<<6); | |||
} else { | |||
// Turn numlock off | |||
PORTD |= (1<<6); | |||
} | |||
} |
@ -1,33 +1 @@ | |||
#include "le.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(); | |||
} | |||
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_user(uint8_t usb_led) { | |||
if (usb_led & (1 << USB_LED_CAPS_LOCK)) { | |||
DDRB |= (1 << 7); | |||
PORTB &= ~(1 << 7); | |||
} else { | |||
DDRB &= ~(1 << 7); | |||
PORTB &= ~(1 << 7); | |||
} | |||
} | |||
@ -1,25 +1 @@ | |||
#include "e7v1.h" | |||
void matrix_init_kb(void) { | |||
setPinOutput(F0); | |||
matrix_init_user(); | |||
} | |||
void matrix_scan_kb(void) { | |||
matrix_scan_user(); | |||
} | |||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) { | |||
return process_record_user(keycode, record); | |||
} | |||
void led_set_kb(uint8_t usb_led) { | |||
if (usb_led & (1 << USB_LED_CAPS_LOCK)) { | |||
writePinHigh(F0); | |||
} else { | |||
writePinLow(F0); | |||
} | |||
led_set_user(usb_led); | |||
} | |||
@ -1,36 +1 @@ | |||
#include "v32u4.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(); | |||
} | |||
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 (usb_led & (1<<USB_LED_CAPS_LOCK)) { | |||
// output low | |||
DDRB |= (1<<2); | |||
PORTB &= ~(1<<2); | |||
} else { | |||
// Hi-Z | |||
DDRB &= ~(1<<2); | |||
PORTB &= ~(1<<2); | |||
} | |||
led_set_user(usb_led); | |||
} |
@ -1,23 +1 @@ | |||
#include "melody96.h" | |||
void led_set_kb(uint8_t usb_led) { | |||
if (usb_led & (1 << USB_LED_NUM_LOCK)) { | |||
DDRC |= (1 << 6); PORTC &= ~(1 << 6); | |||
} else { | |||
DDRC &= ~(1 << 6); PORTC &= ~(1 << 6); | |||
} | |||
if (usb_led & (1 << USB_LED_CAPS_LOCK)) { | |||
DDRC |= (1 << 7); PORTC &= ~(1 << 7); | |||
} else { | |||
DDRC &= ~(1 << 7); PORTC &= ~(1 << 7); | |||
} | |||
if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { | |||
DDRB |= (1 << 5); PORTB &= ~(1 << 5); | |||
} else { | |||
DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); | |||
} | |||
led_set_user(usb_led); | |||
} |
@ -1,43 +1 @@ | |||
#include "ixora.h" | |||
void matrix_init_kb(void) { | |||
// put your keyboard start-up code here | |||
// runs once when the firmware starts up | |||
setPinOutput(A8); | |||
setPinOutput(A9); | |||
setPinOutput(A10); | |||
writePinLow(A8); | |||
writePinLow(A9); | |||
writePinLow(A10); | |||
matrix_init_user(); | |||
} | |||
void matrix_scan_kb(void) { | |||
matrix_scan_user(); | |||
} | |||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) { | |||
return process_record_user(keycode, record); | |||
} | |||
void led_set_kb(uint8_t usb_led) { | |||
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { | |||
writePinHigh(A10); | |||
} else { | |||
writePinLow(A10); | |||
} | |||
if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { | |||
writePinHigh(A9); | |||
} else { | |||
writePinLow(A9); | |||
} | |||
if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { | |||
writePinHigh(A8); | |||
} else { | |||
writePinLow(A8); | |||
} | |||
led_set_user(usb_led); | |||
} |