1
0
Fork 0

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
This commit is contained in:
Joel Challis 2019-10-15 13:32:52 +01:00 committed by GitHub
parent e1de0d74a6
commit cc5edb9eeb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 25 additions and 324 deletions

View file

@ -26,9 +26,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "debug.h"
#include "util.h"
#include QMK_KEYBOARD_H
#ifdef DEBUG_MATRIX_SCAN_RATE
#include "timer.h"
#endif
#ifndef DEBOUNCE
# define DEBOUNCE 5
@ -70,12 +67,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) {}
@ -121,10 +112,6 @@ void matrix_init(void)
}
}
#ifdef DEBUG_MATRIX_SCAN_RATE
matrix_timer = timer_read32();
matrix_scan_count = 0;
#endif
matrix_init_quantum();
}
@ -138,12 +125,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
}
// Returns a matrix_row_t whose bits are set if the corresponding key should be
@ -192,18 +173,6 @@ 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
for (uint8_t i = 0; i < MATRIX_ROWS_PER_SIDE; i++) {
select_row(i);
// and select on left hand