Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite to main and add-ons debouncing #604

Merged
merged 10 commits into from
Nov 5, 2023

Conversation

NickGuyver
Copy link
Contributor

This PR addresses a few issues:

  • Change the core logic on the game pad debouncer and several add-ons to be more optimized
  • Make debouncing code more readable and consistent
  • Introduce debounce helper functions for add-ons that could use them

While no change in latency was measurable with my setup, the logic has changed so that presses will always take with no delays. Only release will be delayed, on a per button basis, as currently set at 5ms. Previously, presses and releases were delayed by 5ms based on change equally. Also, checks were added to avoid wasting cycles if the states haven't changed in all the debounced areas.

NickGuyver and others added 9 commits October 27, 2023 16:09
Improve debouncing in a few ways:
- easier to read and follow
- don't run unless there are changes
- change the algo to immediately take presses, only using timer if it's a release
create debounce helper functions for add-ons to leverage
add to dualdirectional for testing
Some more fixes, expand debounce helper to tilt, and rewrite the debouncing for jslider and turbo.

Rewritten add-ons shoulder be more consistent, readable, and potentially faster.
Add the ability to adjust debounce delay from web settings (not working), cleanup old debounce references, and fixes to debounce logic.
@NickGuyver NickGuyver marked this pull request as ready for review November 3, 2023 01:14
set maximum value and reduce the type needed
Copy link
Contributor

@arntsonl arntsonl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Gets us part of the way to standardizing our debounce logic

@arntsonl arntsonl merged commit 30f15d3 into OpenStickCommunity:main Nov 5, 2023
62 checks passed
@NickGuyver NickGuyver deleted the debouncer branch June 12, 2024 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants