gh60.c 1.5 KB

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