Fix for esp8266 I2S/NoDAC (#344)
* esp8266: Allows I2S-NoDAC to use only I2S-out-data GPIO avoiding conflicts with repurposed GPIO, especially conflicting with SDFS. * +message * new upstream API update * check i2s_begin's return value
This commit is contained in:
1 parent
dd8ac07e4e
commit
435e2cf028
3 files changed
+16
-3
No files matched your search
+13
-2
@@ -129,7 +129,7 @@ bool AudioOutputI2S::SetOutputModeMono(bool mono)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AudioOutputI2S::begin()
|
||||
bool AudioOutputI2S::begin(bool txDAC)
|
||||
{
|
||||
#ifdef ESP32
|
||||
if (!i2sOn)
|
||||
@@ -196,7 +196,18 @@ bool AudioOutputI2S::begin()
|
||||
{
|
||||
orig_bck = READ_PERI_REG(PERIPHS_IO_MUX_MTDO_U);
|
||||
orig_ws = READ_PERI_REG(PERIPHS_IO_MUX_GPIO2_U);
|
||||
i2s_begin();
|
||||
#ifdef I2S_HAS_BEGIN_RXTX_DRIVE_CLOCKS
|
||||
if (!i2s_rxtxdrive_begin(false, true, false, txDAC)) {
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
if (!i2s_rxtx_begin(false, true)) {
|
||||
return false;
|
||||
}
|
||||
if (!txDAC) {
|
||||
audioLogger->printf_P(PSTR("I2SNoDAC: esp8266 arduino core should be upgraded to avoid conflicts with SPI\n"));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
i2sOn = true;
|
||||
|
||||
Reference in new issue
Block a user