//#define NO_ACTION_ONESHOT
//#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION
+//#define DEBUG_MATRIX_FREQ
#endif
#include "matrix.h"
#include "ergodox.h"
#include "i2cmaster.h"
+#ifdef DEBUG_MATRIX_FREQ
+#include "timer.h"
+#endif
#ifndef DEBOUNCE
# define DEBOUNCE 5
static void unselect_rows(uint8_t mcp23018_status);
static void select_row(uint8_t mcp23018_status, uint8_t row);
+#ifdef DEBUG_MATRIX_FREQ
+uint32_t matrix_timer;
+uint32_t matrix_scan_count;
+#endif
inline
uint8_t matrix_rows(void)
matrix[i] = 0;
matrix_debouncing[i] = 0;
}
+
+#ifdef DEBUG_MATRIX_FREQ
+ matrix_timer = timer_read32();
+ matrix_scan_count = 0;
+#endif
}
uint8_t matrix_scan(void)
{
+#ifdef DEBUG_MATRIX_FREQ
+ matrix_scan_count++;
+
+ uint32_t timer_now = timer_read32();
+ if (TIMER_DIFF_32(timer_now, matrix_timer)>1000) {
+ print("matrix scan frequency: ");
+ pdec(matrix_scan_count);
+ print("\n");
+
+ matrix_timer = timer_now;
+ matrix_scan_count = 0;
+ }
+#endif
+
#ifdef KEYMAP_CUB
uint8_t layer = biton32(layer_state);