Skip to content

Keep the display bus on GPIO46 when Display.init() ran before begin() - #382

Merged
lovyan03 merged 1 commit into
m5stack:developfrom
ainyan03:gpio46_after_display_init
Sep 30, 2026
Merged

lovyan03 merged 1 commit into
m5stack:developfrom
ainyan03:gpio46_after_display_init

Conversation

@ainyan03

Copy link
Copy Markdown
Contributor

On ESP32-S3, M5.begin() drives GPIO46 high at the start as the power hold for Dial / Capsule / AirQ / DinMeter, before the board is known.

When the application has already called M5.Display.init() before M5.begin(), GPIO46 is already in use by the display on the StopWatch (QSPI io2). begin() overwrote it with a plain GPIO output, and the second Display.init() inside begin() returns early for a known board, so the pin was never routed back. Every pixel then had one data bit stuck at 1, and black was shown as a bright green.

This PR skips the early GPIO46 output when the board is already known, and applies the power hold after the pin map is set, only on boards whose power hold is GPIO46. When begin() is called without a prior Display.init(), the behaviour is unchanged.

Tested (GPIO46 output select / enable / level logged at each step):

Board M5.begin() only M5.Display.init() then M5.begin()
StopWatch display bus kept, black is black before: bus replaced by a GPIO output, black shows as green / after: display bus kept, black is black
Dial power hold high after begin() power hold high after begin()

begin() drove GPIO46 high as a power hold before the board was known.
When the application had already called Display.init(), the StopWatch
QSPI io2 on GPIO46 was overwritten and never re-routed, so every pixel
had a fixed bit and black showed as a bright colour. Skip the early
hold in that case and apply it after the pin map is known, only on
boards whose power hold is GPIO46 (Dial, Capsule, AirQ, DinMeter).
@lovyan03
lovyan03 merged commit 61170a9 into m5stack:develop Sep 30, 2026
28 checks passed
@ainyan03
ainyan03 deleted the gpio46_after_display_init branch September 30, 2026 12:16
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.

2 participants