You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.1 KiB

  1. #include "xealousbrown.h"
  2. void matrix_init_kb(void) {
  3. // put your keyboard start-up code here
  4. // runs once when the firmware starts up
  5. matrix_init_user();
  6. }
  7. #ifdef BENCHMARK_MATRIX
  8. # include "timer.h"
  9. # include <stdint.h>
  10. # include <stdbool.h>
  11. # include "wait.h"
  12. # include "util.h"
  13. # include "matrix.h"
  14. # include "quantum.h"
  15. static int scans = 0;
  16. static uint16_t last_print_out = 0;
  17. static int last_timer = 0;
  18. void matrix_scan_user(void) {
  19. scans++;
  20. uint16_t timer = timer_read();
  21. if (timer != last_timer && timer != last_timer + 1) {
  22. print("MS:\n");
  23. print_dec(timer);
  24. print("->");
  25. print_dec(last_timer);
  26. print("\n");
  27. }
  28. last_timer = timer;
  29. if ((timer % 1000 == 0) && (timer != last_print_out)) {
  30. print("Benchmark:");
  31. print("\n");
  32. print_dec(timer);
  33. print("\n");
  34. print_dec(scans);
  35. print("\n");
  36. print("-------");
  37. scans = 0;
  38. last_print_out = timer;
  39. }
  40. }
  41. #endif