drivers: i2s: esp32 fix warnings and errors due to variable declarations
Fixes warnings and errors due to misplacement of variable declarations Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
This commit is contained in:
parent
9416ef2684
commit
a5d69a5b63
1 changed files with 10 additions and 4 deletions
|
@ -605,11 +605,14 @@ int i2s_esp32_config_dma(const struct device *dev, enum i2s_dir dir,
|
||||||
static int i2s_esp32_start_dma(const struct device *dev, enum i2s_dir dir)
|
static int i2s_esp32_start_dma(const struct device *dev, enum i2s_dir dir)
|
||||||
{
|
{
|
||||||
const struct i2s_esp32_cfg *dev_cfg = dev->config;
|
const struct i2s_esp32_cfg *dev_cfg = dev->config;
|
||||||
const i2s_hal_context_t *hal = &(dev_cfg->hal);
|
|
||||||
const struct i2s_esp32_stream *stream = NULL;
|
const struct i2s_esp32_stream *stream = NULL;
|
||||||
unsigned int key;
|
unsigned int key;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
|
#if !SOC_GDMA_SUPPORTED || I2S_ESP32_IS_DIR_EN(rx)
|
||||||
|
const i2s_hal_context_t *hal = &(dev_cfg->hal);
|
||||||
|
#endif /* SOC_GDMA_SUPPORTED || I2S_ESP32_IS_DIR_EN(rx) */
|
||||||
|
|
||||||
if (dir == I2S_DIR_RX) {
|
if (dir == I2S_DIR_RX) {
|
||||||
stream = &dev_cfg->rx;
|
stream = &dev_cfg->rx;
|
||||||
} else if (dir == I2S_DIR_TX) {
|
} else if (dir == I2S_DIR_TX) {
|
||||||
|
@ -662,6 +665,7 @@ static int i2s_esp32_start_dma(const struct device *dev, enum i2s_dir dir)
|
||||||
i2s_hal_rx_enable_dma(hal);
|
i2s_hal_rx_enable_dma(hal);
|
||||||
i2s_hal_rx_enable_intr(hal);
|
i2s_hal_rx_enable_intr(hal);
|
||||||
i2s_hal_rx_start_link(hal, (uint32_t)&(stream->conf->dma_desc[0]));
|
i2s_hal_rx_start_link(hal, (uint32_t)&(stream->conf->dma_desc[0]));
|
||||||
|
}
|
||||||
#endif /* I2S_ESP32_IS_DIR_EN(rx) */
|
#endif /* I2S_ESP32_IS_DIR_EN(rx) */
|
||||||
|
|
||||||
#if I2S_ESP32_IS_DIR_EN(tx)
|
#if I2S_ESP32_IS_DIR_EN(tx)
|
||||||
|
@ -681,10 +685,13 @@ unlock:
|
||||||
static int i2s_esp32_restart_dma(const struct device *dev, enum i2s_dir dir)
|
static int i2s_esp32_restart_dma(const struct device *dev, enum i2s_dir dir)
|
||||||
{
|
{
|
||||||
const struct i2s_esp32_cfg *dev_cfg = dev->config;
|
const struct i2s_esp32_cfg *dev_cfg = dev->config;
|
||||||
const i2s_hal_context_t *hal = &(dev_cfg->hal);
|
|
||||||
const struct i2s_esp32_stream *stream;
|
const struct i2s_esp32_stream *stream;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
|
#if !SOC_GDMA_SUPPORTED || I2S_ESP32_IS_DIR_EN(rx)
|
||||||
|
const i2s_hal_context_t *hal = &(dev_cfg->hal);
|
||||||
|
#endif /* SOC_GDMA_SUPPORTED || I2S_ESP32_IS_DIR_EN(rx) */
|
||||||
|
|
||||||
if (dir == I2S_DIR_RX) {
|
if (dir == I2S_DIR_RX) {
|
||||||
stream = &dev_cfg->rx;
|
stream = &dev_cfg->rx;
|
||||||
} else if (dir == I2S_DIR_TX) {
|
} else if (dir == I2S_DIR_TX) {
|
||||||
|
@ -695,11 +702,10 @@ static int i2s_esp32_restart_dma(const struct device *dev, enum i2s_dir dir)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SOC_GDMA_SUPPORTED
|
#if SOC_GDMA_SUPPORTED
|
||||||
|
uint16_t chunk_len;
|
||||||
void *src = NULL, *dst = NULL;
|
void *src = NULL, *dst = NULL;
|
||||||
|
|
||||||
#if I2S_ESP32_IS_DIR_EN(rx)
|
#if I2S_ESP32_IS_DIR_EN(rx)
|
||||||
uint16_t chunk_len;
|
|
||||||
|
|
||||||
if (dir == I2S_DIR_RX) {
|
if (dir == I2S_DIR_RX) {
|
||||||
dst = stream->data->mem_block;
|
dst = stream->data->mem_block;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue