clueboard2.c 767 B

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