Question
Why check only the 'hspi->hdmarx' in the 'HAL_SPI_TransmitReceive_DMA()' for STM32U5?
Hi,
For the SPI transfer APIs with suffix '_DMA'. In the transmit and receive alone ones, they checked 'hspi->hdmatx' and 'hspi->hdmarx' respectively. But in 'HAL_SPI_TransmitReceive_DMA()', it only check the 'hspi->hdmarx'. Funny :), and why?
/* Packing mode management is enabled by the DMA settings */
if (((hspi->Init.DataSize > SPI_DATASIZE_16BIT) && (hspi->hdmarx->Init.DestDataWidth != DMA_DEST_DATAWIDTH_WORD) && \
(IS_SPI_FULL_INSTANCE(hspi->Instance))) || \
((hspi->Init.DataSize > SPI_DATASIZE_8BIT) && (hspi->hdmarx->Init.DestDataWidth == DMA_DEST_DATAWIDTH_BYTE)))
{
/* Restriction the DMA data received is not allowed in this mode */
/* Unlock the process */
__HAL_UNLOCK(hspi);
return HAL_ERROR;
}
Thanks.
