summaryrefslogtreecommitdiff
path: root/quantum/debounce/none.c
diff options
context:
space:
mode:
authorStefan Kerkmann <karlk90@pm.me>2022-07-07 10:00:40 +0200
committerGitHub <noreply@github.com>2022-07-07 10:00:40 +0200
commit8224f62806b66f0825b68fd8c00436ee57a28e9a (patch)
tree33e16a84a05073fd439e6a86f09631132a546794 /quantum/debounce/none.c
parentcca5d3532128a9d1aa2ab39405d935fc132c752d (diff)
Make debounce() signal changes in the cooked matrix as return value (#17554)
Diffstat (limited to 'quantum/debounce/none.c')
-rw-r--r--quantum/debounce/none.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/quantum/debounce/none.c b/quantum/debounce/none.c
index 8a85cc04a8..4cff5e05e2 100644
--- a/quantum/debounce/none.c
+++ b/quantum/debounce/none.c
@@ -17,13 +17,16 @@
#include "matrix.h"
#include "quantum.h"
#include <stdlib.h>
+#include <string.h>
void debounce_init(uint8_t num_rows) {}
-void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) {
- for (int i = 0; i < num_rows; i++) {
- cooked[i] = raw[i];
- }
+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;
+
+ memcpy(cooked, raw, sizeof(matrix_row_t) * num_rows);
+
+ return cooked_changed;
}
void debounce_free(void) {}