diff options
| author | Joel Challis <git@zvecr.com> | 2019-10-15 13:32:52 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-15 13:32:52 +0100 |
| commit | cc5edb9eeb2d30400dee278a6f20991389f68afe (patch) | |
| tree | 4fb8bdd3ec143345a787474f46add0f53ce782f7 /keyboards/ergodone | |
| parent | e1de0d74a6f6c4bdc762b32fb78e449aed0fcecb (diff) | |
| download | qmk_firmware-cc5edb9eeb2d30400dee278a6f20991389f68afe.tar.gz qmk_firmware-cc5edb9eeb2d30400dee278a6f20991389f68afe.zip | |
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/ergodone')
| -rw-r--r-- | keyboards/ergodone/matrix.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/keyboards/ergodone/matrix.c b/keyboards/ergodone/matrix.c index 4a8230aa8..456f73c95 100644 --- a/keyboards/ergodone/matrix.c +++ b/keyboards/ergodone/matrix.c | |||
| @@ -9,9 +9,6 @@ | |||
| 9 | #include "matrix.h" | 9 | #include "matrix.h" |
| 10 | #include "ergodone.h" | 10 | #include "ergodone.h" |
| 11 | #include "expander.h" | 11 | #include "expander.h" |
| 12 | #ifdef DEBUG_MATRIX_SCAN_RATE | ||
| 13 | #include "timer.h" | ||
| 14 | #endif | ||
| 15 | 12 | ||
| 16 | /* | 13 | /* |
| 17 | * This constant define not debouncing time in msecs, but amount of matrix | 14 | * This constant define not debouncing time in msecs, but amount of matrix |
| @@ -41,12 +38,6 @@ static void init_cols(void); | |||
| 41 | static void unselect_rows(void); | 38 | static void unselect_rows(void); |
| 42 | static void select_row(uint8_t row); | 39 | static void select_row(uint8_t row); |
| 43 | 40 | ||
| 44 | #ifdef DEBUG_MATRIX_SCAN_RATE | ||
| 45 | uint32_t matrix_timer; | ||
| 46 | uint32_t matrix_scan_count; | ||
| 47 | #endif | ||
| 48 | |||
| 49 | |||
| 50 | __attribute__ ((weak)) | 41 | __attribute__ ((weak)) |
| 51 | void matrix_init_user(void) {} | 42 | void matrix_init_user(void) {} |
| 52 | 43 | ||
| @@ -88,13 +79,7 @@ void matrix_init(void) | |||
| 88 | } | 79 | } |
| 89 | } | 80 | } |
| 90 | 81 | ||
| 91 | #ifdef DEBUG_MATRIX_SCAN_RATE | ||
| 92 | matrix_timer = timer_read32(); | ||
| 93 | matrix_scan_count = 0; | ||
| 94 | #endif | ||
| 95 | |||
| 96 | matrix_init_quantum(); | 82 | matrix_init_quantum(); |
| 97 | |||
| 98 | } | 83 | } |
| 99 | 84 | ||
| 100 | void matrix_power_up(void) { | 85 | void matrix_power_up(void) { |
| @@ -105,11 +90,6 @@ void matrix_power_up(void) { | |||
| 105 | for (uint8_t i=0; i < MATRIX_ROWS; i++) { | 90 | for (uint8_t i=0; i < MATRIX_ROWS; i++) { |
| 106 | matrix[i] = 0; | 91 | matrix[i] = 0; |
| 107 | } | 92 | } |
| 108 | |||
| 109 | #ifdef DEBUG_MATRIX_SCAN_RATE | ||
| 110 | matrix_timer = timer_read32(); | ||
| 111 | matrix_scan_count = 0; | ||
| 112 | #endif | ||
| 113 | } | 93 | } |
| 114 | 94 | ||
| 115 | // Returns a matrix_row_t whose bits are set if the corresponding key should be | 95 | // Returns a matrix_row_t whose bits are set if the corresponding key should be |
| @@ -140,21 +120,6 @@ uint8_t matrix_scan(void) | |||
| 140 | { | 120 | { |
| 141 | expander_scan(); | 121 | expander_scan(); |
| 142 | 122 | ||
| 143 | #ifdef DEBUG_MATRIX_SCAN_RATE | ||
| 144 | matrix_scan_count++; | ||
| 145 | |||
| 146 | uint32_t timer_now = timer_read32(); | ||
| 147 | if (TIMER_DIFF_32(timer_now, matrix_timer)>1000) { | ||
| 148 | print("matrix scan frequency: "); | ||
| 149 | pdec(matrix_scan_count); | ||
| 150 | print("\n"); | ||
| 151 | matrix_print(); | ||
| 152 | |||
| 153 | matrix_timer = timer_now; | ||
| 154 | matrix_scan_count = 0; | ||
| 155 | } | ||
| 156 | #endif | ||
| 157 | |||
| 158 | for (uint8_t i = 0; i < MATRIX_ROWS; i++) { | 123 | for (uint8_t i = 0; i < MATRIX_ROWS; i++) { |
| 159 | select_row(i); | 124 | select_row(i); |
| 160 | wait_us(30); // without this wait read unstable value. | 125 | wait_us(30); // without this wait read unstable value. |
