SPI HAL library bug (referencing RX side handle from TX only DMA)

This commit is contained in:
jflyper 2019-04-05 03:02:23 +09:00
parent 844683279a
commit 8670c05068
1 changed files with 4 additions and 4 deletions

View File

@ -1462,11 +1462,11 @@ HAL_StatusTypeDef HAL_SPI_Transmit_DMA(SPI_HandleTypeDef *hspi, uint8_t *pData,
} }
/* Packing mode management is enabled by the DMA settings */ /* Packing mode management is enabled by the DMA settings */
if (((hspi->Init.DataSize > SPI_DATASIZE_16BIT) && (hspi->hdmarx->Init.MemDataAlignment != DMA_MDATAALIGN_WORD)) || \ if (((hspi->Init.DataSize > SPI_DATASIZE_16BIT) && (hspi->hdmatx->Init.MemDataAlignment != DMA_MDATAALIGN_WORD)) || \
((hspi->Init.DataSize > SPI_DATASIZE_8BIT) && ((hspi->hdmarx->Init.MemDataAlignment != DMA_MDATAALIGN_HALFWORD) && \ ((hspi->Init.DataSize > SPI_DATASIZE_8BIT) && ((hspi->hdmatx->Init.MemDataAlignment != DMA_MDATAALIGN_HALFWORD) && \
(hspi->hdmarx->Init.MemDataAlignment != DMA_MDATAALIGN_WORD)))) (hspi->hdmatx->Init.MemDataAlignment != DMA_MDATAALIGN_WORD))))
{ {
/* Restriction the DMA data received is not allowed in this mode */ /* Restriction the DMA data transmission is not allowed in this mode */
errorcode = HAL_ERROR; errorcode = HAL_ERROR;
__HAL_UNLOCK(hspi); __HAL_UNLOCK(hspi);
return errorcode; return errorcode;