]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboards/handwired/retro_refit/retro_refit.c
Merge branch 'master' into coderkun_neo2
[qmk_firmware.git] / keyboards / handwired / retro_refit / retro_refit.c
1 #include "retro_refit.h"
2 #include "led.h"
3
4 void matrix_init_kb(void) {
5     // put your keyboard start-up code here
6     // runs once when the firmware starts up
7
8     // Disable status LED on KB, enable status LED on Teensy (KB_STATUS = !TEENSY_STATUS)
9     DDRD |= (1<<6);
10     PORTD |= (1<<6);
11
12     matrix_init_user();
13 };
14
15 void led_set_kb(uint8_t usb_led) {
16     // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
17
18     if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
19         // output low
20         DDRD |= (1<<0);
21         PORTD &= ~(1<<0);
22     } else {
23         // Hi-Z
24         DDRD &= ~(1<<0);
25         PORTD &= ~(1<<0);
26     }
27     if (usb_led & (1<<USB_LED_NUM_LOCK)) {
28         // output low
29         DDRD |= (1<<1);
30         PORTD &= ~(1<<1);
31     } else {
32         // Hi-Z
33         DDRD &= ~(1<<1);
34         PORTD &= ~(1<<1);
35     }
36     if (usb_led & (1<<USB_LED_SCROLL_LOCK)) {
37         // output low
38         DDRC |= (1<<6);
39         PORTC &= ~(1<<6);
40     } else {
41         // Hi-Z
42         DDRC &= ~(1<<6);
43         PORTC &= ~(1<<6);
44     }
45
46     led_set_user(usb_led);
47 };