Repository navigation
feat: power saving - #22
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Shutter-button activity does not restore brightness or reset the dimming timer.
1 open issue
What changed in this PR
Adds power-saving controls to the remote shutter device and reduces unnecessary display updates.
Changes:
- Adds persistent auto power-off, toggled by holding Button B.
- Introduces inactivity dimming and periodic battery reads with retries.
- Redraws the screen only when its state changes.
| File | Description |
|---|---|
| src/m5stick.cpp | Implements power timers, battery polling, and conditional redraws. |
| src/Display.cpp | Persists auto power-off settings and renders its icon and device-specific battery details. |
| include/Display.hpp | Declares auto power-off state and controls. |
Review effort: Balanced
| } | ||
|
|
||
| if (M5.BtnA.isPressed() || M5.BtnA.wasPressed() || M5.BtnA.wasReleased()) { | ||
| last_activity_ms = now; |
Owner
Author
There was a problem hiding this comment.
This is by design. The shutter button (BtnA) is expected to be used frequently, and since the screen display remains unchanged, it was determined that there is no need to adjust the brightness; therefore, this behavior is exactly as intended.
ww24
force-pushed
the
feat/power-saving
branch
from
October 18, 2026 16:39
1bde3e2 to
92a8a58
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This pull request adds an auto power-off feature and improves battery and display management for the device. The main changes include support for toggling auto power-off, improved battery status handling, adjustable display brightness with dimming, and more efficient screen updates.
Auto Power-Off Feature:
auto_power_offsetting to theDisplayclass, with persistent storage and a UI icon. Users can toggle this feature using a long press on Button B. [1] [2] [3] [4] [5] [6]Battery and Display Management:
UI and State Handling:
Code Quality Improvements:
These changes collectively enhance power management, user experience, and code maintainability.