Skip to content

Commit 8fe0911

Browse files
ESP32 AudioOutputULP fixes (#579)
* Fix ULP on ESP32 CONFIG_IDF_TARGET_ESP32 is not yet defined before #include "AudioOutputULP.h" * AudioOutputULP: Fix DAC2 stereo in case of DAC1+DAC2 * ULP - no ESP32S2 / S3 On ESP32S2 it compiles, but no audio is coming out On ESP32S3 DAC is not supported * Astyle --------- Co-authored-by: Earle F. Philhower, III <earlephilhower@yahoo.com>
1 parent 94f6879 commit 8fe0911

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/AudioOutputULP.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@
1818
along with this program. If not, see <http://www.gnu.org/licenses/>.
1919
*/
2020

21-
#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2
21+
#ifdef ESP32
2222

2323
#include "AudioOutputULP.h"
24+
25+
#if CONFIG_IDF_TARGET_ESP32
26+
2427
#include <esp32/ulp.h>
2528
#include <driver/rtc_io.h>
2629
#include <soc/rtc_io_reg.h>
@@ -174,7 +177,7 @@ bool AudioOutputULP::begin() {
174177
for (int i = 0; i < 256; i++) {
175178
RTC_SLOW_MEM[dacTableStart1 + i * 2] = create_I_WR_REG(RTC_IO_PAD_DAC1_REG, 19, 26, i); //dac1: 0x1D4C0121 | (i << 10)
176179
RTC_SLOW_MEM[dacTableStart1 + 1 + i * 2] = create_I_BXI(retAddress1); // 0x80000000 + retAddress1 * 4
177-
RTC_SLOW_MEM[dacTableStart2 + i * 2] = create_I_WR_REG(RTC_IO_PAD_DAC1_REG, 19, 26, i); //dac2: 0x1D4C0122 | (i << 10)
180+
RTC_SLOW_MEM[dacTableStart2 + i * 2] = create_I_WR_REG(RTC_IO_PAD_DAC2_REG, 19, 26, i); //dac2: 0x1D4C0122 | (i << 10)
178181
RTC_SLOW_MEM[dacTableStart2 + 1 + i * 2] = create_I_BXI(retAddress2); // 0x80000000 + retAddress2 * 4
179182
}
180183
break;
@@ -270,3 +273,4 @@ bool AudioOutputULP::stop() {
270273
}
271274

272275
#endif
276+
#endif

0 commit comments

Comments
 (0)