]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboards/dz60/dz60.c
[Keyboard] Add QMK configurator JSON for Alice PCB (#6397)
[qmk_firmware.git] / keyboards / dz60 / dz60.c
1 #include "dz60.h"
2 #include "led.h"
3
4 void matrix_init_kb(void) {
5   // Keyboard start-up code goes 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   // Looping keyboard code goes here
13   // This runs every cycle (a lot)
14   matrix_scan_user();
15 };
16
17 void led_init_ports(void) {
18   // Set caps lock LED pin as output
19   DDRB |= (1 << 2);
20   // Default to off
21   PORTB |= (1 << 2);
22 }
23
24 void led_set_kb(uint8_t usb_led) {
25     if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
26         PORTB &= ~(1 << 2);
27     } else {
28         PORTB |= (1 << 2);
29     }
30
31     led_set_user(usb_led);
32 }