summaryrefslogtreecommitdiff
path: root/quantum/debounce/none.c
diff options
context:
space:
mode:
authorAndre Brait <andrebrait@gmail.com>2023-09-25 04:48:55 +0200
committerGitHub <noreply@github.com>2023-09-25 12:48:55 +1000
commit960d6e0d7d8007ee826184967dc1edc5ab7b2755 (patch)
treee6c429f3086e0c51ad84e25e16c5c5fd1c937425 /quantum/debounce/none.c
parentdd94877ec6d2ee5c4cdb0e71287abd76585b0268 (diff)
[Enhancement] Improvements for debounce test coverage + bug fixes for sym_defer_g and sym_eager_pr (#21667)
Co-authored-by: Nebuleon <2391500+Nebuleon@users.noreply.github.com>
Diffstat (limited to 'quantum/debounce/none.c')
-rw-r--r--quantum/debounce/none.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/quantum/debounce/none.c b/quantum/debounce/none.c
index 1b8b1dc13a..0a8ccfc4ee 100644
--- a/quantum/debounce/none.c
+++ b/quantum/debounce/none.c
@@ -20,9 +20,15 @@
void debounce_init(uint8_t num_rows) {}
bool debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) {
- bool cooked_changed = memcmp(raw, cooked, sizeof(matrix_row_t) * num_rows) != 0;
+ bool cooked_changed = false;
- memcpy(cooked, raw, sizeof(matrix_row_t) * num_rows);
+ if (changed) {
+ size_t matrix_size = num_rows * sizeof(matrix_row_t);
+ if (memcmp(cooked, raw, matrix_size) != 0) {
+ memcpy(cooked, raw, matrix_size);
+ cooked_changed = true;
+ }
+ }
return cooked_changed;
}