diff options
author | Nick Brassel <[email protected]> | 2022-08-28 14:23:01 +1000 |
---|---|---|
committer | Nick Brassel <[email protected]> | 2022-08-28 14:23:01 +1000 |
commit | 0a3f7e48690bb2b7b008300a54554979a55be19a (patch) | |
tree | 7499d52f20040ed7d5a56496ecb81ed114f80719 /quantum/debounce/none.c | |
parent | fc0bf67f372c38f72c303cdec21b1d4afb5e8cb4 (diff) | |
parent | 9b5b0722555891ba94f240760ef3a6d4c870fd13 (diff) | |
download | qmk_firmware-0a3f7e48690bb2b7b008300a54554979a55be19a.tar.gz qmk_firmware-0a3f7e48690bb2b7b008300a54554979a55be19a.zip |
Merge remote-tracking branch 'upstream/develop'0.18.0
Diffstat (limited to 'quantum/debounce/none.c')
-rw-r--r-- | quantum/debounce/none.c | 11 |
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) {} |