You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.0 KiB
47 lines
1.0 KiB
9 years ago
|
#include "retro_refit.h"
|
||
9 years ago
|
#include "led.h"
|
||
9 years ago
|
|
||
9 years ago
|
void matrix_init_kb(void) {
|
||
9 years ago
|
// put your keyboard start-up code here
|
||
|
// runs once when the firmware starts up
|
||
|
|
||
|
// Disable status LED on KB, enable status LED on Teensy (KB_STATUS = !TEENSY_STATUS)
|
||
|
DDRD |= (1<<6);
|
||
|
PORTD |= (1<<6);
|
||
|
|
||
|
matrix_init_user();
|
||
9 years ago
|
};
|
||
|
|
||
9 years ago
|
void led_set_kb(uint8_t usb_led) {
|
||
9 years ago
|
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||
9 years ago
|
|
||
|
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
|
||
|
// output low
|
||
|
DDRD |= (1<<0);
|
||
|
PORTD &= ~(1<<0);
|
||
|
} else {
|
||
|
// Hi-Z
|
||
|
DDRD &= ~(1<<0);
|
||
|
PORTD &= ~(1<<0);
|
||
|
}
|
||
|
if (usb_led & (1<<USB_LED_NUM_LOCK)) {
|
||
|
// output low
|
||
|
DDRD |= (1<<1);
|
||
|
PORTD &= ~(1<<1);
|
||
|
} else {
|
||
|
// Hi-Z
|
||
|
DDRD &= ~(1<<1);
|
||
|
PORTD &= ~(1<<1);
|
||
|
}
|
||
|
if (usb_led & (1<<USB_LED_SCROLL_LOCK)) {
|
||
|
// output low
|
||
|
DDRC |= (1<<6);
|
||
|
PORTC &= ~(1<<6);
|
||
|
} else {
|
||
|
// Hi-Z
|
||
|
DDRC &= ~(1<<6);
|
||
|
PORTC &= ~(1<<6);
|
||
9 years ago
|
}
|
||
|
|
||
|
led_set_user(usb_led);
|
||
9 years ago
|
};
|