diff options
Diffstat (limited to 'keyboards/cospad/cospad.c')
-rw-r--r-- | keyboards/cospad/cospad.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/keyboards/cospad/cospad.c b/keyboards/cospad/cospad.c new file mode 100644 index 000000000..48d752a84 --- /dev/null +++ b/keyboards/cospad/cospad.c | |||
@@ -0,0 +1,37 @@ | |||
1 | #include "cospad.h" | ||
2 | #include "led.h" | ||
3 | |||
4 | extern inline void cospad_bl_led_on(void); | ||
5 | extern inline void cospad_bl_led_off(void); | ||
6 | extern inline void cospad_bl_led_togg(void); | ||
7 | |||
8 | void matrix_init_kb(void) { | ||
9 | // put your keyboard start-up code here | ||
10 | // runs once when the firmware starts up | ||
11 | matrix_init_user(); | ||
12 | led_init_ports(); | ||
13 | }; | ||
14 | |||
15 | void matrix_scan_kb(void) { | ||
16 | // put your looping keyboard code here | ||
17 | // runs every cycle (a lot) | ||
18 | matrix_scan_user(); | ||
19 | }; | ||
20 | |||
21 | void led_init_ports(void) { | ||
22 | // * Set our LED pins as output | ||
23 | DDRB |= (1<<2); | ||
24 | DDRF |= (1<<7); | ||
25 | // * Setting BL LEDs to init as off | ||
26 | PORTF |= (1<<7); | ||
27 | } | ||
28 | |||
29 | void led_set_kb(uint8_t usb_led) { | ||
30 | if (usb_led & (1<<USB_LED_NUM_LOCK)) { | ||
31 | // Turn numlock on | ||
32 | PORTB &= ~(1<<2); | ||
33 | } else { | ||
34 | // Turn numlock off | ||
35 | PORTB |= (1<<2); | ||
36 | } | ||
37 | } | ||