-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mechanical switches exhibit temporary voltage fluctuations when electrical contact is made, which manifest as "bouncing" between the logical high and low states. Sampling the switch's state during this period of stability produces invalid results. The switch must be debounced by ignoring the generated interrupts until the switch's state has stabilized. This is implemented by delaying the input events until an empirically determined time has elapsed. As such this pull request introduces customizable high resolution timers for debouncing button down and up events. This software debouncing unfortunately increases the sensor watch's input latency. This is an acceptable tradeoff due to better usability: watch faces which require holding down buttons such as the pulsometer should work much more reliably after this patch. Reviewed-by: Matheus Afonso Martins Moreira <[email protected]> Tested-on-hardware-by: Krzysztof Gałka <@kshysztof@Discord> GitHub-Pull-Request: #437 References: https://en.wikipedia.org/wiki/Switch#Contact_bounce
- Loading branch information
Showing
2 changed files
with
69 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters