cluepad.c 778 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include "cluepad.h"
  2. __attribute__ ((weak))
  3. void matrix_init_user(void) {
  4. // leave these blank
  5. };
  6. __attribute__ ((weak))
  7. void matrix_scan_user(void) {
  8. // leave these blank
  9. };
  10. void matrix_init_kb(void) {
  11. // put your keyboard start-up code here
  12. // runs once when the firmware starts up
  13. if (matrix_init_user) {
  14. (*matrix_init_user)();
  15. }
  16. #ifdef BACKLIGHT_ENABLE
  17. init_backlight_pin();
  18. #endif
  19. #ifdef RGBLIGHT_ENABLE
  20. rgblight_init();
  21. #endif
  22. // JTAG disable for PORT F. write JTD bit twice within four cycles.
  23. MCUCR |= (1<<JTD);
  24. MCUCR |= (1<<JTD);
  25. };
  26. void matrix_scan_kb(void) {
  27. // put your looping keyboard code here
  28. // runs every cycle (a lot)
  29. if (matrix_scan_user) {
  30. (*matrix_scan_user)();
  31. }
  32. };