debounce.h 615 B

123456789101112131415161718192021
  1. #pragma once
  2. #include <stdint.h>
  3. #include <stdbool.h>
  4. #include "matrix.h"
  5. /**
  6. * @brief Debounce raw matrix events according to the choosen debounce algorithm.
  7. *
  8. * @param raw The current key state
  9. * @param cooked The debounced key state
  10. * @param num_rows Number of rows to debounce
  11. * @param changed True if raw has changed since the last call
  12. * @return true Cooked has new keychanges after debouncing
  13. * @return false Cooked is the same as before
  14. */
  15. bool debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed);
  16. void debounce_init(uint8_t num_rows);
  17. void debounce_free(void);