Fix screen CS crosstalk window and add IRAM_ATTR to button ISRs #336
No reviewers
Labels
No labels
bug
conflicts
documentation
DO NOT MERGE
duplicate
enhancement
good first issue
hardware
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
greg/info-orbs!336
Loading…
Reference in a new issue
No description provided.
Delete branch "Bullpuph123/fix/screenmanager-isr"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Split from #330 (part 3 of 3), rebased onto dev as requested.
Summary
Button::isrButtonChange()and the MainHelper ISR wrappers run from GPIO interrupts but weren't placed in IRAM. If the interrupt fires while flash cache is disabled (NVS/LittleFS write), the ESP32 crashes with aCache disabled but cached memory region accessedexception.millis()anddigitalRead()are IRAM-safe, so marking the handlers is sufficient.Test plan
pio run -e infoorbs-v0_3🤖 Generated with Claude Code
Pull request overview
This PR improves ESP32 firmware reliability by (1) preventing transient SPI chip-select overlap when switching between TFT panels and (2) ensuring GPIO button interrupt handlers execute from IRAM to avoid crashes during flash cache-disabled windows.
Changes:
ScreenManager::selectScreen()to deselect all CS lines first, validate the requested screen index, and only then assert the target CS (with rotation-aware mapping).MainHelperISR wrappers andButton::isrButtonChange()) withIRAM_ATTRand documented the rationale (flash write / cache-disabled crash avoidance).Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
IRAM_ATTRand clarifies ISR/IRAM requirements in comments.IRAM_ATTRso the ISR path runs from IRAM during flash cache-disabled periods.💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.