forked from Imagelibrary/rtems
bsps/arm/stm32h7/hal/*: Fix pointer and integer comparison warnings
The HAL code would compare to "0U" instead of NULL. Updates &20
This commit is contained in:
committed by
Kinsey Moore
parent
64070bdf66
commit
ae5655b88b
@@ -543,7 +543,11 @@ HAL_StatusTypeDef HAL_DMA_DeInit(DMA_HandleTypeDef *hdma)
|
|||||||
DMAmuxChannel, DMAmuxChannelStatus and DMAmuxChannelStatusMask */
|
DMAmuxChannel, DMAmuxChannelStatus and DMAmuxChannelStatusMask */
|
||||||
DMA_CalcDMAMUXChannelBaseAndMask(hdma);
|
DMA_CalcDMAMUXChannelBaseAndMask(hdma);
|
||||||
|
|
||||||
|
#if defined(__rtems__)
|
||||||
|
if(hdma->DMAmuxChannel != NULL)
|
||||||
|
#else
|
||||||
if(hdma->DMAmuxChannel != 0U)
|
if(hdma->DMAmuxChannel != 0U)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
/* Resett he DMAMUX channel that corresponds to the DMA stream */
|
/* Resett he DMAMUX channel that corresponds to the DMA stream */
|
||||||
hdma->DMAmuxChannel->CCR = 0U;
|
hdma->DMAmuxChannel->CCR = 0U;
|
||||||
@@ -741,7 +745,11 @@ HAL_StatusTypeDef HAL_DMA_Start_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress,
|
|||||||
hdma->DMAmuxChannel->CCR |= DMAMUX_CxCR_SOIE;
|
hdma->DMAmuxChannel->CCR |= DMAMUX_CxCR_SOIE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__rtems__)
|
||||||
|
if(hdma->DMAmuxRequestGen != NULL)
|
||||||
|
#else
|
||||||
if(hdma->DMAmuxRequestGen != 0U)
|
if(hdma->DMAmuxRequestGen != 0U)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
/* if using DMAMUX request generator, enable the DMAMUX request generator overrun IT*/
|
/* if using DMAMUX request generator, enable the DMAMUX request generator overrun IT*/
|
||||||
/* enable the request gen overrun IT */
|
/* enable the request gen overrun IT */
|
||||||
@@ -868,7 +876,11 @@ HAL_StatusTypeDef HAL_DMA_Abort(DMA_HandleTypeDef *hdma)
|
|||||||
/* Clear the DMAMUX synchro overrun flag */
|
/* Clear the DMAMUX synchro overrun flag */
|
||||||
hdma->DMAmuxChannelStatus->CFR = hdma->DMAmuxChannelStatusMask;
|
hdma->DMAmuxChannelStatus->CFR = hdma->DMAmuxChannelStatusMask;
|
||||||
|
|
||||||
|
#if defined(__rtems__)
|
||||||
|
if(hdma->DMAmuxRequestGen != NULL)
|
||||||
|
#else
|
||||||
if(hdma->DMAmuxRequestGen != 0U)
|
if(hdma->DMAmuxRequestGen != 0U)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
/* if using DMAMUX request generator, disable the DMAMUX request generator overrun IT */
|
/* if using DMAMUX request generator, disable the DMAMUX request generator overrun IT */
|
||||||
/* disable the request gen overrun IT */
|
/* disable the request gen overrun IT */
|
||||||
@@ -940,7 +952,11 @@ HAL_StatusTypeDef HAL_DMA_Abort_IT(DMA_HandleTypeDef *hdma)
|
|||||||
/* Clear the DMAMUX synchro overrun flag */
|
/* Clear the DMAMUX synchro overrun flag */
|
||||||
hdma->DMAmuxChannelStatus->CFR = hdma->DMAmuxChannelStatusMask;
|
hdma->DMAmuxChannelStatus->CFR = hdma->DMAmuxChannelStatusMask;
|
||||||
|
|
||||||
|
#if defined(__rtems__)
|
||||||
|
if(hdma->DMAmuxRequestGen != NULL)
|
||||||
|
#else
|
||||||
if(hdma->DMAmuxRequestGen != 0U)
|
if(hdma->DMAmuxRequestGen != 0U)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
/* if using DMAMUX request generator, disable the DMAMUX request generator overrun IT*/
|
/* if using DMAMUX request generator, disable the DMAMUX request generator overrun IT*/
|
||||||
/* disable the request gen overrun IT */
|
/* disable the request gen overrun IT */
|
||||||
@@ -1140,7 +1156,11 @@ HAL_StatusTypeDef HAL_DMA_PollForTransfer(DMA_HandleTypeDef *hdma, HAL_DMA_Level
|
|||||||
if(IS_DMA_DMAMUX_ALL_INSTANCE(hdma->Instance) != 0U) /* No DMAMUX available for BDMA1 */
|
if(IS_DMA_DMAMUX_ALL_INSTANCE(hdma->Instance) != 0U) /* No DMAMUX available for BDMA1 */
|
||||||
{
|
{
|
||||||
/* Check for DMAMUX Request generator (if used) overrun status */
|
/* Check for DMAMUX Request generator (if used) overrun status */
|
||||||
|
#if defined(__rtems__)
|
||||||
|
if(hdma->DMAmuxRequestGen != NULL)
|
||||||
|
#else
|
||||||
if(hdma->DMAmuxRequestGen != 0U)
|
if(hdma->DMAmuxRequestGen != 0U)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
/* if using DMAMUX request generator Check for DMAMUX request generator overrun */
|
/* if using DMAMUX request generator Check for DMAMUX request generator overrun */
|
||||||
if((hdma->DMAmuxRequestGenStatus->RGSR & hdma->DMAmuxRequestGenStatusMask) != 0U)
|
if((hdma->DMAmuxRequestGenStatus->RGSR & hdma->DMAmuxRequestGenStatusMask) != 0U)
|
||||||
@@ -1782,7 +1802,11 @@ static void DMA_SetConfig(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t
|
|||||||
/* Clear the DMAMUX synchro overrun flag */
|
/* Clear the DMAMUX synchro overrun flag */
|
||||||
hdma->DMAmuxChannelStatus->CFR = hdma->DMAmuxChannelStatusMask;
|
hdma->DMAmuxChannelStatus->CFR = hdma->DMAmuxChannelStatusMask;
|
||||||
|
|
||||||
|
#if defined(__rtems__)
|
||||||
|
if(hdma->DMAmuxRequestGen != NULL)
|
||||||
|
#else
|
||||||
if(hdma->DMAmuxRequestGen != 0U)
|
if(hdma->DMAmuxRequestGen != 0U)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
/* Clear the DMAMUX request generator overrun flag */
|
/* Clear the DMAMUX request generator overrun flag */
|
||||||
hdma->DMAmuxRequestGenStatus->RGCFR = hdma->DMAmuxRequestGenStatusMask;
|
hdma->DMAmuxRequestGenStatus->RGCFR = hdma->DMAmuxRequestGenStatusMask;
|
||||||
|
|||||||
@@ -183,7 +183,11 @@ HAL_StatusTypeDef HAL_DMAEx_MultiBufferStart(DMA_HandleTypeDef *hdma, uint32_t S
|
|||||||
/* Clear the DMAMUX synchro overrun flag */
|
/* Clear the DMAMUX synchro overrun flag */
|
||||||
hdma->DMAmuxChannelStatus->CFR = hdma->DMAmuxChannelStatusMask;
|
hdma->DMAmuxChannelStatus->CFR = hdma->DMAmuxChannelStatusMask;
|
||||||
|
|
||||||
|
#if defined(__rtems__)
|
||||||
|
if(hdma->DMAmuxRequestGen != NULL)
|
||||||
|
#else
|
||||||
if(hdma->DMAmuxRequestGen != 0U)
|
if(hdma->DMAmuxRequestGen != 0U)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
/* Clear the DMAMUX request generator overrun flag */
|
/* Clear the DMAMUX request generator overrun flag */
|
||||||
hdma->DMAmuxRequestGenStatus->RGCFR = hdma->DMAmuxRequestGenStatusMask;
|
hdma->DMAmuxRequestGenStatus->RGCFR = hdma->DMAmuxRequestGenStatusMask;
|
||||||
@@ -279,7 +283,11 @@ HAL_StatusTypeDef HAL_DMAEx_MultiBufferStart_IT(DMA_HandleTypeDef *hdma, uint32_
|
|||||||
/* Clear the DMAMUX synchro overrun flag */
|
/* Clear the DMAMUX synchro overrun flag */
|
||||||
hdma->DMAmuxChannelStatus->CFR = hdma->DMAmuxChannelStatusMask;
|
hdma->DMAmuxChannelStatus->CFR = hdma->DMAmuxChannelStatusMask;
|
||||||
|
|
||||||
|
#if defined(__rtems__)
|
||||||
|
if(hdma->DMAmuxRequestGen != NULL)
|
||||||
|
#else
|
||||||
if(hdma->DMAmuxRequestGen != 0U)
|
if(hdma->DMAmuxRequestGen != 0U)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
/* Clear the DMAMUX request generator overrun flag */
|
/* Clear the DMAMUX request generator overrun flag */
|
||||||
hdma->DMAmuxRequestGenStatus->RGCFR = hdma->DMAmuxRequestGenStatusMask;
|
hdma->DMAmuxRequestGenStatus->RGCFR = hdma->DMAmuxRequestGenStatusMask;
|
||||||
@@ -319,7 +327,11 @@ HAL_StatusTypeDef HAL_DMAEx_MultiBufferStart_IT(DMA_HandleTypeDef *hdma, uint32_
|
|||||||
hdma->DMAmuxChannel->CCR |= DMAMUX_CxCR_SOIE;
|
hdma->DMAmuxChannel->CCR |= DMAMUX_CxCR_SOIE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__rtems__)
|
||||||
|
if(hdma->DMAmuxRequestGen != NULL)
|
||||||
|
#else
|
||||||
if(hdma->DMAmuxRequestGen != 0U)
|
if(hdma->DMAmuxRequestGen != 0U)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
/* if using DMAMUX request generator, enable the DMAMUX request generator overrun IT*/
|
/* if using DMAMUX request generator, enable the DMAMUX request generator overrun IT*/
|
||||||
/* enable the request gen overrun IT*/
|
/* enable the request gen overrun IT*/
|
||||||
@@ -486,7 +498,11 @@ HAL_StatusTypeDef HAL_DMAEx_ConfigMuxRequestGenerator (DMA_HandleTypeDef *hdma,
|
|||||||
/* check if the DMA state is ready
|
/* check if the DMA state is ready
|
||||||
and DMA is using a DMAMUX request generator block
|
and DMA is using a DMAMUX request generator block
|
||||||
*/
|
*/
|
||||||
|
#if defined(__rtems__)
|
||||||
|
if(hdma->DMAmuxRequestGen == NULL)
|
||||||
|
#else
|
||||||
if(hdma->DMAmuxRequestGen == 0U)
|
if(hdma->DMAmuxRequestGen == 0U)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
/* Set the error code to busy */
|
/* Set the error code to busy */
|
||||||
hdma->ErrorCode = HAL_DMA_ERROR_PARAM;
|
hdma->ErrorCode = HAL_DMA_ERROR_PARAM;
|
||||||
@@ -535,7 +551,11 @@ HAL_StatusTypeDef HAL_DMAEx_EnableMuxRequestGenerator (DMA_HandleTypeDef *hdma)
|
|||||||
|
|
||||||
/* check if the DMA state is ready
|
/* check if the DMA state is ready
|
||||||
and DMA is using a DMAMUX request generator block */
|
and DMA is using a DMAMUX request generator block */
|
||||||
|
#if defined(__rtems__)
|
||||||
|
if((hdma->State != HAL_DMA_STATE_RESET) && (hdma->DMAmuxRequestGen != NULL))
|
||||||
|
#else
|
||||||
if((hdma->State != HAL_DMA_STATE_RESET) && (hdma->DMAmuxRequestGen != 0U))
|
if((hdma->State != HAL_DMA_STATE_RESET) && (hdma->DMAmuxRequestGen != 0U))
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
/* Enable the request generator*/
|
/* Enable the request generator*/
|
||||||
hdma->DMAmuxRequestGen->RGCR |= DMAMUX_RGxCR_GE;
|
hdma->DMAmuxRequestGen->RGCR |= DMAMUX_RGxCR_GE;
|
||||||
@@ -561,7 +581,11 @@ HAL_StatusTypeDef HAL_DMAEx_DisableMuxRequestGenerator (DMA_HandleTypeDef *hdma)
|
|||||||
|
|
||||||
/* check if the DMA state is ready
|
/* check if the DMA state is ready
|
||||||
and DMA is using a DMAMUX request generator block */
|
and DMA is using a DMAMUX request generator block */
|
||||||
|
#if defined(__rtems__)
|
||||||
|
if((hdma->State != HAL_DMA_STATE_RESET) && (hdma->DMAmuxRequestGen != NULL))
|
||||||
|
#else
|
||||||
if((hdma->State != HAL_DMA_STATE_RESET) && (hdma->DMAmuxRequestGen != 0U))
|
if((hdma->State != HAL_DMA_STATE_RESET) && (hdma->DMAmuxRequestGen != 0U))
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
/* Disable the request generator*/
|
/* Disable the request generator*/
|
||||||
hdma->DMAmuxRequestGen->RGCR &= ~DMAMUX_RGxCR_GE;
|
hdma->DMAmuxRequestGen->RGCR &= ~DMAMUX_RGxCR_GE;
|
||||||
|
|||||||
Reference in New Issue
Block a user