aboutsummaryrefslogtreecommitdiff
path: root/quantum
diff options
context:
space:
mode:
Diffstat (limited to 'quantum')
-rw-r--r--quantum/debounce/debounce_eager_pk.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/quantum/debounce/debounce_eager_pk.c b/quantum/debounce/debounce_eager_pk.c
index f1457496e..af11362ef 100644
--- a/quantum/debounce/debounce_eager_pk.c
+++ b/quantum/debounce/debounce_eager_pk.c
@@ -21,6 +21,7 @@ No further inputs are accepted until DEBOUNCE milliseconds have occurred.
21#include "debounce.h" 21#include "debounce.h"
22#include "matrix.h" 22#include "matrix.h"
23#include "timer.h" 23#include "timer.h"
24#include <stdlib.h>
24 25
25#ifndef DEBOUNCE 26#ifndef DEBOUNCE
26 #define DEBOUNCE 5 27 #define DEBOUNCE 5
@@ -39,7 +40,7 @@ No further inputs are accepted until DEBOUNCE milliseconds have occurred.
39 40
40#define debounce_counter_t uint8_t 41#define debounce_counter_t uint8_t
41 42
42static debounce_counter_t debounce_counters[MATRIX_ROWS*MATRIX_COLS]; 43static debounce_counter_t *debounce_counters;
43 44
44#define DEBOUNCE_ELAPSED 251 45#define DEBOUNCE_ELAPSED 251
45#define MAX_DEBOUNCE (DEBOUNCE_ELAPSED - 1) 46#define MAX_DEBOUNCE (DEBOUNCE_ELAPSED - 1)
@@ -47,10 +48,12 @@ static debounce_counter_t debounce_counters[MATRIX_ROWS*MATRIX_COLS];
47void update_debounce_counters(uint8_t num_rows, uint8_t current_time); 48void update_debounce_counters(uint8_t num_rows, uint8_t current_time);
48void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, uint8_t current_time); 49void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, uint8_t current_time);
49 50
51//we use num_rows rather than MATRIX_ROWS to support split keyboards
50void debounce_init(uint8_t num_rows) 52void debounce_init(uint8_t num_rows)
51{ 53{
54 debounce_counters = (debounce_counter_t*)malloc(num_rows*MATRIX_COLS * sizeof(debounce_counter_t));
52 int i = 0; 55 int i = 0;
53 for (uint8_t r = 0; r < MATRIX_ROWS; r++) 56 for (uint8_t r = 0; r < num_rows; r++)
54 { 57 {
55 for (uint8_t c = 0; c < MATRIX_COLS; c++) 58 for (uint8_t c = 0; c < MATRIX_COLS; c++)
56 { 59 {