aboutsummaryrefslogtreecommitdiffstats
path: root/quantum
diff options
context:
space:
mode:
authorフィルターペーパー2025-10-19 04:14:37 +0200
committerGitHub2025-10-19 04:14:37 +0200
commit81df54308687713371ed5fbf4947e38963c7867b (patch)
tree36d0a432adcf7613f8a362f3a534e68b4ddaad19 /quantum
parent4f21beb7153c2b0a1f4d41de7dad5a2173f896b6 (diff)
Debounce: Deprecate num_rows parameter (#25632)
Diffstat (limited to 'quantum')
-rw-r--r--quantum/debounce.h5
-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
-rw-r--r--quantum/matrix.c6
-rw-r--r--quantum/matrix_common.c6
11 files changed, 26 insertions, 27 deletions
diff --git a/quantum/debounce.h b/quantum/debounce.h
index 30d2621d18..e26106cd3b 100644
--- a/quantum/debounce.h
+++ b/quantum/debounce.h
@@ -9,11 +9,10 @@
*
* @param raw The current key state
* @param cooked The debounced key state
- * @param num_rows Number of rows to debounce
* @param changed True if raw has changed since the last call
* @return true Cooked has new keychanges after debouncing
* @return false Cooked is the same as before
*/
-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);
-void debounce_init(uint8_t num_rows);
+void debounce_init(void);
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_);
diff --git a/quantum/matrix.c b/quantum/matrix.c
index 167a70e5b6..2e7ea085f4 100644
--- a/quantum/matrix.c
+++ b/quantum/matrix.c
@@ -303,7 +303,7 @@ void matrix_init(void) {
memset(matrix, 0, sizeof(matrix));
memset(raw_matrix, 0, sizeof(raw_matrix));
- debounce_init(MATRIX_ROWS_PER_HAND);
+ debounce_init();
matrix_init_kb();
}
@@ -336,9 +336,9 @@ uint8_t matrix_scan(void) {
if (changed) memcpy(raw_matrix, curr_matrix, sizeof(curr_matrix));
#ifdef SPLIT_KEYBOARD
- changed = debounce(raw_matrix, matrix + thisHand, MATRIX_ROWS_PER_HAND, changed) | matrix_post_scan();
+ changed = debounce(raw_matrix, matrix + thisHand, changed) | matrix_post_scan();
#else
- changed = debounce(raw_matrix, matrix, MATRIX_ROWS_PER_HAND, changed);
+ changed = debounce(raw_matrix, matrix, changed);
matrix_scan_kb();
#endif
return (uint8_t)changed;
diff --git a/quantum/matrix_common.c b/quantum/matrix_common.c
index b4a86fc483..26589f29a6 100644
--- a/quantum/matrix_common.c
+++ b/quantum/matrix_common.c
@@ -156,7 +156,7 @@ __attribute__((weak)) void matrix_init(void) {
matrix[i] = 0;
}
- debounce_init(MATRIX_ROWS_PER_HAND);
+ debounce_init();
matrix_init_kb();
}
@@ -165,9 +165,9 @@ __attribute__((weak)) uint8_t matrix_scan(void) {
bool changed = matrix_scan_custom(raw_matrix);
#ifdef SPLIT_KEYBOARD
- changed = debounce(raw_matrix, matrix + thisHand, MATRIX_ROWS_PER_HAND, changed) | matrix_post_scan();
+ changed = debounce(raw_matrix, matrix + thisHand, changed) | matrix_post_scan();
#else
- changed = debounce(raw_matrix, matrix, MATRIX_ROWS_PER_HAND, changed);
+ changed = debounce(raw_matrix, matrix, changed);
matrix_scan_kb();
#endif