Skip to content

Commit

Permalink
I2SDriverESP32V1 compile error for c3
Browse files Browse the repository at this point in the history
  • Loading branch information
pschatzmann committed Nov 24, 2024
1 parent 040c3bd commit b6c3025
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/AudioTools/CoreAudio/AudioI2S/I2SESP32V1.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,12 +319,6 @@ class I2SDriverESP32V1 {
(i2s_slot_mode_t)cfg.channels);
}

i2s_pdm_rx_slot_config_t getRxSlotConfig(I2SConfigESP32V1 &cfg) {
return I2S_PDM_RX_SLOT_DEFAULT_CONFIG(
(i2s_data_bit_width_t)cfg.bits_per_sample,
(i2s_slot_mode_t)cfg.channels);
}

i2s_chan_config_t getChannelConfig(I2SConfigESP32V1 &cfg) {
return I2S_CHANNEL_DEFAULT_CONFIG(
(i2s_port_t)cfg.port_no,
Expand All @@ -335,10 +329,6 @@ class I2SDriverESP32V1 {
return I2S_PDM_TX_CLK_DEFAULT_CONFIG((uint32_t)cfg.sample_rate);
}

i2s_pdm_rx_clk_config_t getRxClockConfig(I2SConfigESP32V1 &cfg) {
return I2S_PDM_RX_CLK_DEFAULT_CONFIG((uint32_t)cfg.sample_rate);
}

bool startTX(I2SConfigESP32V1 &cfg, i2s_chan_handle_t &tx_chan, int txPin) {
i2s_pdm_tx_config_t pdm_tx_cfg = {
.clk_cfg = getTxClockConfig(cfg),
Expand All @@ -365,6 +355,15 @@ class I2SDriverESP32V1 {
return true;
}

#if defined(USE_PDM_RX)
i2s_pdm_rx_slot_config_t getRxSlotConfig(I2SConfigESP32V1 &cfg) {
return I2S_PDM_RX_SLOT_DEFAULT_CONFIG(
(i2s_data_bit_width_t)cfg.bits_per_sample,
(i2s_slot_mode_t)cfg.channels);
}
i2s_pdm_rx_clk_config_t getRxClockConfig(I2SConfigESP32V1 &cfg) {
return I2S_PDM_RX_CLK_DEFAULT_CONFIG((uint32_t)cfg.sample_rate);
}
bool startRX(I2SConfigESP32V1 &cfg, i2s_chan_handle_t &rx_chan, int rxPin) {
i2s_pdm_rx_config_t pdm_rx_cfg = {
.clk_cfg = getRxClockConfig(cfg),
Expand All @@ -390,7 +389,12 @@ class I2SDriverESP32V1 {
}
return true;
}

#else
bool startRX(I2SConfigESP32V1 &cfg, i2s_chan_handle_t &rx_chan, int rxPin) {
LOGE("PDM RX not supported");
return false;
}
#endif
} pdm;

#endif
Expand Down

0 comments on commit b6c3025

Please sign in to comment.