summaryrefslogtreecommitdiffstats
path: root/quantum
diff options
context:
space:
mode:
authoralex-ong <the.onga@gmail.com>2019-01-26 17:10:27 +1100
committeralex-ong <the.onga@gmail.com>2019-01-26 17:10:27 +1100
commit123608fb318a42500d64d29aa46c7d08140033fd (patch)
tree034040c60d2f5a5b768e4ada990c08aa195951c5 /quantum
parentd0b691df0ee74863ca54ca697aa4d4212cf401a7 (diff)
DO NOT USE Revert back to original API to support split_keyboards.
Diffstat (limited to 'quantum')
-rw-r--r--quantum/debounce.h4
-rw-r--r--quantum/debounce/debounce_sym_g.c8
-rw-r--r--quantum/matrix.c4
3 files changed, 8 insertions, 8 deletions
diff --git a/quantum/debounce.h b/quantum/debounce.h
index 7fe2d693d1..34b952ee72 100644
--- a/quantum/debounce.h
+++ b/quantum/debounce.h
@@ -16,11 +16,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "matrix.h"
-void debounce_init(void); //every debounce algorithm will have unique storage needs.
+void debounce_init(uint8_t num_rows); //every debounce algorithm will have unique storage needs.
// raw is the current key state
// cooked is the debounced input/output key state
// changed is true if raw has changed since the last call
-void debounce(matrix_row_t raw[], matrix_row_t cooked[], bool changed);
+void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed);
bool debounce_active(void);
diff --git a/quantum/debounce/debounce_sym_g.c b/quantum/debounce/debounce_sym_g.c
index c206f28647..4a6996c73d 100644
--- a/quantum/debounce/debounce_sym_g.c
+++ b/quantum/debounce/debounce_sym_g.c
@@ -26,10 +26,10 @@ When no state changes have occured for DEBOUNCE milliseconds, we push the state.
static bool debouncing = false;
static uint16_t debouncing_time;
-void debounce_init(void) {}
+void debounce_init(uint8_t num_rows) {}
#if DEBOUNCE > 0
-void debounce(matrix_row_t raw[], matrix_row_t cooked[], bool changed)
+void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed)
{
if (changed) {
debouncing = true;
@@ -37,14 +37,14 @@ void debounce(matrix_row_t raw[], matrix_row_t cooked[], bool changed)
}
if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) {
- for (int i = 0; i < MATRIX_ROWS; i++) {
+ for (int i = 0; i < num_rows; i++) {
cooked[i] = raw[i];
}
debouncing = false;
}
}
#else //no debouncing.
-void debounce(matrix_row_t raw[], matrix_row_t cooked[], bool changed)
+void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed)
{
for (int i = 0; i < MATRIX_ROWS; i++) {
cooked[i] = raw[i];
diff --git a/quantum/matrix.c b/quantum/matrix.c
index 8fc4175bde..5b7a0e03b1 100644
--- a/quantum/matrix.c
+++ b/quantum/matrix.c
@@ -122,7 +122,7 @@ void matrix_init(void) {
raw_matrix[i] = 0;
matrix[i] = 0;
}
- debounce_init();
+ debounce_init(MATRIX_ROWS);
matrix_init_quantum();
}
@@ -143,7 +143,7 @@ uint8_t matrix_scan(void)
}
#endif
- debounce(raw_matrix, matrix, changed);
+ debounce(raw_matrix, matrix, MATRIX_ROWS, changed);
matrix_scan_quantum();
return 1;