template.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #include "%KEYBOARD%.h"
  2. __attribute__ ((weak))
  3. void matrix_init_user(void) {
  4. // leave this function blank - it can be defined in a keymap file
  5. };
  6. __attribute__ ((weak))
  7. void matrix_scan_user(void) {
  8. // leave this function blank - it can be defined in a keymap file
  9. }
  10. __attribute__ ((weak))
  11. void process_action_user(keyrecord_t *record) {
  12. // leave this function blank - it can be defined in a keymap file
  13. }
  14. __attribute__ ((weak))
  15. void led_set_user(uint8_t usb_led) {
  16. // leave this function blank - it can be defined in a keymap file
  17. }
  18. void matrix_init_kb(void) {
  19. // put your keyboard start-up code here
  20. // runs once when the firmware starts up
  21. matrix_init_user();
  22. }
  23. void matrix_scan_kb(void) {
  24. // put your looping keyboard code here
  25. // runs every cycle (a lot)
  26. matrix_scan_user();
  27. }
  28. void process_action_kb(keyrecord_t *record) {
  29. // put your per-action keyboard code here
  30. // runs for every action, just before processing by the firmware
  31. process_action_user(record);
  32. }
  33. void led_set_kb(uint8_t usb_led) {
  34. // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
  35. led_set_user(usb_led);
  36. }