aboutsummaryrefslogtreecommitdiffstats
path: root/quantum/debounce
diff options
context:
space:
mode:
authorフィルターペーパー2025-10-19 04:14:37 +0200
committerGitHub2025-10-19 04:14:37 +0200
commit81df54308687713371ed5fbf4947e38963c7867b (patch)
tree36d0a432adcf7613f8a362f3a534e68b4ddaad19 /quantum/debounce
parent4f21beb7153c2b0a1f4d41de7dad5a2173f896b6 (diff)
Debounce: Deprecate num_rows parameter (#25632)
Diffstat (limited to 'quantum/debounce')
-rw-r--r--quantum/debounce/asym_eager_defer_pk.c4
-rw-r--r--quantum/debounce/none.c6
-rw-r--r--quantum/debounce/sym_defer_g.c6
-rw-r--r--quantum/debounce/sym_defer_pk.c4
-rw-r--r--quantum/debounce/sym_defer_pr.c4
-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.cpp4
8 files changed, 18 insertions, 18 deletions
diff --git a/quantum/debounce/asym_eager_defer_pk.c b/quantum/debounce/asym_eager_defer_pk.c
index a385301c90..edd07eabc0 100644
--- a/quantum/debounce/asym_eager_defer_pk.c
+++ b/quantum/debounce/asym_eager_defer_pk.c
@@ -38,9 +38,9 @@ static bool cooked_changed;
static inline void update_debounce_counters_and_transfer_if_expired(matrix_row_t raw[], matrix_row_t cooked[], uint8_t elapsed_time);
static inline void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[]);
-void debounce_init(uint8_t num_rows) {}
+void debounce_init(void) {}
-bool debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) {
+bool debounce(matrix_row_t raw[], matrix_row_t cooked[], bool changed) {
static fast_timer_t last_time;
bool updated_last = false;
cooked_changed = false;
diff --git a/quantum/debounce/none.c b/quantum/debounce/none.c
index 0111dd6e31..e614f41a6b 100644
--- a/quantum/debounce/none.c
+++ b/quantum/debounce/none.c
@@ -17,13 +17,13 @@
#include "debounce.h"
#include <string.h>
-void debounce_init(uint8_t num_rows) {}
+void debounce_init(void) {}
-bool debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) {
+bool debounce(matrix_row_t raw[], matrix_row_t cooked[], bool changed) {
bool cooked_changed = false;
if (changed) {
- size_t matrix_size = num_rows * sizeof(matrix_row_t);
+ size_t matrix_size = MATRIX_ROWS_PER_HAND * sizeof(matrix_row_t);
if (memcmp(cooked, raw, matrix_size) != 0) {
memcpy(cooked, raw, matrix_size);
cooked_changed = true;
diff --git a/quantum/debounce/sym_defer_g.c b/quantum/debounce/sym_defer_g.c
index 81f351c126..a60a131072 100644
--- a/quantum/debounce/sym_defer_g.c
+++ b/quantum/debounce/sym_defer_g.c
@@ -20,9 +20,9 @@
#if DEBOUNCE > 0
-void debounce_init(uint8_t num_rows) {}
+void debounce_init(void) {}
-bool debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) {
+bool debounce(matrix_row_t raw[], matrix_row_t cooked[], bool changed) {
static fast_timer_t debouncing_time;
static bool debouncing = false;
bool cooked_changed = false;
@@ -31,7 +31,7 @@ bool debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool
debouncing = true;
debouncing_time = timer_read_fast();
} else if (debouncing && timer_elapsed_fast(debouncing_time) >= DEBOUNCE) {
- size_t matrix_size = num_rows * sizeof(matrix_row_t);
+ size_t matrix_size = MATRIX_ROWS_PER_HAND * sizeof(matrix_row_t);
if (memcmp(cooked, raw, matrix_size) != 0) {
memcpy(cooked, raw, matrix_size);
cooked_changed = true;
diff --git a/quantum/debounce/sym_defer_pk.c b/quantum/debounce/sym_defer_pk.c
index 063094efe5..b910571219 100644
--- a/quantum/debounce/sym_defer_pk.c
+++ b/quantum/debounce/sym_defer_pk.c
@@ -32,9 +32,9 @@ static bool cooked_changed;
static inline void update_debounce_counters_and_transfer_if_expired(matrix_row_t raw[], matrix_row_t cooked[], uint8_t elapsed_time);
static inline void start_debounce_counters(matrix_row_t raw[], matrix_row_t cooked[]);
-void debounce_init(uint8_t num_rows) {}
+void debounce_init(void) {}
-bool debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) {
+bool debounce(matrix_row_t raw[], matrix_row_t cooked[], bool changed) {
static fast_timer_t last_time;
bool updated_last = false;
cooked_changed = false;
diff --git a/quantum/debounce/sym_defer_pr.c b/quantum/debounce/sym_defer_pr.c
index 2382fae898..feaf55b08a 100644
--- a/quantum/debounce/sym_defer_pr.c
+++ b/quantum/debounce/sym_defer_pr.c
@@ -33,9 +33,9 @@ static bool cooked_changed;
static inline void update_debounce_counters_and_transfer_if_expired(matrix_row_t raw[], matrix_row_t cooked[], uint8_t elapsed_time);
static inline void start_debounce_counters(matrix_row_t raw[], matrix_row_t cooked[]);
-void debounce_init(uint8_t num_rows) {}
+void debounce_init(void) {}
-bool debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) {
+bool debounce(matrix_row_t raw[], matrix_row_t cooked[], bool changed) {
static fast_timer_t last_time;
bool updated_last = false;
cooked_changed = false;
diff --git a/quantum/debounce/sym_eager_pk.c b/quantum/debounce/sym_eager_pk.c
index c3a7afde24..1f53330e9c 100644
--- a/quantum/debounce/sym_eager_pk.c
+++ b/quantum/debounce/sym_eager_pk.c
@@ -46,9 +46,9 @@ static bool cooked_changed;
static inline void update_debounce_counters(uint8_t elapsed_time);
static inline void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[]);
-void debounce_init(uint8_t num_rows) {}
+void debounce_init(void) {}
-bool debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) {
+bool debounce(matrix_row_t raw[], matrix_row_t cooked[], bool changed) {
static fast_timer_t last_time;
bool updated_last = false;
cooked_changed = false;
diff --git a/quantum/debounce/sym_eager_pr.c b/quantum/debounce/sym_eager_pr.c
index 5a1e3a1bda..c929ff53dc 100644
--- a/quantum/debounce/sym_eager_pr.c
+++ b/quantum/debounce/sym_eager_pr.c
@@ -33,9 +33,9 @@ static bool cooked_changed;
static inline void update_debounce_counters(uint8_t elapsed_time);
static inline void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[]);
-void debounce_init(uint8_t num_rows) {}
+void debounce_init(void) {}
-bool debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) {
+bool debounce(matrix_row_t raw[], matrix_row_t cooked[], bool changed) {
static fast_timer_t last_time;
bool updated_last = false;
cooked_changed = false;
diff --git a/quantum/debounce/tests/debounce_test_common.cpp b/quantum/debounce/tests/debounce_test_common.cpp
index 3782f51411..84b91f85e1 100644
--- a/quantum/debounce/tests/debounce_test_common.cpp
+++ b/quantum/debounce/tests/debounce_test_common.cpp
@@ -60,7 +60,7 @@ void DebounceTest::runEventsInternal() {
bool first = true;
/* Initialise keyboard with start time (offset to avoid testing at 0) and all keys UP */
- debounce_init(MATRIX_ROWS);
+ debounce_init();
set_time(time_offset_);
simulate_async_tick(async_time_jumps_);
std::fill(std::begin(input_matrix_), std::end(input_matrix_), 0);
@@ -129,7 +129,7 @@ void DebounceTest::runDebounce(bool changed) {
reset_access_counter();
- bool cooked_changed = debounce(raw_matrix_, cooked_matrix_, MATRIX_ROWS, changed);
+ bool cooked_changed = debounce(raw_matrix_, cooked_matrix_, changed);
if (!std::equal(std::begin(input_matrix_), std::end(input_matrix_), std::begin(raw_matrix_))) {
FAIL() << "Fatal error: debounce() modified raw matrix at " << strTime() << "\ninput_matrix: changed=" << changed << "\n" << strMatrix(input_matrix_) << "\nraw_matrix:\n" << strMatrix(raw_matrix_);