-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* remove double initialization of gamepad GPIOs * move gamepad debouncing to one GPIO debouncer a couple classes had their own debouncer or reference to the gamepad debouncer. this seemed inefficient and caused potential for incongruent behavior, thinking that instead we should just debounce the GPIO pins (for buttons). this does that. this doesn't yet clean up all the code (specifically the old debouncer) but it does get everything on the new debouncer. things appear to work as before, maybe they solve some debouncing problems for folks, work to be done * review: debounceDelay should be a uint32_t * cleanups now that we have a new centralized pin debouncer * review: move debouncedGpio from an inline static to storage * do the pin debounce before setting gamepad state this fixes boot time shortcuts that were broken by my refactor * skip debouncing if debounce time is configured to 0 * apply Feral's debouncer fix --- apply debounceDelay always the previous debouncer logic would try to only wait for the debounceDelay on button depresses, IIRC in an attempt to get the real button press immediately, but the more I look at it, the more I come to the same conclusion as Feral that such logic is flawed, and will register flapping switches because it's eagerly not debouncing them. with this change, button presses only register if it's been debounceDelay (default 5ms) since the last change. buttons will still register immediately as long as the delay has been met, so in practice this may only affect a latency tester and some kind of superhuman who mashes buttons at sub-5ms speeds. this applies Feral's logic (from the button debouncer) to the refactored pin debouncer. Co-authored-by: FeralAI <[email protected]> * Tune turbo * Throttle ADC shot reads/saves, update LED states * Reset turbo flicker when all buttons disabled * Fix issue with turbo flagging * Tune turbo loop timing * Update default turbo rate --------- Co-authored-by: Brian S. Stephan <[email protected]>
- Loading branch information
Showing
5 changed files
with
104 additions
and
70 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
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
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