cancel
Showing results for 
Search instead for 
Did you mean: 

__HAL_TIM_SET_PRESCALER error

osiauhwa
Associate II
Posted on June 07, 2017 at 22:50

Hi,

I tried this code :

void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)

{

/* USER CODE BEGIN Callback 1 */

    if (htim->Instance == TIM2) {

    HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_5);

        __HAL_TIM_SET_PRESCALER(&htim2, 30000);

  }

/* USER CODE END Callback 1 */

}

but gave me :

../Src/main.c(286): error:  &sharp20: identifier '__PRESC__' is undefined

../Src/main.c(286): error:  &sharp20: identifier '__HANDLE__' is undefined

But if I tried :

__HAL_TIM_SET_COUNTER or others macro, there was no error...

Any clue on how to resolve this ...

Thank you

#__hal_tim_set_prescaler
1 ACCEPTED SOLUTION

Accepted Solutions
Zt Liu
Senior III
Posted on June 08, 2017 at 04:36

ong.siau

You might havediscovered a typing error!!!

in my stm32f3xx_hal_tim.h file.

it's

__HAL_TIM_SET_PRESCALE

R (

__HANDLE__, __PRESC__) ((__HANDLE__)->Instance->PSC = (__PRESC__))

it should be

__HAL_TIM_SET_PRESCALE

R(

__HANDLE__, __PRESC__) ((__HANDLE__)->Instance->PSC = (__PRESC__))

there is a space between 'R' and '('.

Good luck!

View solution in original post

4 REPLIES 4
Zt Liu
Senior III
Posted on June 08, 2017 at 04:36

ong.siau

You might havediscovered a typing error!!!

in my stm32f3xx_hal_tim.h file.

it's

__HAL_TIM_SET_PRESCALE

R (

__HANDLE__, __PRESC__) ((__HANDLE__)->Instance->PSC = (__PRESC__))

it should be

__HAL_TIM_SET_PRESCALE

R(

__HANDLE__, __PRESC__) ((__HANDLE__)->Instance->PSC = (__PRESC__))

there is a space between 'R' and '('.

Good luck!

osiauhwa
Associate II
Posted on June 08, 2017 at 18:18

Hi Zhitai,

Good Catch !

I think ST should fixed this on the next revision of Cube_FW

Thank you so much !

Posted on June 08, 2017 at 18:23

I hope you don't laugh....

This redundant space took me about 40 mins to discover.....

:((

Imen.D
ST Employee
Posted on June 08, 2017 at 20:48

Hello,

I confirm your reported issue.

I will raise this internally to fix in coming releases.

Thanks

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen