Fix unused-function/variable warnings on non-P4 targets - #376
Merged
Merged
Conversation
- M5Unified.inl: _corep4x_audio_power and both of its callers are P4-only; move the definition inside the same guard (-Wunused-function elsewhere). - Mic_Class.inl: skip_raw_clk is only consumed inside the HW v2 block; define it there (unused variable on ESP32 classic).
Merged
lovyan03
added a commit
that referenced
this pull request
Sep 21, 2026
Fix unused-function/variable warnings on non-P4 targets (cherry picked from commit 5e9bf6f)
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 compiler warnings on targets other than ESP32-P4:
M5Unified.inl:_corep4x_audio_power()is a static helper whose only two callers are inside#if defined (CONFIG_IDF_TARGET_ESP32P4). Its definition was outside that guard (with a(void)body), so every non-P4 build reported-Wunused-function. The definition now lives under the same guard.Mic_Class.inl:skip_raw_clkis only consumed inside the I2S HW v2 block, so on ESP32 (classic) it was an unused variable. It is now defined right before its use.No behaviour change.
Verification
Compiled with Arduino core 2.0.3 / 2.0.17 / 3.1.1 / 3.3.9 and ESP-IDF 5.1 / 5.2 / 5.3 / 5.5 / 6.0 across ESP32 / S2 / S3 / C3 / C5 / C6 / C61 / H2 / P4 with
-Wall -Wextra: no warnings from the library remain.