Skip to content

Fix unused-function/variable warnings on non-P4 targets - #376

Merged
lovyan03 merged 1 commit into
m5stack:developfrom
ainyan03:unused_warnings
Sep 21, 2026
Merged

lovyan03 merged 1 commit into
m5stack:developfrom
ainyan03:unused_warnings

Conversation

@ainyan03

Copy link
Copy Markdown
Contributor

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_clk is 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.

- 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).
@lovyan03
lovyan03 merged commit 5e9bf6f into m5stack:develop Sep 21, 2026
28 checks passed
@ainyan03
ainyan03 deleted the unused_warnings branch September 21, 2026 09:53
@ainyan03 ainyan03 mentioned this pull request Sep 21, 2026
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)
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