2018-05-13 09:30:10 -07:00
|
|
|
#include "pk60.h"
|
2018-05-23 08:27:52 -07:00
|
|
|
#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) {
|
2018-05-24 15:28:54 -07:00
|
|
|
// Set capslock LED pin as pinout
|
2018-05-23 08:27:52 -07:00
|
|
|
DDRF |= (1 << 4);
|
|
|
|
PORTF |= (1 << 4);
|
|
|
|
|
|
|
|
}
|
2018-05-20 10:28:33 -07:00
|
|
|
|
|
|
|
void led_set_kb(uint8_t usb_led) {
|
|
|
|
|
2018-05-23 08:27:52 -07:00
|
|
|
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
|
2018-05-24 15:28:54 -07:00
|
|
|
// Turn capslock on
|
2018-05-23 08:27:52 -07:00
|
|
|
PORTF &= ~(1 << 4);
|
2018-05-24 15:28:54 -07:00
|
|
|
} else {
|
|
|
|
// Turn capslock off
|
|
|
|
PORTF |= (1 << 4);
|
2018-05-23 08:27:52 -07:00
|
|
|
}
|
|
|
|
led_set_user(usb_led);
|
2018-05-20 10:28:33 -07:00
|
|
|
|
|
|
|
}
|