Skip to content

Encapsulate button.cpp's own runtime state as static, not global - #5788

Merged
netmindz merged 1 commit into
wled:mainfrom
netmindz:refactor/buttoncpp-globals
Aug 8, 2026
Merged

Encapsulate button.cpp's own runtime state as static, not global#5788
netmindz merged 1 commit into
wled:mainfrom
netmindz:refactor/buttoncpp-globals

Conversation

@netmindz

@netmindz netmindz commented Aug 8, 2026

Copy link
Copy Markdown
Member

Summary

Part of an ongoing pass identifying WLED_GLOBAL declarations that are actually only referenced in one file (see #5777-#5787 for earlier ones). lastOnTime turned out to be private to button.cpp — this is the last one from the Tier-1 (single-file) list.

Converted it to file-local static, same type and initial value as before.

No behavior change — purely a storage-class change.

Test plan

  • esp32dev: builds and links cleanly via pio run -e esp32dev, no warnings.
  • Confirmed via repo-wide grep (wled00/, usermods/) that lastOnTime is not referenced outside button.cpp.

🤖 Generated with Claude Code

lastOnTime was referenced only in button.cpp. Converted it to
file-local `static`.

No behavior change - purely a storage-class change.

Verified: esp32dev builds and links cleanly via `pio run -e esp32dev`,
no warnings from either changed file.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@netmindz, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 41 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 730b4b54-0e1c-46f1-b541-74778d4aba7b

📥 Commits

Reviewing files that changed from the base of the PR and between 0869ef4 and 3fec100.

📒 Files selected for processing (2)
  • wled00/button.cpp
  • wled00/wled.h

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@netmindz
netmindz merged commit ba1ce2f into wled:main Aug 8, 2026
30 checks passed
@netmindz
netmindz deleted the refactor/buttoncpp-globals branch August 8, 2026 11:54
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