clueboard2.c 831 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. #ifdef RGBLIGHT_ENABLE
  24. rgblight_init();
  25. #endif
  26. // JTAG disable for PORT F. write JTD bit twice within four cycles.
  27. MCUCR |= (1<<JTD);
  28. MCUCR |= (1<<JTD);
  29. };
  30. void matrix_scan_kb(void) {
  31. // put your looping keyboard code here
  32. // runs every cycle (a lot)
  33. if (matrix_scan_user) {
  34. (*matrix_scan_user)();
  35. }
  36. };