]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboards/vision_division/vision_division.c
Extended the hint of the programmer to link to the relevant README part instead of...
[qmk_firmware.git] / keyboards / vision_division / vision_division.c
1 #include "vision_division.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         // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
26
27   if (usb_led & (1 << USB_LED_CAPS_LOCK))
28   {
29     // HI
30     DDRD  |= (1<<4);
31     PORTD |= (1<<4);
32   }
33   else
34   {
35     // Hi-Z
36     DDRD  &= ~(1<<4);
37     PORTD &= ~(1<<4);
38   }
39
40   if (usb_led & (1 << USB_LED_NUM_LOCK))
41   {
42     // HI
43     DDRD  |= (1<<5);
44     PORTD |= (1<<5);
45   }
46   else
47   {
48     // Hi-Z
49     DDRD  &= ~(1<<5);
50     PORTD &= ~(1<<5);
51   }
52
53   if (usb_led & (1 << USB_LED_SCROLL_LOCK))
54   {
55     // HI
56     DDRD  |= (1<<6);
57     PORTD |= (1<<6);
58   }
59   else
60   {
61     // Hi-Z
62     DDRD  &= ~(1<<6);
63     PORTD &= ~(1<<6);
64   }
65
66         led_set_user(usb_led);
67 }
68