Clean up board detection leftovers and panel checks - #312
Merged
Merged
Conversation
All boards are detected through the board detection framework, so the helpers and settings kept for the removed per-board blocks are unused: the soft I2C probe helpers, the SD SPI-mode and panel reset helpers, an unused I2C port constant, an unused include, and the SPI bus settings that autodetect() filled in but never applied. autodetect() also no longer replaces _bus_last with an unconfigured Bus_SPI before probing. A successful detection installs its own bus; when a re-detection ended unknown, the previous panel was restored while its bus had already been freed by that placeholder.
The Core2 family is now confirmed by the AXP192 / AXP2101 ID and the Station exclusion. The ILI9342C / ILI9342E check and the Tough touch probe run in the refine stage after the PMIC power sequence, as on the CoreS3 family. No PMIC register is written before confirmation, so the register backup and restore paths are removed. AXP192 is shared by Core2 v1.0, Tough and Station, and Station is told apart only by its LCD ID. When that read misses and the Core2 panel and the Tough touch controller do not answer either, the attempt fails and detection retries instead of storing Core2. An AXP2101 Core2 whose panel does not answer is still detected as Core2 (the variant then defaults to ILI9342C).
The touch controller identifies the panel: ST touch firmware 1 means ST7121, 3 means ST7123, and a GT911 means ILI9881C. Use that result directly, without the 80 ms wait and the DSI ID reads that repeated the check. Only when no touch controller answers, fall back to the DSI ID read for ILI9881C as before.
Read the ILI9342C / ILI9342E keys with the same software SPI sequence as Core2, from the refine stage, and pass the result to construction as an option bit. The LCD bus is 3-wire, so read data returns on MOSI. This removes the hardware-SPI panel ID helpers from M5GFX.cpp, and the construction now starts the bus at its normal 40 / 16 MHz. ToughC5 and NessoN1 no longer read the panel ID only to log a mismatch warning; the result never affected detection.
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.
Summary
Follow-up cleanup after the board detection framework (#311): remove what the legacy autodetect chain left behind in
M5GFX.cpp, and move the remaining panel checks of Core2 / Tough, CoreS3 and Tab5 to the same shape as the other boards. About 510 lines are removed in total.Changes
M5GFX.cpp: unused soft I2C / SD / reset helpers, SPI bus settings that were filled in but never applied, and the placeholderBus_SPIcreated before detection. Removing the placeholder also fixes a failed re-detection restoring the previous panel with an already freed bus.M5GFX.cpp.Behavior changes
Testing