diff options
author | alex-ong <[email protected]> | 2019-01-26 17:03:46 +1100 |
---|---|---|
committer | alex-ong <[email protected]> | 2019-01-26 17:03:46 +1100 |
commit | d0b691df0ee74863ca54ca697aa4d4212cf401a7 (patch) | |
tree | f584ae6d23347b7256a679fd3eecd653744b6187 /quantum/debounce.c | |
parent | 3949ab322dcce75f470ddfbe701c8763add69e63 (diff) | |
download | qmk_firmware-d0b691df0ee74863ca54ca697aa4d4212cf401a7.tar.gz qmk_firmware-d0b691df0ee74863ca54ca697aa4d4212cf401a7.zip |
DO NOT USE - debounce successfully compiled.
Diffstat (limited to 'quantum/debounce.c')
-rw-r--r-- | quantum/debounce.c | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/quantum/debounce.c b/quantum/debounce.c deleted file mode 100644 index 929023ab2d..0000000000 --- a/quantum/debounce.c +++ /dev/null @@ -1,52 +0,0 @@ - -#include "matrix.h" -#include "timer.h" -#include "quantum.h" - -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 -#endif - -void debounce_init(uint8_t num_rows) { -} - -#if DEBOUNCING_DELAY > 0 - -static bool debouncing = false; - -void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) { - static uint16_t debouncing_time; - - if (changed) { - debouncing = true; - debouncing_time = timer_read(); - } - - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { - for (uint8_t i = 0; i < num_rows; i++) { - cooked[i] = raw[i]; - } - debouncing = false; - } -} - -bool debounce_active(void) { - return debouncing; -} - -#else - -// no debounce -void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) { - if (changed) - { - for (uint8_t i = 0; i < num_rows; i++) { - cooked[i] = raw[i]; - } - } -} - -bool debounce_active(void) { - return false; -} -#endif |