2017-06-07 01:50 PM
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_prescalerSolved! Go to Solution.
2017-06-07 07:36 PM
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!
2017-06-07 07:36 PM
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!
2017-06-08 09:18 AM
Hi Zhitai,
Good Catch !
I think ST should fixed this on the next revision of Cube_FW
Thank you so much !
2017-06-08 11:23 AM
I hope you don't laugh....
This redundant space took me about 40 mins to discover.....
:((
2017-06-08 11:48 AM
Hello,
I confirm your reported issue.
I will raise this internally to fix in coming releases.
Thanks
Imen