Skip to content

Commit 3069fee

Browse files
IhorNehrutsadpgeorge
authored andcommitted
esp32/machine_i2s: Fix deprecated fields and constants.
Signed-off-by: IhorNehrutsa <[email protected]>
1 parent a427117 commit 3069fee

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ports/esp32/machine_i2s.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,22 +354,22 @@ STATIC void mp_machine_i2s_init_helper(machine_i2s_obj_t *self, mp_arg_val_t *ar
354354
self->io_mode = BLOCKING;
355355

356356
i2s_config_t i2s_config;
357-
i2s_config.communication_format = I2S_COMM_FORMAT_I2S;
357+
i2s_config.communication_format = I2S_COMM_FORMAT_STAND_I2S;
358358
i2s_config.mode = mode;
359359
i2s_config.bits_per_sample = get_dma_bits(mode, bits);
360360
i2s_config.channel_format = get_dma_format(mode, format);
361361
i2s_config.sample_rate = self->rate;
362362
i2s_config.intr_alloc_flags = ESP_INTR_FLAG_LOWMED;
363-
i2s_config.dma_buf_count = get_dma_buf_count(mode, bits, format, self->ibuf);
364-
i2s_config.dma_buf_len = DMA_BUF_LEN_IN_I2S_FRAMES;
363+
i2s_config.dma_desc_num = get_dma_buf_count(mode, bits, format, self->ibuf);
364+
i2s_config.dma_frame_num = DMA_BUF_LEN_IN_I2S_FRAMES;
365365
i2s_config.use_apll = false;
366366
i2s_config.tx_desc_auto_clear = true;
367367
i2s_config.fixed_mclk = 0;
368368
i2s_config.mclk_multiple = I2S_MCLK_MULTIPLE_256;
369369
i2s_config.bits_per_chan = 0;
370370

371371
// I2S queue size equals the number of DMA buffers
372-
check_esp_err(i2s_driver_install(self->i2s_id, &i2s_config, i2s_config.dma_buf_count, &self->i2s_event_queue));
372+
check_esp_err(i2s_driver_install(self->i2s_id, &i2s_config, i2s_config.dma_desc_num, &self->i2s_event_queue));
373373

374374
// apply low-level workaround for bug in some ESP-IDF versions that swap
375375
// the left and right channels

ports/esp32/mpconfigport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
#define MICROPY_PY_MACHINE_DAC (SOC_DAC_SUPPORTED)
127127
#endif
128128
#ifndef MICROPY_PY_MACHINE_I2S
129-
#define MICROPY_PY_MACHINE_I2S (1)
129+
#define MICROPY_PY_MACHINE_I2S (SOC_I2S_SUPPORTED)
130130
#endif
131131
#define MICROPY_PY_MACHINE_I2S_INCLUDEFILE "ports/esp32/machine_i2s.c"
132132
#define MICROPY_PY_MACHINE_I2S_FINALISER (1)

0 commit comments

Comments
 (0)