Repository navigation
Board detect: name each detection phase consistently - #380
Merged
Merged
Conversation
Detection runs signature -> confirm -> prepare (with refine) -> construct -> adopt, but several names used "setup" or "startup" for different phases. Rename them to the phase they belong to, for example: - setup_succeeded -> adopted, finish_detection_setup -> construct_and_adopt - setup_board / setup_detected_board -> construct_board / construct_detected_board - *_setup.inl -> *_construct.inl, startup.inl -> prepare_steps.inl - LGFX_Device side: _finish_detected_init -> _init_adopted_panel - run_fixed_detection -> run_fixed_startup, fixed_start -> fixed_prepare Other internal names that did not say what they hold are renamed as well (preferred -> fallback, nvs_board -> hint_board, the spi_id_detector object -> atoms3_family_detector, direct_setup -> keep_panel_during_attempt, ...). Raw package numbers become named constants with the same values. Comments that described an older implementation or disagreed with the code are rewritten: the retry reset policy, the attempt that first permits a reset, where resets happen, and which members a hinted probe reads. Generated headers now carry the same banner, naming the command that regenerates them, and the wiring generator builds its include list without a fixed splice index. Document the M5GFX_AUTODETECT_TEST_* failure injection macros in extras/board_spec/README.md, and explain in the runtime how the detector order is chosen when a hint is present. Add a test that runs the production detector order for every package and every board hint, and compares it with a reference implementation of the documented rule (power-hold families first, the hinted family first within its group, ordering constraints respected). No behavior change.
Move the esp32s3_boards registration table from the end of m5/esp32s3/families.inl into m5/esp32s3/board_entries.inl, included at the same point. The content is unchanged.
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
Board detection has not been released yet. This makes the code easier to follow before the first release: names say which detection phase they belong to, comments that described an older implementation are rewritten, and the ESP32-S3 board table gets its own file. Detection results, retry counts, reset timing and GPIO restoration do not change.
Name each phase consistently
Detection runs signature -> confirm -> prepare (with refine) -> construct -> adopt. Names that used "setup" or "startup" for different phases now use the phase they belong to, for example:
setup_succeeded->adopted,finish_detection_setup->construct_and_adopt,LGFX_Device::_finish_detected_init->_init_adopted_panelsetup_board/setup_detected_board->construct_board/construct_detected_board,*_setup.inl->*_construct.inl,startup.inl->prepare_steps.inlrun_fixed_detection->run_fixed_startup,fixed_start->fixed_preparepreferred->fallback,nvs_board->hint_board(it also holds the build-time board), thespi_id_detectorobject ->atoms3_family_detector(its type)All renamed identifiers are internal (
board_detectnamespace or private members).Comments and documentation
extras/board_spec/README.mddocuments theM5GFX_AUTODETECT_TEST_*failure injection macros and how the detector order is chosen with a hintTests
extras/board_spec/test/detector_hint_order.test.js: for every package and every board hint, the production detector order is compared with a reference implementation of the documented ruleMove the ESP32-S3 board table
The second commit moves the
esp32s3_boardstable from the end ofm5/esp32s3/families.inlintom5/esp32s3/board_entries.inl, included at the same point. The content is unchanged.Testing
develop, startup time unchangedextras/board_specnpm test(210 tests) andnpm run checkpass