handle esp32 apll issues (#51)

* make use_apll user-configurable (fixes #37)

* disable apll per default (fixes #47)
This commit is contained in:
h3ndrik authored and Earle F. Philhower, III committed 2018-02-06 08:06:22 -08:00
1 parent eb677664f2
commit 0bb859037b
2 files changed
+13 -9

No files matched your search

+9 -7
View File
@@ -26,18 +26,20 @@
#endif
#include "AudioOutputI2S.h"
AudioOutputI2S::AudioOutputI2S(int port, bool builtInDAC)
AudioOutputI2S::AudioOutputI2S(int port, bool builtInDAC, int use_apll)
{
portNo = port;
i2sOn = false;
#ifdef ESP32
if (!i2sOn) {
// don't use audio pll on buggy rev0 chips
int use_apll = 0;
esp_chip_info_t out_info;
esp_chip_info(&out_info);
if(out_info.revision > 0) {
use_apll = 1;
if (use_apll == APLL_AUTO) {
// don't use audio pll on buggy rev0 chips
use_apll = APLL_DISABLE;
esp_chip_info_t out_info;
esp_chip_info(&out_info);
if(out_info.revision > 0) {
use_apll = APLL_ENABLE;
}
}
i2s_config_t i2s_config_dac = {
.mode = (i2s_mode_t)(I2S_MODE_MASTER | I2S_MODE_TX | (builtInDAC ? I2S_MODE_DAC_BUILT_IN : 0)),