summaryrefslogtreecommitdiffstats
path: root/keyboards/massdrop/alt/matrix.c
diff options
context:
space:
mode:
authorAlex Ong <the.onga@gmail.com>2019-01-26 02:13:19 +0100
committerAlex Ong <the.onga@gmail.com>2019-01-26 02:13:19 +0100
commitc9ba618654417ec115809a031d315f8327c79ad4 (patch)
treecd5b907af5bebde7062897ff847e473232ed1214 /keyboards/massdrop/alt/matrix.c
parent2bb2977c133646c4e056960e72029270d77cc1eb (diff)
parentd977daa8dc9136746425f9e1414e1f93cb161877 (diff)
downloadqmk_firmware-c9ba618654417ec115809a031d315f8327c79ad4.tar.gz
qmk_firmware-c9ba618654417ec115809a031d315f8327c79ad4.tar.xz
DO NOT USE Merge branch 'master' into debounce_refactor
Merged, however now there are two debounce.h and debounce.c to mess around with and coalesce. # Conflicts: # quantum/matrix.c
Diffstat (limited to 'keyboards/massdrop/alt/matrix.c')
-rw-r--r--keyboards/massdrop/alt/matrix.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/keyboards/massdrop/alt/matrix.c b/keyboards/massdrop/alt/matrix.c
index 892d38791..472479d30 100644
--- a/keyboards/massdrop/alt/matrix.c
+++ b/keyboards/massdrop/alt/matrix.c
@@ -79,8 +79,6 @@ void matrix_init(void)
matrix_init_quantum();
}
-#define MATRIX_SCAN_DELAY 10 //Delay after setting a col to output (in us)
-
uint64_t mdebouncing = 0;
uint8_t matrix_scan(void)
{
@@ -89,9 +87,7 @@ uint8_t matrix_scan(void)
uint8_t col;
uint32_t scans[2]; //PA PB
- if (CLK_get_ms() < mdebouncing) return 1; //mdebouncing == 0 when no debouncing active
-
- //DBG_1_OFF; //Profiling scans
+ if (timer_read64() < mdebouncing) return 1; //mdebouncing == 0 when no debouncing active
memset(mlatest, 0, MATRIX_ROWS * sizeof(matrix_row_t)); //Zero the result buffer
@@ -99,7 +95,7 @@ uint8_t matrix_scan(void)
{
PORT->Group[col_ports[col]].OUTSET.reg = 1 << col_pins[col]; //Set col output
- CLK_delay_us(MATRIX_SCAN_DELAY); //Delay for output
+ wait_us(1); //Delay for output
scans[PA] = PORT->Group[PA].IN.reg & row_masks[PA]; //Read PA row pins data
scans[PB] = PORT->Group[PB].IN.reg & row_masks[PB]; //Read PB row pins data
@@ -132,11 +128,9 @@ uint8_t matrix_scan(void)
else
{
//Begin or extend debounce on change
- mdebouncing = CLK_get_ms() + DEBOUNCING_DELAY;
+ mdebouncing = timer_read64() + DEBOUNCING_DELAY;
}
- //DBG_1_ON; //Profiling scans
-
matrix_scan_quantum();
return 1;