Keep unknown chips off the ESP32 board tables and let the driver own the I2S clock where the raw divider is unverified - #378
Merged
Conversation
…the I2S clock where the raw divider is unverified A chip that none of the pin tables name fell through to the ESP32 rows, so a new target with enough GPIOs (ESP32-S31, H4) compiled and then probed the ESP32 I2C pins as board_unknown, while one with fewer (H21) failed to compile. The seven tables now name the ESP32 branch and end in the sentinel row for anything else. (The ESP32-C2, which has no board, moves from the ESP32 rows to the sentinel as well.) The I2S driver configuration asks for I2S_CLK_SRC_DEFAULT everywhere: on every chip whose raw divider path runs it is the PLL_160M source that path expects, so nothing changes on the existing targets, and a chip without it no longer needs naming. The raw clock divider that the speaker and mic tasks write afterwards depends on a per-chip source frequency (M5UNIFIED_I2S_PLL_D2_HZ) that cannot be derived from a capability macro, so it is defined only for the targets it has been verified on; any other chip takes the driver-managed path that the ESP32-P4 already uses (real rate passed at setup, no raw override, the over-sampled rate for PDM capture) instead of guessing 80 MHz. The unverified H4 entry is dropped from the table for the same reason. Together with the matching M5GFX change, ESP32-S31 and ESP32-H21 (ESP-IDF 6.1 preview) build; the existing targets keep their code paths.
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
Two places selected code by chip name and let unknown chips fall through to the ESP32 branch:
board_unknown; one with fewer (ESP32-H21) failed to compile. The tables now name the ESP32 branch and end in the sentinel row for anything else. The ESP32-C2, which has no board, moves from the ESP32 rows to the sentinel as well.I2S_CLK_SRC_PLL_160Mexcept on H2 / P4. It now asks forI2S_CLK_SRC_DEFAULTeverywhere — on every chip whose raw divider path runs it is that same PLL_160M source, so nothing changes on the existing targets. The raw clock divider the speaker / mic tasks write afterwards depends on a per-chip source frequency (M5UNIFIED_I2S_PLL_D2_HZ) that cannot be derived from a capability macro, so it is defined only for the targets it was verified on; any other chip takes the driver-managed path the ESP32-P4 already uses (real rate passed at setup, no raw override, the over-sampled rate for PDM capture) instead of assuming 80 MHz. The unverified H4 entry is dropped from that table.With the matching M5GFX change (m5stack/M5GFX#302), ESP32-S31 and ESP32-H21 build.
Verification