Skip to content

Commit 8df96d3

Browse files
committed
esp32/machine_i2s.c: Fix deprecated fields and constants.
Signed-off-by: IhorNehrutsa <Ihor.Nehrutsa@gmail.com>
1 parent 6652fc8 commit 8df96d3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
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

0 commit comments

Comments
 (0)