]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboards/frosty_flake/frosty_flake.c
several improvements for mitosis:datagrok (#1960)
[qmk_firmware.git] / keyboards / frosty_flake / frosty_flake.c
1 #include "frosty_flake.h"
2
3 void matrix_init_kb(void) {
4     // put your keyboard start-up code here
5     // runs once when the firmware starts up
6
7     matrix_init_user();
8 }
9
10 void matrix_scan_kb(void) {
11     // put your looping keyboard code here
12     // runs every cycle (a lot)
13
14     matrix_scan_user();
15 }
16
17 bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
18     // put your per-action keyboard code here
19     // runs for every action, just before processing by the firmware
20
21     return process_record_user(keycode, record);
22 }
23
24 void led_set_kb(uint8_t usb_led) {
25     DDRB |= (1<<7);
26     DDRC |= (1<<5) | (1<<6);
27
28     print_dec(usb_led);
29
30     if (usb_led & (1<<USB_LED_CAPS_LOCK))
31         PORTC &= ~(1<<5);
32     else
33         PORTC |=  (1<<5);
34
35     if (usb_led & (1<<USB_LED_NUM_LOCK))
36         PORTB &= ~(1<<7);
37     else
38         PORTB |=  (1<<7);
39
40     if (usb_led & (1<<USB_LED_SCROLL_LOCK))
41         PORTC &= ~(1<<6);
42     else
43         PORTC |=  (1<<6);
44
45     led_set_user(usb_led);
46 }
47
48 __attribute__ ((weak))
49 void matrix_init_user(void) {
50 }
51
52 __attribute__ ((weak))
53 void matrix_scan_user(void) {
54 }
55
56 __attribute__ ((weak))
57 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
58   return true;
59 }
60
61 __attribute__ ((weak))
62 void led_set_user(uint8_t usb_led) {
63 }