Skip to content

Commit

Permalink
Prevent unused argument(s) compilation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-hillmann committed Aug 15, 2022
1 parent 8bc4cdc commit 4266a8a
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 2 deletions.
31 changes: 31 additions & 0 deletions Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_comp.h
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,10 @@ __STATIC_INLINE void LL_COMP_SetCommonWindowMode(COMP_Common_TypeDef *COMPxy_COM
#if defined(COMP_CSR_COMPxWNDWEN)
MODIFY_REG(COMPxy_COMMON->CSR, COMP_CSR_COMPxWNDWEN, WindowMode);
#else
/* Prevent unused argument(s) compilation warning */
UNUSED(WindowMode);
UNUSED(COMPxy_COMMON);

/* Device without pair of comparator working in window mode */
/* No update of comparator register (corresponds to setting */
/* "LL_COMP_WINDOWMODE_DISABLE"). */
Expand All @@ -746,6 +750,9 @@ __STATIC_INLINE uint32_t LL_COMP_GetCommonWindowMode(COMP_Common_TypeDef *COMPxy
#if defined(COMP_CSR_COMPxWNDWEN)
return (uint32_t)(READ_BIT(COMPxy_COMMON->CSR, COMP_CSR_COMPxWNDWEN));
#else
/* Prevent unused argument(s) compilation warning */
UNUSED(COMPxy_COMMON);

/* Device without pair of comparator working in window mode */
return (LL_COMP_WINDOWMODE_DISABLE);
#endif
Expand Down Expand Up @@ -777,6 +784,10 @@ __STATIC_INLINE void LL_COMP_SetPowerMode(COMP_TypeDef *COMPx, uint32_t PowerMod
#if defined(COMP_CSR_COMPxMODE)
MODIFY_REG(COMPx->CSR, COMP_CSR_COMPxMODE, PowerMode);
#else
/* Prevent unused argument(s) compilation warning */
UNUSED(COMPx);
UNUSED(PowerMode);

/* Device without comparator power mode configurable */
/* No update of comparator register (corresponds to setting */
/* "LL_COMP_POWERMODE_HIGHSPEED"). */
Expand All @@ -800,6 +811,9 @@ __STATIC_INLINE uint32_t LL_COMP_GetPowerMode(COMP_TypeDef *COMPx)
#if defined(COMP_CSR_COMPxMODE)
return (uint32_t)(READ_BIT(COMPx->CSR, COMP_CSR_COMPxMODE));
#else
/* Prevent unused argument(s) compilation warning */
UNUSED(COMPx);

/* Device without comparator power mode configurable */
return (LL_COMP_POWERMODE_HIGHSPEED);
#endif
Expand Down Expand Up @@ -867,6 +881,9 @@ __STATIC_INLINE void LL_COMP_ConfigInputs(COMP_TypeDef *COMPx, uint32_t InputMin
COMP_CSR_COMPxINSEL | COMP_CSR_COMPxSW1,
InputMinus | InputPlus);
#else
/* Prevent unused argument(s) compilation warning */
UNUSED(InputPlus);

/* Device without comparator input plus configurable */
/* No update of comparator register (corresponds to setting */
/* "LL_COMP_INPUT_PLUS_IO1" or "LL_COMP_INPUT_PLUS_IO2" compared to */
Expand Down Expand Up @@ -905,6 +922,10 @@ __STATIC_INLINE void LL_COMP_SetInputPlus(COMP_TypeDef *COMPx, uint32_t InputPlu
#elif defined(COMP_CSR_COMPxSW1)
MODIFY_REG(COMPx->CSR, COMP_CSR_COMPxSW1, InputPlus);
#else
/* Prevent unused argument(s) compilation warning */
UNUSED(COMPx);
UNUSED(InputPlus);

/* Device without comparator input plus configurable */
/* No update of comparator register (corresponds to setting */
/* "LL_COMP_INPUT_PLUS_IO1" or "LL_COMP_INPUT_PLUS_IO2" compared to */
Expand Down Expand Up @@ -939,6 +960,9 @@ __STATIC_INLINE uint32_t LL_COMP_GetInputPlus(COMP_TypeDef *COMPx)
#elif defined(COMP_CSR_COMPxSW1)
return (uint32_t)(READ_BIT(COMPx->CSR, COMP_CSR_COMPxSW1));
#else
/* Prevent unused argument(s) compilation warning */
UNUSED(COMPx);

/* Device without comparator input plus configurable */
/* No update of comparator register (corresponds to setting */
/* "LL_COMP_INPUT_PLUS_IO1" or "LL_COMP_INPUT_PLUS_IO2" compared to */
Expand Down Expand Up @@ -1028,6 +1052,10 @@ __STATIC_INLINE void LL_COMP_SetInputHysteresis(COMP_TypeDef *COMPx, uint32_t In
#if defined(COMP_CSR_COMPxHYST)
MODIFY_REG(COMPx->CSR, COMP_CSR_COMPxHYST, InputHysteresis);
#else
/* Prevent unused argument(s) compilation warning */
UNUSED(COMPx);
UNUSED(InputHysteresis);

/* Device without comparator input hysteresis */
/* No update of comparator register (corresponds to setting */
/* "LL_COMP_HYSTERESIS_NONE"). */
Expand All @@ -1051,6 +1079,9 @@ __STATIC_INLINE uint32_t LL_COMP_GetInputHysteresis(COMP_TypeDef *COMPx)
#if defined(COMP_CSR_COMPxHYST)
return (uint32_t)(READ_BIT(COMPx->CSR, COMP_CSR_COMPxHYST));
#else
/* Prevent unused argument(s) compilation warning */
UNUSED(COMPx);

/* Device without comparator input hysteresis */
return (LL_COMP_HYSTERESIS_NONE);
#endif
Expand Down
2 changes: 2 additions & 0 deletions Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_adc_ex.c
Original file line number Diff line number Diff line change
Expand Up @@ -4852,6 +4852,8 @@ HAL_StatusTypeDef HAL_ADCEx_MultiModeStop_DMA(ADC_HandleTypeDef* hadc)
uint32_t HAL_ADCEx_MultiModeGetValue(ADC_HandleTypeDef* hadc)
{
ADC_Common_TypeDef *tmpADC_Common;
/* Prevent unused argument(s) compilation warning */
UNUSED(hadc);

/* Check the parameters */
assert_param(IS_ADC_MULTIMODE_MASTER_INSTANCE(hadc->Instance));
Expand Down
6 changes: 5 additions & 1 deletion Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_exti.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,9 @@ uint32_t HAL_EXTI_GetPending(EXTI_HandleTypeDef *hexti, uint32_t Edge)
uint32_t linepos;
uint32_t maskline;
uint32_t offset;

/* Prevent unused argument(s) compilation warning */
UNUSED(Edge);

/* Check parameters */
assert_param(IS_EXTI_LINE(hexti->Line));
assert_param(IS_EXTI_CONFIG_LINE(hexti->Line));
Expand Down Expand Up @@ -561,6 +563,8 @@ void HAL_EXTI_ClearPending(EXTI_HandleTypeDef *hexti, uint32_t Edge)
__IO uint32_t *regaddr;
uint32_t maskline;
uint32_t offset;
/* Prevent unused argument(s) compilation warning */
UNUSED(Edge);

/* Check parameters */
assert_param(IS_EXTI_LINE(hexti->Line));
Expand Down
3 changes: 3 additions & 0 deletions Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,9 @@ void HAL_PWR_DisableWakeUpPin(uint32_t WakeUpPinx)
*/
void HAL_PWR_EnterSLEEPMode(uint32_t Regulator, uint8_t SLEEPEntry)
{
/* Prevent unused argument(s) compilation warning */
UNUSED(Regulator);

/* Check the parameters */
assert_param(IS_PWR_SLEEP_ENTRY(SLEEPEntry));

Expand Down
2 changes: 2 additions & 0 deletions Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,8 @@ HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, ui
void HAL_RCC_MCOConfig(uint32_t RCC_MCOx, uint32_t RCC_MCOSource, uint32_t RCC_MCODiv)
{
GPIO_InitTypeDef gpio;
/* Prevent unused argument(s) compilation warning */
UNUSED(RCC_MCOx);

/* Check the parameters */
assert_param(IS_RCC_MCO(RCC_MCOx));
Expand Down
4 changes: 4 additions & 0 deletions Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rtc_ex.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@
HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin)
{
uint32_t tmpreg = 0U;
/* Prevent unused argument(s) compilation warning */
UNUSED(RTC_TimeStampPin);

/* Check the parameters */
assert_param(IS_TIMESTAMP_EDGE(TimeStampEdge));
Expand Down Expand Up @@ -187,6 +189,8 @@ HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t TimeS
HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin)
{
uint32_t tmpreg = 0U;
/* Prevent unused argument(s) compilation warning */
UNUSED(RTC_TimeStampPin);

/* Check the parameters */
assert_param(IS_TIMESTAMP_EDGE(TimeStampEdge));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
HAL_RTC_MODULE_ENABLED define in stm32f3xx_hal_conf.h
[..]
(@) HAL RTC alarm and HAL RTC wakeup drivers cant be used with low power modes:
(@) HAL RTC alarm and HAL RTC wakeup drivers can't be used with low power modes:
The wake up capability of the RTC may be intrusive in case of prior low power mode
configuration requiring different wake up sources.
Application/Example behavior is no more guaranteed
Expand Down Expand Up @@ -273,6 +273,9 @@ void HAL_ResumeTick(void)
*/
void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc)
{
/* Prevent unused argument(s) compilation warning */
UNUSED(hrtc);

HAL_IncTick();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ void HAL_ResumeTick(void)
*/
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
/* Prevent unused argument(s) compilation warning */
UNUSED(htim);

HAL_IncTick();
}

Expand Down
3 changes: 3 additions & 0 deletions Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_ll_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,9 @@
*/
ErrorStatus LL_ADC_CommonDeInit(ADC_Common_TypeDef *ADCxy_COMMON)
{
/* Prevent unused argument(s) compilation warning */
UNUSED(ADCxy_COMMON);

/* Check the parameters */
assert_param(IS_ADC_COMMON_INSTANCE(ADCxy_COMMON));

Expand Down

0 comments on commit 4266a8a

Please sign in to comment.