Make debounce() signal changes in the cooked matrix as return value (#17554)

This commit is contained in:
Stefan Kerkmann 2022-07-07 10:00:40 +02:00 committed by GitHub
parent cca5d35321
commit 8224f62806
Failed to generate hash of commit
13 changed files with 83 additions and 39 deletions

View file

@ -1,10 +1,16 @@
#pragma once
// raw is the current key state
// on entry cooked is the previous debounced state
// on exit cooked is the current debounced state
// changed is true if raw has changed since the last call
void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed);
/**
* @brief Debounce raw matrix events according to the choosen debounce algorithm.
*
* @param raw The current key state
* @param cooked The debounced key state
* @param num_rows Number of rows to debounce
* @param changed True if raw has changed since the last call
* @return true Cooked has new keychanges after debouncing
* @return false Cooked is the same as before
*/
bool debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed);
void debounce_init(uint8_t num_rows);