mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-06 06:04:33 +02:00
i2s: fix the param check on PDM mode
Closes https://github.com/espressif/esp-idf/issues/7604
This commit is contained in:
@@ -1550,10 +1550,10 @@ static esp_err_t i2s_check_cfg_validity(i2s_port_t i2s_num, i2s_hal_config_t *cf
|
||||
if (cfg->mode & I2S_MODE_PDM) {
|
||||
ESP_RETURN_ON_FALSE(i2s_num == I2S_NUM_0, ESP_ERR_INVALID_ARG, TAG, "I2S PDM mode only support on I2S0");
|
||||
#if !SOC_I2S_SUPPORTS_PDM_TX
|
||||
ESP_RETURN_ON_FALSE(cfg->mode & I2S_MODE_TX, ESP_ERR_INVALID_ARG, TAG, "PDM does not support TX on this chip");
|
||||
ESP_RETURN_ON_FALSE(!(cfg->mode & I2S_MODE_TX), ESP_ERR_INVALID_ARG, TAG, "PDM does not support TX on this chip");
|
||||
#endif // SOC_I2S_SUPPORTS_PDM_TX
|
||||
#if !SOC_I2S_SUPPORTS_PDM_RX
|
||||
ESP_RETURN_ON_FALSE(cfg->mode & I2S_MODE_RX, ESP_ERR_INVALID_ARG, TAG, "PDM does not support RX on this chip");
|
||||
ESP_RETURN_ON_FALSE(!(cfg->mode & I2S_MODE_RX), ESP_ERR_INVALID_ARG, TAG, "PDM does not support RX on this chip");
|
||||
#endif // SOC_I2S_SUPPORTS_PDM_RX
|
||||
}
|
||||
#else
|
||||
|
Reference in New Issue
Block a user