]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboards/omnikeyish/omnikeyish.c
[Keyboard] Add new keyboard: Omnikeyish - A replacement PCB for the Northgate Omnikey...
[qmk_firmware.git] / keyboards / omnikeyish / omnikeyish.c
1 #include "omnikeyish.h"
2
3 void keyboard_pre_init_user(void) {
4   /* Configure LED driving pins as output pins */
5   setPinOutput(NUMLOCKLEDPIN);
6   setPinOutput(CAPSLOCKLEDPIN);
7   setPinOutput(SCROLLLOCKLEDPIN);
8
9   dynamic_macro_init();
10 }
11
12 void keyboard_post_init_user(void) {
13   /* Customise these values to desired behaviour */
14   //debug_enable = true;
15   //debug_matrix=true;
16   //debug_keyboard=true;
17   //debug_mouse=true;
18
19 #ifdef DYNAMIC_MACRO_EEPROM_STORAGE
20   /* Restore macros from eeprom */
21   dynamic_macro_load_eeprom_all();
22 #endif
23
24   /* Send numlock keycode to attempt to force numlock back on. */
25   register_code(KC_NUMLOCK);
26   unregister_code(KC_NUMLOCK);
27 }
28
29 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
30   if (!process_record_dynamic_macro(keycode, record)) {
31     return false;
32   }
33
34   return true;
35 }
36
37 void led_set_user(uint8_t usb_led) {
38   if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) {
39     writePinHigh(NUMLOCKLEDPIN);
40   } else {
41     writePinLow(NUMLOCKLEDPIN);
42   }
43
44   if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
45     writePinHigh(CAPSLOCKLEDPIN);
46   } else {
47     writePinLow(CAPSLOCKLEDPIN);
48   }
49
50   if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) {
51     writePinHigh(SCROLLLOCKLEDPIN);
52   } else {
53     writePinLow(SCROLLLOCKLEDPIN);
54   }
55 }