fix: Manually trigger GPIO update in File Browser mode#819
Conversation
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
📝 WalkthroughWalkthroughAdds input state refreshing capability to the MappedInputManager with a new const update() method and integrates periodic input polling into the network web server activity loop to enable more responsive button detection during file transfer operations. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/activities/network/CrossPointWebServerActivity.cpp`:
- Around line 351-353: The comment above the mappedInput.update() call contains
a typo; change "so be have accurate stat" to "so we have accurate state" so the
comment reads: "Force trigger an update of which buttons are being pressed so we
have accurate state for back button checking" while leaving the
mappedInput.update() call unchanged.
🧹 Nitpick comments (1)
src/MappedInputManager.h (1)
18-18: Consider removingconstqualifier for semantic clarity.While this compiles (calling non-const methods on a reference member from a const method is allowed in C++), marking
update()asconstis semantically misleading since it triggers side effects by updating GPIO/input state. The otherconstmethods in this class (wasPressed,wasReleased, etc.) are pure queries, butupdate()mutates external state.If
mappedInputis not held as a const reference in the calling code, consider removing theconstqualifier for clearer intent.Suggested change
- void update() const { gpio.update(); } + void update() { gpio.update(); }
|
Testing on device and quick clicks of the "Exit" button seem more reliably detected in both "Network Transfer" and "Hotspot Mode" screens. I noticed that one time, clicking exit in the hotspot mode caused the device to reboot rather than just return home, but I can't reproduce that. |
lukestein
left a comment
There was a problem hiding this comment.
Testing on device (no code review). Seems effective!
…king-space * master: fix: chore: make all debug messages uniform (crosspoint-reader#825) fix: Show "Back" in file browser if not in root, "Home" otherwise. (crosspoint-reader#822) fix: Manually trigger GPIO update in File Browser mode (crosspoint-reader#819)
* master: fix: chore: make all debug messages uniform (crosspoint-reader#825) fix: Show "Back" in file browser if not in root, "Home" otherwise. (crosspoint-reader#822) fix: Manually trigger GPIO update in File Browser mode (crosspoint-reader#819)
fix: Manually trigger GPIO update in File Browser mode (crosspoint-reader#819)
…ader#819) ## Summary * Manually trigger GPIO update in File Browser mode * Previously just assumed that the GPIO data would update automatically (presumably via yield), the data is currently updated in the main loop (and now here as well during the middle of the processing loop). * This allows the back button to be correctly detected instead of only being checked once every 100ms or so for the button state. ## Additional Context * Fixes crosspoint-reader#579 --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Enhanced input state detection in the web server interface for more responsive and accurate user command recognition during high-frequency operations. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
…ader#819) ## Summary * Manually trigger GPIO update in File Browser mode * Previously just assumed that the GPIO data would update automatically (presumably via yield), the data is currently updated in the main loop (and now here as well during the middle of the processing loop). * This allows the back button to be correctly detected instead of only being checked once every 100ms or so for the button state. ## Additional Context * Fixes crosspoint-reader#579 --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Enhanced input state detection in the web server interface for more responsive and accurate user command recognition during high-frequency operations. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary
Additional Context
AI Usage
While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it
helps set the right context for reviewers.
Did you use AI tools to help write this code? No
Summary by CodeRabbit