You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.2 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. #include "omnikeyish.h"
  2. void keyboard_pre_init_kb(void) {
  3. /* Configure LED driving pins as output pins */
  4. setPinOutput(NUMLOCKLEDPIN);
  5. setPinOutput(CAPSLOCKLEDPIN);
  6. setPinOutput(SCROLLLOCKLEDPIN);
  7. dynamic_macro_init();
  8. }
  9. void keyboard_post_init_kb(void) {
  10. /* Customise these values to desired behaviour */
  11. //debug_enable = true;
  12. //debug_matrix=true;
  13. //debug_keyboard=true;
  14. //debug_mouse=true;
  15. #ifdef DYNAMIC_MACRO_EEPROM_STORAGE
  16. /* Restore macros from eeprom */
  17. dynamic_macro_load_eeprom_all();
  18. #endif
  19. /* Send numlock keycode to attempt to force numlock back on. */
  20. register_code(KC_NUMLOCK);
  21. unregister_code(KC_NUMLOCK);
  22. }
  23. bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
  24. if (!process_record_dynamic_macro(keycode, record)) {
  25. return false;
  26. }
  27. return true;
  28. }
  29. void led_set_kb(uint8_t usb_led) {
  30. if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) {
  31. writePinHigh(NUMLOCKLEDPIN);
  32. } else {
  33. writePinLow(NUMLOCKLEDPIN);
  34. }
  35. if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
  36. writePinHigh(CAPSLOCKLEDPIN);
  37. } else {
  38. writePinLow(CAPSLOCKLEDPIN);
  39. }
  40. if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) {
  41. writePinHigh(SCROLLLOCKLEDPIN);
  42. } else {
  43. writePinLow(SCROLLLOCKLEDPIN);
  44. }
  45. }