Repository navigation
Fix the build on ESP targets without board detection and on SDL - #356
Merged
Merged
Conversation
M5GFX.cpp failed to compile on ESP targets that have no board detection package (ESP32-S2, for example): the detection headers and helpers were guarded by the list of supported targets, but init_impl() and autodetect() used them unconditionally. A single internal macro now selects the detection path. On the other targets no detection runs and the board stays board_unknown, as in 0.2.33; a fixed_board request is refused with a warning. Unsupported targets now also skip NVS reads and writes, whereas 0.2.33 performed unsuccessful detection and could write the unknown result back to NVS. On SDL, setDetectConfig() was defined only inside the ESP section, so calling it (M5Unified::begin() always does) failed to link. It is now defined for every platform. SDL init uses fixed_board when it is set, then M5GFX_BOARD, then the previous default.
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.
ESP targets without board detection (ESP32-S2, for example)
M5GFX.cppfailed to compile: the detection headers and helpers were guarded by the list of supported targets, butinit_impl()andautodetect()used them unconditionally ('select_fixed_board' was not declared in this scope, ...).board_unknown, as in 0.2.33; afixed_boardrequest is refused with a warning. These targets now also skip NVS reads and writes.SDL
setDetectConfig()was defined only inside the ESP section, so calling it failed to link (M5Unified::begin()always calls it).fixed_boardwhen it is set, thenM5GFX_BOARD, then the previous default.The host tests in
extras/board_specthat compile excerpts ofM5GFX.cppdefine the new macro.Testing
setDetectConfig()andinit()links.extras/board_spec:npm testandnpm run checkpassed. CI on the fork: passed.