diff options
author | Joel Challis <git@zvecr.com> | 2019-10-15 13:32:52 +0100 |
---|---|---|
committer | Drashna Jael're <drashna@live.com> | 2019-12-05 16:03:51 -0800 |
commit | 9148b001ff69d5ab863a7f32bf1e68fab9797938 (patch) | |
tree | b41c126fe3f71280c9a94aed638efca41da8e70e /keyboards/ergodox_ez/matrix.c | |
parent | cb7d24d95d33e2f66656c3eea404eeae9d737a08 (diff) |
Port DEBUG_MATRIX_SCAN_RATE to core (#7029)
* Port DEBUG_MATRIX_SCAN_RATE to core
* Remove duplicate DEBUG_MATRIX_SCAN_RATE implementations
* Remove duplicate DEBUG_MATRIX_SCAN_RATE implementation from handwired/xealous
* Add console logic from ergodox_ez
Diffstat (limited to 'keyboards/ergodox_ez/matrix.c')
-rw-r--r-- | keyboards/ergodox_ez/matrix.c | 39 |
1 files changed, 4 insertions, 35 deletions
diff --git a/keyboards/ergodox_ez/matrix.c b/keyboards/ergodox_ez/matrix.c index 80a2d1d95b..1ab2e5502f 100644 --- a/keyboards/ergodox_ez/matrix.c +++ b/keyboards/ergodox_ez/matrix.c @@ -35,9 +35,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "matrix.h" #include "debounce.h" #include QMK_KEYBOARD_H -#ifdef DEBUG_MATRIX_SCAN_RATE -# include "timer.h" -#endif /* * This constant define not debouncing time in msecs, assuming eager_pr. @@ -67,11 +64,6 @@ static void select_row(uint8_t row); static uint8_t mcp23018_reset_loop; // static uint16_t mcp23018_reset_loop; -#ifdef DEBUG_MATRIX_SCAN_RATE -uint32_t matrix_timer; -uint32_t matrix_scan_count; -#endif - __attribute__((weak)) void matrix_init_user(void) {} __attribute__((weak)) void matrix_scan_user(void) {} @@ -95,13 +87,9 @@ void matrix_init(void) { // initialize matrix state: all keys off for (uint8_t i = 0; i < MATRIX_ROWS; i++) { matrix[i] = 0; - raw_matrix[i] = 0; + raw_matrix[i] = 0; } -#ifdef DEBUG_MATRIX_SCAN_RATE - matrix_timer = timer_read32(); - matrix_scan_count = 0; -#endif debounce_init(MATRIX_ROWS); matrix_init_quantum(); } @@ -116,11 +104,6 @@ void matrix_power_up(void) { for (uint8_t i = 0; i < MATRIX_ROWS; i++) { matrix[i] = 0; } - -#ifdef DEBUG_MATRIX_SCAN_RATE - matrix_timer = timer_read32(); - matrix_scan_count = 0; -#endif } // Reads and stores a row, returning @@ -151,24 +134,10 @@ uint8_t matrix_scan(void) { } } -#ifdef DEBUG_MATRIX_SCAN_RATE - 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 LEFT_LEDS mcp23018_status = ergodox_left_leds_update(); #endif // LEFT_LEDS - bool changed = false; + bool changed = false; for (uint8_t i = 0; i < MATRIX_ROWS_PER_SIDE; i++) { // select rows from left and right hands uint8_t left_index = i; @@ -178,13 +147,13 @@ uint8_t matrix_scan(void) { // we don't need a 30us delay anymore, because selecting a // left-hand row requires more than 30us for i2c. - + changed |= store_raw_matrix_row(left_index); changed |= store_raw_matrix_row(right_index); unselect_rows(); } - + debounce(raw_matrix, matrix, MATRIX_ROWS, changed); matrix_scan_quantum(); |