Repository navigation
New robust debouncing algorithm
debouncing algorithm replaced with a robust one
- the original algorithm was as simple as possible: after detecting a change, wait for a defined period of time, then read input again and that is a new stable state.
- the new algoritm checks the input in each loop and monitors how long it has been stable. If the stable period is longer than the defined time, then a new stable state is reported. No other changes in functionality, just the debouncing algorithm.
- object's memory reduced by 2 bytes
m_changed member removed
m_changedwas replaced with an expression lastState!=currentState- new method changed() added