]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboards/atom47/rev2/keymaps/LEdiodes/atom47.c
7b839e7967553f1da79b0694fe0b45456d144d80
[qmk_firmware.git] / keyboards / atom47 / rev2 / keymaps / LEdiodes / atom47.c
1 #include "atom47.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         matrix_init_user();
8         led_init_ports();
9 };
10
11 void matrix_scan_kb(void) {
12         // put your looping keyboard code here
13         // runs every cycle (a lot)
14         matrix_scan_user();
15 };
16
17 void led_init_ports(void) {
18     // * Set our LED pins as output
19     DDRB &= ~(1<<5);
20 }
21
22 void led_set_kb(uint8_t usb_led) {
23         if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
24         // Turn capslock on
25         PORTF |= (1<<5);
26     } else {
27         // Turn capslock off
28         PORTF &= ~(1<<5);
29     }
30         led_set_user(usb_led);
31 }