mirror of
https://github.com/espressif/esp-idf
synced 2025-03-09 17:19:09 -04:00
fix(i2s): fixed incorrect buf size calculation
This commit is contained in:
parent
25a1ad7e98
commit
a47e157731
@ -417,7 +417,11 @@ err:
|
||||
uint32_t i2s_get_buf_size(i2s_chan_handle_t handle, uint32_t data_bit_width, uint32_t dma_frame_num)
|
||||
{
|
||||
uint32_t active_chan = handle->active_slot;
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
uint32_t bytes_per_sample = ((data_bit_width + 15) / 16) * 2;
|
||||
#else
|
||||
uint32_t bytes_per_sample = (data_bit_width + 7) / 8;
|
||||
#endif // CONFIG_IDF_TARGET_ESP32
|
||||
uint32_t bytes_per_frame = bytes_per_sample * active_chan;
|
||||
uint32_t bufsize = dma_frame_num * bytes_per_frame;
|
||||
#if SOC_CACHE_INTERNAL_MEM_VIA_L1CACHE
|
||||
|
Loading…
x
Reference in New Issue
Block a user