* Refactor to use led config * Refactor to use led config * Refactor to use led config * Refactor to use led config * Refactor to use led configpull/10964/head
@ -1,30 +1 @@ | |||
#include "amj60.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); | |||
} | |||
} |
@ -1,21 +1 @@ | |||
#include "dz60.h" | |||
void matrix_init_kb(void) { | |||
matrix_init_user(); | |||
led_init_ports(); | |||
}; | |||
void led_init_ports(void) { | |||
setPinOutput(B2); | |||
writePinHigh(B2); | |||
} | |||
void led_set_kb(uint8_t usb_led) { | |||
if (usb_led & (1 << USB_LED_CAPS_LOCK)) { | |||
writePinLow(B2); | |||
} else { | |||
writePinHigh(B2); | |||
} | |||
led_set_user(usb_led); | |||
} |
@ -1,26 +1 @@ | |||
#include "jd40.h" | |||
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)) { | |||
// gh60_caps_led_on(); | |||
// } else { | |||
// gh60_caps_led_off(); | |||
// } | |||
// if (usb_led & (1<<USB_LED_NUM_LOCK)) { | |||
// gh60_esc_led_on(); | |||
// } else { | |||
// gh60_esc_led_off(); | |||
// } | |||
// if (usb_led & (1<<USB_LED_SCROLL_LOCK)) { | |||
// gh60_fn_led_on(); | |||
// } else { | |||
// gh60_fn_led_off(); | |||
// } | |||
led_set_user(usb_led); | |||
} |
@ -1,65 +1 @@ | |||
#include "mt980.h" | |||
__attribute__ ((weak)) | |||
void matrix_init_keymap(void) {} | |||
__attribute__ ((weak)) | |||
void matrix_scan_keymap(void) {} | |||
__attribute__ ((weak)) | |||
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | |||
return true; | |||
} | |||
__attribute__ ((weak)) | |||
uint32_t layer_state_set_keymap (uint32_t state) { | |||
return state; | |||
} | |||
__attribute__ ((weak)) | |||
void led_set_keymap(uint8_t usb_led) {} | |||
void matrix_init_user(void) { | |||
matrix_init_keymap(); | |||
} | |||
void matrix_scan_user(void) { | |||
matrix_scan_keymap(); | |||
} | |||
void keyboard_pre_init_user(void) { | |||
/* Set NUMLOCK indicator pin as output */ | |||
setPinOutput(C6); | |||
/* Set CAPSLOCK indicator pin as output */ | |||
setPinOutput(C7); | |||
/* Set SCROLLOCK indicator pin as output */ | |||
setPinOutput(B5); | |||
} | |||
bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
return process_record_keymap(keycode, record); | |||
} | |||
void led_set_user(uint8_t usb_led) { | |||
if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { | |||
writePinLow(C6); | |||
} | |||
else { | |||
writePinHigh(C6); | |||
} | |||
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { | |||
writePinLow(C7); | |||
} | |||
else { | |||
writePinHigh(C7); | |||
} | |||
if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { | |||
writePinLow(B5); | |||
} | |||
else { | |||
writePinHigh(B5); | |||
} | |||
led_set_keymap(usb_led); | |||
} |
@ -1,32 +1 @@ | |||
#include "z150_bh.h" | |||
void matrix_init_kb(void) { | |||
setPinOutput(B0); | |||
setPinOutput(E6); | |||
setPinOutput(E7); | |||
matrix_init_user(); | |||
}; | |||
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_NUM_LOCK)) { | |||
writePinHigh(E7); | |||
} else { | |||
writePinLow(E7); | |||
} | |||
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { | |||
writePinHigh(B0); | |||
} else { | |||
writePinLow(B0); | |||
} | |||
if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { | |||
writePinHigh(E6); | |||
} else { | |||
writePinLow(E6); | |||
} | |||
led_set_user(usb_led); | |||
} |