diff options
author | Nick Brassel <[email protected]> | 2023-11-28 16:39:48 +1100 |
---|---|---|
committer | Nick Brassel <[email protected]> | 2023-11-28 16:40:47 +1100 |
commit | 0115951de12bd4c798a43a380651c34552552e85 (patch) | |
tree | 62999011ae782d93aa6dc9c889615db2a840cafc /quantum/debounce/none.c | |
parent | 0379d1f59e58cefa18cdb72ba1b77507d1108ae6 (diff) | |
parent | 4d99e0a23cff02f4c6e55e093b5de08a9be0df7c (diff) | |
download | qmk_firmware-0.23.0.tar.gz qmk_firmware-0.23.0.zip |
`develop` -> `master`, 2023q4 edition0.23.0
Diffstat (limited to 'quantum/debounce/none.c')
-rw-r--r-- | quantum/debounce/none.c | 10 |
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; } |