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

[wpimath] Fix Debouncer type-changing behavior #7870

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

crueter
Copy link
Contributor

@crueter crueter commented Mar 19, 2025

Closes #7867

Properly resets the baseline upon switching the debounce type, and adds
a test for such.

Signed-off-by: swurl [email protected]

Closes wpilibsuite#7867

Properly resets the baseline upon switching the debounce type, and adds
a test for such.

Signed-off-by: swurl <[email protected]>
@crueter crueter requested a review from a team as a code owner March 19, 2025 17:51
@github-actions github-actions bot added the component: wpimath Math library label Mar 19, 2025
Copy link
Member

@calcmogul calcmogul left a comment

Choose a reason for hiding this comment

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

The Java switch expression is probably fine as is, but the C++ version is way more verbose.

@crueter
Copy link
Contributor Author

crueter commented Mar 19, 2025

Changed everything in the constructor as well for the sake of consistency.

@crueter
Copy link
Contributor Author

crueter commented Mar 21, 2025

When changing the debounce time, does the timer need to be reset like in the constructor?

@calcmogul
Copy link
Member

Either way seems valid to me.

@crueter
Copy link
Contributor Author

crueter commented Mar 21, 2025

I'll leave it as is and if someone requests the change we can change it pretty easily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[wpimath] Changing Debouncer DebounceType on the fly results in incorrect behavior
2 participants