ESP32-C3 Support (#454)
* ESP32-C3 has no ULP coprocessor Only the ESP32, ESP32-S2 and ESP32-S3 chips have an ULP coprocessor, ESP32-C3 doesn't have it. So exclude this code from compiling, as it cannot compile in the C3 environment. * uint32_t and size_t is not the same on RISC-V This change is necessary to be able to compile it on ESP32-C3 * uint32_t and size_t is not the same on RISC-V The change is necessary to compile it on ESP32-C3 * ESP32-C3: I2S_MODE_DAC_BUILT_IN / I2S_MODE_PDM not available On some ESP32 chips (e.g. ESP32-C3), builtin DAC is not possible as it lacks the hardware module. In order to be able to compile the library on ESP32-C3 the defines cannot be used.
This commit is contained in:
1 parent
617b06d09a
commit
2c1aeba4ab
4 files changed
+16
-4
No files matched your search
+13
-1
@@ -168,11 +168,19 @@ bool AudioOutputI2S::begin(bool txDAC)
|
||||
i2s_mode_t mode = (i2s_mode_t)(I2S_MODE_MASTER | I2S_MODE_TX);
|
||||
if (output_mode == INTERNAL_DAC)
|
||||
{
|
||||
#ifdef I2S_MODE_DAC_BUILT_IN
|
||||
mode = (i2s_mode_t)(mode | I2S_MODE_DAC_BUILT_IN);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
else if (output_mode == INTERNAL_PDM)
|
||||
if (output_mode == INTERNAL_PDM)
|
||||
{
|
||||
#ifdef I2S_MODE_PDM
|
||||
mode = (i2s_mode_t)(mode | I2S_MODE_PDM);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
i2s_comm_format_t comm_fmt = (i2s_comm_format_t)(I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB);
|
||||
@@ -199,8 +207,12 @@ bool AudioOutputI2S::begin(bool txDAC)
|
||||
}
|
||||
if (output_mode == INTERNAL_DAC || output_mode == INTERNAL_PDM)
|
||||
{
|
||||
#ifdef I2S_DAC_CHANNEL_BOTH_EN
|
||||
i2s_set_pin((i2s_port_t)portNo, NULL);
|
||||
i2s_set_dac_mode(I2S_DAC_CHANNEL_BOTH_EN);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user