gh60.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #include "gh60.h"
  2. #include "led.h"
  3. __attribute__ ((weak))
  4. void matrix_init_user(void) {
  5. // leave this function blank - it can be defined in a keymap file
  6. };
  7. __attribute__ ((weak))
  8. void matrix_scan_user(void) {
  9. // leave this function blank - it can be defined in a keymap file
  10. }
  11. __attribute__ ((weak))
  12. bool process_action_user(keyrecord_t *record) {
  13. // leave this function blank - it can be defined in a keymap file
  14. return true;
  15. }
  16. __attribute__ ((weak))
  17. void led_set_user(uint8_t usb_led) {
  18. // leave this function blank - it can be defined in a keymap file
  19. }
  20. void matrix_init_kb(void) {
  21. // put your keyboard start-up code here
  22. // runs once when the firmware starts up
  23. matrix_init_user();
  24. }
  25. void matrix_scan_kb(void) {
  26. // put your looping keyboard code here
  27. // runs every cycle (a lot)
  28. matrix_scan_user();
  29. }
  30. bool process_action_kb(keyrecord_t *record) {
  31. // put your per-action keyboard code here
  32. // runs for every action, just before processing by the firmware
  33. return process_action_user(record);
  34. }
  35. void led_set_kb(uint8_t usb_led) {
  36. // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
  37. if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
  38. gh60_caps_led_on();
  39. } else {
  40. gh60_caps_led_off();
  41. }
  42. // if (usb_led & (1<<USB_LED_NUM_LOCK)) {
  43. // gh60_esc_led_on();
  44. // } else {
  45. // gh60_esc_led_off();
  46. // }
  47. // if (usb_led & (1<<USB_LED_SCROLL_LOCK)) {
  48. // gh60_fn_led_on();
  49. // } else {
  50. // gh60_fn_led_off();
  51. // }
  52. led_set_user(usb_led);
  53. }