Skip to content

fix: Manually trigger GPIO update in File Browser mode#819

Merged
osteotek merged 2 commits intomasterfrom
fix/manually-trigger-gpio-update-in-server
Feb 11, 2026
Merged

fix: Manually trigger GPIO update in File Browser mode#819
osteotek merged 2 commits intomasterfrom
fix/manually-trigger-gpio-update-in-server

Conversation

@daveallie
Copy link
Member

@daveallie daveallie commented Feb 10, 2026

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


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

  • Bug Fixes
    • Enhanced input state detection in the web server interface for more responsive and accurate user command recognition during high-frequency operations.

@daveallie
Copy link
Member Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 10, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 10, 2026

📝 Walkthrough

Walkthrough

Adds 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

Cohort / File(s) Summary
Input Manager Enhancement
src/MappedInputManager.h
Added public update() const inline method that forwards to gpio.update() for exposing input state refresh functionality.
Web Server Activity Loop
src/activities/network/CrossPointWebServerActivity.cpp
Integrated periodic input state updates (mappedInput.update()) within the client-handling loop iteration branch to improve responsiveness of button input detection during network operations.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: manually triggering GPIO update in File Browser mode, which directly addresses the bug fix for unreliable exit button detection.
Linked Issues check ✅ Passed The code changes directly address the issue by adding manual GPIO update calls to ensure the exit button state is checked more frequently, improving exit button reliability.
Out of Scope Changes check ✅ Passed All changes are scoped to fixing the GPIO update mechanism for exit button detection; no unrelated modifications are present.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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 removing const qualifier for semantic clarity.

While this compiles (calling non-const methods on a reference member from a const method is allowed in C++), marking update() as const is semantically misleading since it triggers side effects by updating GPIO/input state. The other const methods in this class (wasPressed, wasReleased, etc.) are pure queries, but update() mutates external state.

If mappedInput is not held as a const reference in the calling code, consider removing the const qualifier for clearer intent.

Suggested change
-  void update() const { gpio.update(); }
+  void update() { gpio.update(); }

@lukestein
Copy link
Contributor

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.

Copy link
Contributor

@lukestein lukestein left a comment

Choose a reason for hiding this comment

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

Testing on device (no code review). Seems effective!

@osteotek osteotek merged commit 4a21082 into master Feb 11, 2026
6 checks passed
jdk2pq added a commit to jdk2pq/crosspoint-reader that referenced this pull request Feb 12, 2026
…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)
jdk2pq added a commit to jdk2pq/crosspoint-reader that referenced this pull request Feb 13, 2026
* 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)
anthonydgallo added a commit to anthonydgallo/crosspoint-reader that referenced this pull request Feb 16, 2026
fix: Manually trigger GPIO update in File Browser mode (crosspoint-reader#819)
Unintendedsideeffects pushed a commit to Unintendedsideeffects/crosspoint-reader that referenced this pull request Feb 17, 2026
…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 -->
@daveallie daveallie deleted the fix/manually-trigger-gpio-update-in-server branch February 19, 2026 13:23
saslv pushed a commit to saslv/crosspoint-reader that referenced this pull request Feb 19, 2026
…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 -->
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.

Unable to Exit from networking screens (connected to File Transfer or hotspot); sometimes LONG HOLDING exit button works

3 participants