Skip to content

Prefer member variables over function scope statics#15

Merged
MaffooClock merged 1 commit into
MaffooClock:mainfrom
cleishm:last-intr-in-class
Oct 13, 2025
Merged

Prefer member variables over function scope statics#15
MaffooClock merged 1 commit into
MaffooClock:mainfrom
cleishm:last-intr-in-class

Conversation

@cleishm

@cleishm cleishm commented Oct 13, 2025

Copy link
Copy Markdown
Contributor

Move function scoped statics to class members, as the static is shared for all class instances.

Move function scoped statics to class members, as the static is shared
for all class instances.
@cleishm cleishm force-pushed the last-intr-in-class branch from 8fc1b55 to f5223eb Compare October 13, 2025 15:01
@cleishm cleishm changed the title Fix button debounce for multiple encoders Prefer member variables over function scope statics Oct 13, 2025
@cleishm

cleishm commented Oct 13, 2025

Copy link
Copy Markdown
Contributor Author

It also wouldn't hurt to clean up the member variables in the class, as they're declared and initialized in inconsistent ways. However, I tried to keep changes minimal for this PR.

  • Can remove all the volatile markers, as all these member variables are protected by the mux.
  • Use either inline initialization in the class definition or initialization in begin. Currently it's a mix.
  • Add doc comments or remove them for internal variables. Right now some have them, some don't, and some have empty blocks.

@MaffooClock MaffooClock merged commit 6351b7d into MaffooClock:main Oct 13, 2025
2 checks passed
@MaffooClock MaffooClock added the enhancement New feature or request label Oct 13, 2025
@cleishm cleishm deleted the last-intr-in-class branch October 13, 2025 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants