A fork of https://github.com/crosspoint-reader/crosspoint-reader
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: Manually trigger GPIO update in File Browser mode (#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
https://github.com/crosspoint-reader/crosspoint-reader/issues/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 -->

authored by

Dave Allie and committed by
GitHub
4a210823 f5b85f5c

+4
+1
src/MappedInputManager.h
··· 15 15 16 16 explicit MappedInputManager(HalGPIO& gpio) : gpio(gpio) {} 17 17 18 + void update() const { gpio.update(); } 18 19 bool wasPressed(Button button) const; 19 20 bool wasReleased(Button button) const; 20 21 bool isPressed(Button button) const;
+3
src/activities/network/CrossPointWebServerActivity.cpp
··· 348 348 // Yield and check for exit button every 64 iterations 349 349 if ((i & 0x3F) == 0x3F) { 350 350 yield(); 351 + // Force trigger an update of which buttons are being pressed so be have accurate state 352 + // for back button checking 353 + mappedInput.update(); 351 354 // Check for exit button inside loop for responsiveness 352 355 if (mappedInput.wasPressed(MappedInputManager::Button::Back)) { 353 356 onGoBack();