From 8224f62806b66f0825b68fd8c00436ee57a28e9a Mon Sep 17 00:00:00 2001 From: Stefan Kerkmann Date: Thu, 7 Jul 2022 10:00:40 +0200 Subject: Make debounce() signal changes in the cooked matrix as return value (#17554) --- quantum/debounce.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'quantum/debounce.h') diff --git a/quantum/debounce.h b/quantum/debounce.h index 3532d9cd7b..a8629654c2 100644 --- a/quantum/debounce.h +++ b/quantum/debounce.h @@ -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); -- cgit v1.2.3