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/hotdox/matrix.c | |
| 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/hotdox/matrix.c')
| -rw-r--r-- | keyboards/hotdox/matrix.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/keyboards/hotdox/matrix.c b/keyboards/hotdox/matrix.c index 11a1142d4..605be3022 100644 --- a/keyboards/hotdox/matrix.c +++ b/keyboards/hotdox/matrix.c | |||
| @@ -9,9 +9,6 @@ | |||
| 9 | #include "matrix.h" | 9 | #include "matrix.h" |
| 10 | #include "hotdox.h" | 10 | #include "hotdox.h" |
| 11 | #include "left.h" | 11 | #include "left.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 | ||
| @@ -90,13 +81,7 @@ void matrix_init(void) | |||
| 90 | } | 81 | } |
| 91 | } | 82 | } |
| 92 | 83 | ||
| 93 | #ifdef DEBUG_MATRIX_SCAN_RATE | ||
| 94 | matrix_timer = timer_read32(); | ||
| 95 | matrix_scan_count = 0; | ||
| 96 | #endif | ||
| 97 | |||
| 98 | matrix_init_quantum(); | 84 | matrix_init_quantum(); |
| 99 | |||
| 100 | } | 85 | } |
| 101 | 86 | ||
| 102 | void matrix_power_up(void) { | 87 | void matrix_power_up(void) { |
| @@ -107,11 +92,6 @@ void matrix_power_up(void) { | |||
| 107 | for (uint8_t i=0; i < MATRIX_ROWS; i++) { | 92 | for (uint8_t i=0; i < MATRIX_ROWS; i++) { |
| 108 | matrix[i] = 0; | 93 | matrix[i] = 0; |
| 109 | } | 94 | } |
| 110 | |||
| 111 | #ifdef DEBUG_MATRIX_SCAN_RATE | ||
| 112 | matrix_timer = timer_read32(); | ||
| 113 | matrix_scan_count = 0; | ||
| 114 | #endif | ||
| 115 | } | 95 | } |
| 116 | 96 | ||
| 117 | // Returns a matrix_row_t whose bits are set if the corresponding key should be | 97 | // Returns a matrix_row_t whose bits are set if the corresponding key should be |
| @@ -142,20 +122,6 @@ uint8_t matrix_scan(void) | |||
| 142 | { | 122 | { |
| 143 | left_scan(); | 123 | left_scan(); |
| 144 | 124 | ||
| 145 | #ifdef DEBUG_MATRIX_SCAN_RATE | ||
| 146 | matrix_scan_count++; | ||
| 147 | |||
| 148 | uint32_t timer_now = timer_read32(); | ||
| 149 | if (TIMER_DIFF_32(timer_now, matrix_timer)>1000) { | ||
| 150 | print("matrix scan frequency: "); | ||
| 151 | pdec(matrix_scan_count); | ||
| 152 | print("\n"); | ||
| 153 | matrix_print(); | ||
| 154 | |||
| 155 | matrix_timer = timer_now; | ||
| 156 | matrix_scan_count = 0; | ||
| 157 | } | ||
| 158 | #endif | ||
| 159 | for (uint8_t i = 0; i < MATRIX_ROWS; i++) { | 125 | for (uint8_t i = 0; i < MATRIX_ROWS; i++) { |
| 160 | select_row(i); | 126 | select_row(i); |
| 161 | wait_us(30); // without this wait read unstable value. | 127 | wait_us(30); // without this wait read unstable value. |
