From 25c6165b3d7f40d5d59e38dac82db4cef5cf905e Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Sat, 18 Oct 2025 17:38:23 -0700 Subject: [PATCH] Fix PDM compiles for older SOCs (#786) Espressif changes the contents of the PDM struct depending on the chip model. Use a hopefully valid `#define` to avoid setting a member that's not there in some cases. Fixes #785 --- src/AudioOutputPDM.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/AudioOutputPDM.cpp b/src/AudioOutputPDM.cpp index feea567..4dd8b33 100644 --- a/src/AudioOutputPDM.cpp +++ b/src/AudioOutputPDM.cpp @@ -66,7 +66,9 @@ bool AudioOutputPDM::begin() { .gpio_cfg = { .clk = I2S_GPIO_UNUSED, .dout = (gpio_num_t)pdmPin, +#if SOC_I2S_PDM_MAX_TX_LINES > 1 .dout2 = I2S_GPIO_UNUSED, +#endif .invert_flags = { .clk_inv = false, },