Skip to content

Commit 29350ec

Browse files
exclude unsupported code
1 parent 30225ea commit 29350ec

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/esp32_audio_kit_module.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,13 @@ void ac101_mclk_setup()
142142
{
143143
uint32_t freq = SAMPLE_RATE * 512; /* The maximal frequency is 80000000 / 2^bit_num */
144144
Serial.printf("Output frequency: %d\n", freq);
145+
#if ESP_ARDUINO_VERSION_MAJOR < 3
145146
ledcSetup(MCLK_CH, freq, PWM_BIT);
146147
ledcAttachPin(OUTPUT_PIN, MCLK_CH);
147148
ledcWrite(MCLK_CH, 1 << (PWM_BIT - 1)); /* 50% duty -> The available duty levels are (2^bit_num)-1, where bit_num can be 1-15. */
149+
#else
150+
#warning MCLK not supported yet
151+
#endif
148152
}
149153

150154
/*

0 commit comments

Comments
 (0)