From 8608f9367fc29e498f42f5249aa248dd2044d567 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Tue, 26 Sep 2023 17:23:34 +1000 Subject: Tune buffer sizes and locations for I2S --- src/drivers/i2s_dac.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/drivers/i2s_dac.cpp') diff --git a/src/drivers/i2s_dac.cpp b/src/drivers/i2s_dac.cpp index 2fdd826f..b28a8ee1 100644 --- a/src/drivers/i2s_dac.cpp +++ b/src/drivers/i2s_dac.cpp @@ -41,8 +41,13 @@ static const i2s_port_t kI2SPort = I2S_NUM_0; auto I2SDac::create(IGpios& expander) -> std::optional { i2s_chan_handle_t i2s_handle; - i2s_chan_config_t channel_config = - I2S_CHANNEL_DEFAULT_CONFIG(kI2SPort, I2S_ROLE_MASTER); + i2s_chan_config_t channel_config{ + .id = kI2SPort, + .role = I2S_ROLE_MASTER, + .dma_desc_num = 2, + .dma_frame_num = kI2SBufferLengthFrames, + .auto_clear = false, + }; ESP_ERROR_CHECK(i2s_new_channel(&channel_config, &i2s_handle, NULL)); // -- cgit v1.2.3