contrib: Re-apply changes

This includes changes from commits:

b714e4a809
ae5655b88b
b3be636863
6dee307542
This commit is contained in:
Amar Takhar
2025-07-13 21:56:25 -04:00
committed by Chris Johns
parent 4b43113eec
commit 7f87cbfe8e
4 changed files with 55 additions and 1 deletions

View File

@@ -389,7 +389,7 @@ extern "C" {
#if defined (STM32H742xx) || defined (STM32H743xx) || defined (STM32H753xx)
#define TEMPSENSOR_CAL2_TEMP ((((DBGMCU->IDCODE) >> 16) <= ((uint32_t)0x1003)) ? 110L : 130L) /* Internal temperature sensor ,
temperature at which temperature sensor has been calibrated in production for data into TEMPSENSOR_CAL2_ADDR
110 °C for revision Y and 130 °C for revision V (tolerance: +-5 DegC) (unit: DegC). */
110 DegC for revision Y and 130 DegC for revision V (tolerance: +-5 DegC) (unit: DegC). */
#else
#define TEMPSENSOR_CAL2_TEMP (110L) /* Internal temperature sensor, temperature at which temperature sensor has been
calibrated in production for data into TEMPSENSOR_CAL2_ADDR (tolerance: +-5 DegC) (unit: DegC). */

View File

@@ -542,7 +542,11 @@ HAL_StatusTypeDef HAL_DMA_DeInit(DMA_HandleTypeDef *hdma)
DMAmuxChannel, DMAmuxChannelStatus and DMAmuxChannelStatusMask */
DMA_CalcDMAMUXChannelBaseAndMask(hdma);
#if defined(__rtems__)
if(hdma->DMAmuxChannel != NULL)
#else
if(hdma->DMAmuxChannel != 0U)
#endif
{
/* Resett he DMAMUX channel that corresponds to the DMA stream */
hdma->DMAmuxChannel->CCR = 0U;
@@ -740,7 +744,11 @@ HAL_StatusTypeDef HAL_DMA_Start_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress,
hdma->DMAmuxChannel->CCR |= DMAMUX_CxCR_SOIE;
}
#if defined(__rtems__)
if(hdma->DMAmuxRequestGen != NULL)
#else
if(hdma->DMAmuxRequestGen != 0U)
#endif
{
/* if using DMAMUX request generator, enable the DMAMUX request generator overrun IT*/
/* enable the request gen overrun IT */
@@ -867,7 +875,11 @@ HAL_StatusTypeDef HAL_DMA_Abort(DMA_HandleTypeDef *hdma)
/* Clear the DMAMUX synchro overrun flag */
hdma->DMAmuxChannelStatus->CFR = hdma->DMAmuxChannelStatusMask;
#if defined(__rtems__)
if(hdma->DMAmuxRequestGen != NULL)
#else
if(hdma->DMAmuxRequestGen != 0U)
#endif
{
/* if using DMAMUX request generator, disable the DMAMUX request generator overrun IT */
/* disable the request gen overrun IT */
@@ -939,7 +951,11 @@ HAL_StatusTypeDef HAL_DMA_Abort_IT(DMA_HandleTypeDef *hdma)
/* Clear the DMAMUX synchro overrun flag */
hdma->DMAmuxChannelStatus->CFR = hdma->DMAmuxChannelStatusMask;
#if defined(__rtems__)
if(hdma->DMAmuxRequestGen != NULL)
#else
if(hdma->DMAmuxRequestGen != 0U)
#endif
{
/* if using DMAMUX request generator, disable the DMAMUX request generator overrun IT*/
/* disable the request gen overrun IT */
@@ -1139,7 +1155,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 */
{
/* Check for DMAMUX Request generator (if used) overrun status */
#if defined(__rtems__)
if(hdma->DMAmuxRequestGen != NULL)
#else
if(hdma->DMAmuxRequestGen != 0U)
#endif
{
/* if using DMAMUX request generator Check for DMAMUX request generator overrun */
if((hdma->DMAmuxRequestGenStatus->RGSR & hdma->DMAmuxRequestGenStatusMask) != 0U)
@@ -1781,7 +1801,11 @@ static void DMA_SetConfig(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t
/* Clear the DMAMUX synchro overrun flag */
hdma->DMAmuxChannelStatus->CFR = hdma->DMAmuxChannelStatusMask;
#if defined(__rtems__)
if(hdma->DMAmuxRequestGen != NULL)
#else
if(hdma->DMAmuxRequestGen != 0U)
#endif
{
/* Clear the DMAMUX request generator overrun flag */
hdma->DMAmuxRequestGenStatus->RGCFR = hdma->DMAmuxRequestGenStatusMask;

View File

@@ -182,7 +182,11 @@ HAL_StatusTypeDef HAL_DMAEx_MultiBufferStart(DMA_HandleTypeDef *hdma, uint32_t S
/* Clear the DMAMUX synchro overrun flag */
hdma->DMAmuxChannelStatus->CFR = hdma->DMAmuxChannelStatusMask;
#if defined(__rtems__)
if(hdma->DMAmuxRequestGen != NULL)
#else
if(hdma->DMAmuxRequestGen != 0U)
#endif
{
/* Clear the DMAMUX request generator overrun flag */
hdma->DMAmuxRequestGenStatus->RGCFR = hdma->DMAmuxRequestGenStatusMask;
@@ -278,7 +282,11 @@ HAL_StatusTypeDef HAL_DMAEx_MultiBufferStart_IT(DMA_HandleTypeDef *hdma, uint32_
/* Clear the DMAMUX synchro overrun flag */
hdma->DMAmuxChannelStatus->CFR = hdma->DMAmuxChannelStatusMask;
#if defined(__rtems__)
if(hdma->DMAmuxRequestGen != NULL)
#else
if(hdma->DMAmuxRequestGen != 0U)
#endif
{
/* Clear the DMAMUX request generator overrun flag */
hdma->DMAmuxRequestGenStatus->RGCFR = hdma->DMAmuxRequestGenStatusMask;
@@ -318,7 +326,11 @@ HAL_StatusTypeDef HAL_DMAEx_MultiBufferStart_IT(DMA_HandleTypeDef *hdma, uint32_
hdma->DMAmuxChannel->CCR |= DMAMUX_CxCR_SOIE;
}
#if defined(__rtems__)
if(hdma->DMAmuxRequestGen != NULL)
#else
if(hdma->DMAmuxRequestGen != 0U)
#endif
{
/* if using DMAMUX request generator, enable the DMAMUX request generator overrun IT*/
/* enable the request gen overrun IT*/
@@ -485,7 +497,11 @@ HAL_StatusTypeDef HAL_DMAEx_ConfigMuxRequestGenerator (DMA_HandleTypeDef *hdma,
/* check if the DMA state is ready
and DMA is using a DMAMUX request generator block
*/
#if defined(__rtems__)
if(hdma->DMAmuxRequestGen == NULL)
#else
if(hdma->DMAmuxRequestGen == 0U)
#endif
{
/* Set the error code to busy */
hdma->ErrorCode = HAL_DMA_ERROR_PARAM;
@@ -534,7 +550,11 @@ HAL_StatusTypeDef HAL_DMAEx_EnableMuxRequestGenerator (DMA_HandleTypeDef *hdma)
/* check if the DMA state is ready
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))
#endif
{
/* Enable the request generator*/
hdma->DMAmuxRequestGen->RGCR |= DMAMUX_RGxCR_GE;
@@ -560,7 +580,11 @@ HAL_StatusTypeDef HAL_DMAEx_DisableMuxRequestGenerator (DMA_HandleTypeDef *hdma)
/* check if the DMA state is ready
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))
#endif
{
/* Disable the request generator*/
hdma->DMAmuxRequestGen->RGCR &= ~DMAMUX_RGxCR_GE;

View File

@@ -524,6 +524,7 @@ HAL_StatusTypeDef HAL_SPI_DeInit(SPI_HandleTypeDef *hspi)
return HAL_OK;
}
#ifndef __rtems__
/**
* @brief Initialize the SPI MSP.
* @param hspi: pointer to a SPI_HandleTypeDef structure that contains
@@ -539,6 +540,7 @@ __weak void HAL_SPI_MspInit(SPI_HandleTypeDef *hspi)
the HAL_SPI_MspInit should be implemented in the user file
*/
}
#endif
/**
* @brief De-Initialize the SPI MSP.
@@ -3130,6 +3132,7 @@ void HAL_SPI_IRQHandler(SPI_HandleTypeDef *hspi)
}
}
#ifndef __rtems__
/**
* @brief Tx Transfer completed callback.
* @param hspi: pointer to a SPI_HandleTypeDef structure that contains
@@ -3177,6 +3180,7 @@ __weak void HAL_SPI_TxRxCpltCallback(SPI_HandleTypeDef *hspi) /* Derogation MISR
the HAL_SPI_TxRxCpltCallback should be implemented in the user file
*/
}
#endif
/**
* @brief Tx Half Transfer completed callback.
@@ -3226,6 +3230,7 @@ __weak void HAL_SPI_TxRxHalfCpltCallback(SPI_HandleTypeDef *hspi) /* Derogation
*/
}
#ifndef __rtems__
/**
* @brief SPI error callback.
* @param hspi: pointer to a SPI_HandleTypeDef structure that contains
@@ -3244,6 +3249,7 @@ __weak void HAL_SPI_ErrorCallback(SPI_HandleTypeDef *hspi) /* Derogation MISRAC2
and user can use HAL_SPI_GetError() API to check the latest error occurred
*/
}
#endif
/**
* @brief SPI Abort Complete callback.