forked from mirror/qmk_firmware
[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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user