Use AzureRTOS ThreadX
This commit is contained in:
@ -463,6 +463,8 @@ __weak void HAL_IRDA_MspDeInit(IRDA_HandleTypeDef *hirda)
|
||||
/**
|
||||
* @brief Register a User IRDA Callback
|
||||
* To be used instead of the weak predefined callback
|
||||
* @note The HAL_IRDA_RegisterCallback() may be called before HAL_IRDA_Init() in HAL_IRDA_STATE_RESET
|
||||
* to register callbacks for HAL_IRDA_MSPINIT_CB_ID and HAL_IRDA_MSPDEINIT_CB_ID
|
||||
* @param hirda irda handle
|
||||
* @param CallbackID ID of the callback to be registered
|
||||
* This parameter can be one of the following values:
|
||||
@ -491,8 +493,6 @@ HAL_StatusTypeDef HAL_IRDA_RegisterCallback(IRDA_HandleTypeDef *hirda, HAL_IRDA_
|
||||
|
||||
return HAL_ERROR;
|
||||
}
|
||||
/* Process locked */
|
||||
__HAL_LOCK(hirda);
|
||||
|
||||
if (hirda->gState == HAL_IRDA_STATE_READY)
|
||||
{
|
||||
@ -577,15 +577,14 @@ HAL_StatusTypeDef HAL_IRDA_RegisterCallback(IRDA_HandleTypeDef *hirda, HAL_IRDA_
|
||||
status = HAL_ERROR;
|
||||
}
|
||||
|
||||
/* Release Lock */
|
||||
__HAL_UNLOCK(hirda);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Unregister an IRDA callback
|
||||
* IRDA callback is redirected to the weak predefined callback
|
||||
* @note The HAL_IRDA_UnRegisterCallback() may be called before HAL_IRDA_Init() in HAL_IRDA_STATE_RESET
|
||||
* to un-register callbacks for HAL_IRDA_MSPINIT_CB_ID and HAL_IRDA_MSPDEINIT_CB_ID
|
||||
* @param hirda irda handle
|
||||
* @param CallbackID ID of the callback to be unregistered
|
||||
* This parameter can be one of the following values:
|
||||
@ -605,9 +604,6 @@ HAL_StatusTypeDef HAL_IRDA_UnRegisterCallback(IRDA_HandleTypeDef *hirda, HAL_IRD
|
||||
{
|
||||
HAL_StatusTypeDef status = HAL_OK;
|
||||
|
||||
/* Process locked */
|
||||
__HAL_LOCK(hirda);
|
||||
|
||||
if (HAL_IRDA_STATE_READY == hirda->gState)
|
||||
{
|
||||
switch (CallbackID)
|
||||
@ -693,9 +689,6 @@ HAL_StatusTypeDef HAL_IRDA_UnRegisterCallback(IRDA_HandleTypeDef *hirda, HAL_IRD
|
||||
status = HAL_ERROR;
|
||||
}
|
||||
|
||||
/* Release Lock */
|
||||
__HAL_UNLOCK(hirda);
|
||||
|
||||
return status;
|
||||
}
|
||||
#endif /* USE_HAL_IRDA_REGISTER_CALLBACKS */
|
||||
@ -1299,7 +1292,7 @@ HAL_StatusTypeDef HAL_IRDA_DMAResume(IRDA_HandleTypeDef *hirda)
|
||||
|
||||
/* Re-enable PE and ERR (Frame error, noise error, overrun error) interrupts */
|
||||
if (hirda->Init.Parity != IRDA_PARITY_NONE)
|
||||
{
|
||||
{
|
||||
SET_BIT(hirda->Instance->CR1, USART_CR1_PEIE);
|
||||
}
|
||||
SET_BIT(hirda->Instance->CR3, USART_CR3_EIE);
|
||||
@ -2192,7 +2185,7 @@ __weak void HAL_IRDA_AbortReceiveCpltCallback(IRDA_HandleTypeDef *hirda)
|
||||
* the configuration information for the specified IRDA module.
|
||||
* @retval HAL state
|
||||
*/
|
||||
HAL_IRDA_StateTypeDef HAL_IRDA_GetState(IRDA_HandleTypeDef *hirda)
|
||||
HAL_IRDA_StateTypeDef HAL_IRDA_GetState(const IRDA_HandleTypeDef *hirda)
|
||||
{
|
||||
/* Return IRDA handle state */
|
||||
uint32_t temp1;
|
||||
@ -2209,7 +2202,7 @@ HAL_IRDA_StateTypeDef HAL_IRDA_GetState(IRDA_HandleTypeDef *hirda)
|
||||
* the configuration information for the specified IRDA module.
|
||||
* @retval IRDA Error Code
|
||||
*/
|
||||
uint32_t HAL_IRDA_GetError(IRDA_HandleTypeDef *hirda)
|
||||
uint32_t HAL_IRDA_GetError(const IRDA_HandleTypeDef *hirda)
|
||||
{
|
||||
return hirda->ErrorCode;
|
||||
}
|
||||
@ -2307,11 +2300,13 @@ static HAL_StatusTypeDef IRDA_SetConfig(IRDA_HandleTypeDef *hirda)
|
||||
break;
|
||||
case IRDA_CLOCKSOURCE_PLL2Q:
|
||||
HAL_RCCEx_GetPLL2ClockFreq(&pll2_clocks);
|
||||
tmpreg = (uint32_t)(IRDA_DIV_SAMPLING16(pll2_clocks.PLL2_Q_Frequency, hirda->Init.BaudRate, hirda->Init.ClockPrescaler));
|
||||
tmpreg = (uint32_t)(IRDA_DIV_SAMPLING16(pll2_clocks.PLL2_Q_Frequency,
|
||||
hirda->Init.BaudRate, hirda->Init.ClockPrescaler));
|
||||
break;
|
||||
case IRDA_CLOCKSOURCE_PLL3Q:
|
||||
HAL_RCCEx_GetPLL3ClockFreq(&pll3_clocks);
|
||||
tmpreg = (uint32_t)(IRDA_DIV_SAMPLING16(pll3_clocks.PLL3_Q_Frequency, hirda->Init.BaudRate, hirda->Init.ClockPrescaler));
|
||||
tmpreg = (uint32_t)(IRDA_DIV_SAMPLING16(pll3_clocks.PLL3_Q_Frequency, hirda->Init.BaudRate,
|
||||
hirda->Init.ClockPrescaler));
|
||||
break;
|
||||
case IRDA_CLOCKSOURCE_CSI:
|
||||
tmpreg = (uint32_t)(IRDA_DIV_SAMPLING16(CSI_VALUE, hirda->Init.BaudRate, hirda->Init.ClockPrescaler));
|
||||
|
||||
Reference in New Issue
Block a user