fix(esp_driver_parlio): fix warnings found by GNU static analyzer

This commit is contained in:
Alexey Lapshin
2024-06-17 23:06:30 +07:00
committed by BOT
parent f328e06ed4
commit 75277a9419

View File

@@ -389,10 +389,12 @@ static void IRAM_ATTR parlio_tx_mount_dma_data(parlio_tx_unit_t *tx_unit, const
{
size_t prepared_length = 0;
uint8_t *data = (uint8_t *)buffer;
uint32_t mount_bytes = 0;
parlio_dma_desc_t *desc_nc = tx_unit->dma_nodes_nc;
while (len) {
uint32_t mount_bytes = len > DMA_DESCRIPTOR_BUFFER_MAX_SIZE ? DMA_DESCRIPTOR_BUFFER_MAX_SIZE : len;
assert(desc_nc);
mount_bytes = len > DMA_DESCRIPTOR_BUFFER_MAX_SIZE ? DMA_DESCRIPTOR_BUFFER_MAX_SIZE : len;
len -= mount_bytes;
desc_nc->dw0.suc_eof = (len == 0); // whether the last frame
desc_nc->dw0.size = mount_bytes;