summaryrefslogtreecommitdiff
path: root/quantum/debounce
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/debounce')
-rw-r--r--quantum/debounce/asym_eager_defer_pk.c5
-rw-r--r--quantum/debounce/none.c4
-rw-r--r--quantum/debounce/sym_defer_g.c3
-rw-r--r--quantum/debounce/sym_defer_pk.c3
-rw-r--r--quantum/debounce/sym_defer_pr.c3
-rw-r--r--quantum/debounce/sym_eager_pk.c4
-rw-r--r--quantum/debounce/sym_eager_pr.c4
-rw-r--r--quantum/debounce/tests/debounce_test_common.cpp3
-rw-r--r--quantum/debounce/tests/debounce_test_common.h2
9 files changed, 13 insertions, 18 deletions
diff --git a/quantum/debounce/asym_eager_defer_pk.c b/quantum/debounce/asym_eager_defer_pk.c
index 4745c6f465..954d43536c 100644
--- a/quantum/debounce/asym_eager_defer_pk.c
+++ b/quantum/debounce/asym_eager_defer_pk.c
@@ -22,9 +22,8 @@ Basic symmetric per-key algorithm. Uses an 8-bit counter per key.
When no state changes have occured for DEBOUNCE milliseconds, we push the state.
*/
-#include "matrix.h"
+#include "debounce.h"
#include "timer.h"
-#include "quantum.h"
#include <stdlib.h>
#ifdef PROTOCOL_CHIBIOS
@@ -144,6 +143,8 @@ static void update_debounce_counters_and_transfer_if_expired(matrix_row_t raw[],
static void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows) {
debounce_counter_t *debounce_pointer = debounce_counters;
+ matrix_need_update = false;
+
for (uint8_t row = 0; row < num_rows; row++) {
matrix_row_t delta = raw[row] ^ cooked[row];
for (uint8_t col = 0; col < MATRIX_COLS; col++) {
diff --git a/quantum/debounce/none.c b/quantum/debounce/none.c
index 4cff5e05e2..1b8b1dc13a 100644
--- a/quantum/debounce/none.c
+++ b/quantum/debounce/none.c
@@ -14,9 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "matrix.h"
-#include "quantum.h"
-#include <stdlib.h>
+#include "debounce.h"
#include <string.h>
void debounce_init(uint8_t num_rows) {}
diff --git a/quantum/debounce/sym_defer_g.c b/quantum/debounce/sym_defer_g.c
index d04310a761..25e18890af 100644
--- a/quantum/debounce/sym_defer_g.c
+++ b/quantum/debounce/sym_defer_g.c
@@ -17,9 +17,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
Basic global debounce algorithm. Used in 99% of keyboards at time of implementation
When no state changes have occured for DEBOUNCE milliseconds, we push the state.
*/
-#include "matrix.h"
+#include "debounce.h"
#include "timer.h"
-#include "quantum.h"
#include <string.h>
#ifndef DEBOUNCE
# define DEBOUNCE 5
diff --git a/quantum/debounce/sym_defer_pk.c b/quantum/debounce/sym_defer_pk.c
index 7b59b5e100..156535a373 100644
--- a/quantum/debounce/sym_defer_pk.c
+++ b/quantum/debounce/sym_defer_pk.c
@@ -19,9 +19,8 @@ Basic symmetric per-key algorithm. Uses an 8-bit counter per key.
When no state changes have occured for DEBOUNCE milliseconds, we push the state.
*/
-#include "matrix.h"
+#include "debounce.h"
#include "timer.h"
-#include "quantum.h"
#include <stdlib.h>
#ifdef PROTOCOL_CHIBIOS
diff --git a/quantum/debounce/sym_defer_pr.c b/quantum/debounce/sym_defer_pr.c
index 452c4599d0..d6222af5b2 100644
--- a/quantum/debounce/sym_defer_pr.c
+++ b/quantum/debounce/sym_defer_pr.c
@@ -17,9 +17,8 @@ Symmetric per-row debounce algorithm. Changes only apply when
DEBOUNCE milliseconds have elapsed since the last change.
*/
-#include "matrix.h"
+#include "debounce.h"
#include "timer.h"
-#include "quantum.h"
#include <stdlib.h>
#ifndef DEBOUNCE
diff --git a/quantum/debounce/sym_eager_pk.c b/quantum/debounce/sym_eager_pk.c
index f736d1645c..b359e79287 100644
--- a/quantum/debounce/sym_eager_pk.c
+++ b/quantum/debounce/sym_eager_pk.c
@@ -19,9 +19,8 @@ After pressing a key, it immediately changes state, and sets a counter.
No further inputs are accepted until DEBOUNCE milliseconds have occurred.
*/
-#include "matrix.h"
+#include "debounce.h"
#include "timer.h"
-#include "quantum.h"
#include <stdlib.h>
#ifdef PROTOCOL_CHIBIOS
@@ -125,6 +124,7 @@ static void update_debounce_counters(uint8_t num_rows, uint8_t elapsed_time) {
// upload from raw_matrix to final matrix;
static void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows) {
+ matrix_need_update = false;
debounce_counter_t *debounce_pointer = debounce_counters;
for (uint8_t row = 0; row < num_rows; row++) {
matrix_row_t delta = raw[row] ^ cooked[row];
diff --git a/quantum/debounce/sym_eager_pr.c b/quantum/debounce/sym_eager_pr.c
index aad5ca351b..ccc5d20fa2 100644
--- a/quantum/debounce/sym_eager_pr.c
+++ b/quantum/debounce/sym_eager_pr.c
@@ -19,9 +19,8 @@ After pressing a key, it immediately changes state, and sets a counter.
No further inputs are accepted until DEBOUNCE milliseconds have occurred.
*/
-#include "matrix.h"
+#include "debounce.h"
#include "timer.h"
-#include "quantum.h"
#include <stdlib.h>
#ifdef PROTOCOL_CHIBIOS
@@ -119,6 +118,7 @@ static void update_debounce_counters(uint8_t num_rows, uint8_t elapsed_time) {
// upload from raw_matrix to final matrix;
static void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows) {
+ matrix_need_update = false;
debounce_counter_t *debounce_pointer = debounce_counters;
for (uint8_t row = 0; row < num_rows; row++) {
matrix_row_t existing_row = cooked[row];
diff --git a/quantum/debounce/tests/debounce_test_common.cpp b/quantum/debounce/tests/debounce_test_common.cpp
index bd98e32955..b11378b286 100644
--- a/quantum/debounce/tests/debounce_test_common.cpp
+++ b/quantum/debounce/tests/debounce_test_common.cpp
@@ -23,9 +23,8 @@
#include <sstream>
extern "C" {
-#include "quantum.h"
-#include "timer.h"
#include "debounce.h"
+#include "timer.h"
void set_time(uint32_t t);
void advance_time(uint32_t ms);
diff --git a/quantum/debounce/tests/debounce_test_common.h b/quantum/debounce/tests/debounce_test_common.h
index b7becb3782..7319abfbf3 100644
--- a/quantum/debounce/tests/debounce_test_common.h
+++ b/quantum/debounce/tests/debounce_test_common.h
@@ -21,7 +21,7 @@
#include <string>
extern "C" {
-#include "quantum.h"
+#include "matrix.h"
#include "timer.h"
}