Fixed debounce code to handle noisy switch transitions #989 (#1030)

* Fix debounce to handle noisy switch transitions

* Fix debounce to handle noisy switch transitions

* Fix debounce to handle noisy switch transitions

* Removed inline comment to see if Clang checker will be happy

* Test fix for supposed Clang formatting issue
This commit is contained in:
Mark Thompson
2023-05-21 19:06:37 -05:00
committed by GitHub
parent be1b2716d6
commit 4d1269051b
2 changed files with 19 additions and 8 deletions

View File

@@ -24,6 +24,10 @@
#include <cstdint>
// consecutive # of times button input must be same (<=8)
#define DEBOUNCE_COUNT 4
#define DEBOUNCE_MASK ((1 << DEBOUNCE_COUNT) - 1)
class Debounce {
public:
bool feed(const uint8_t bit);