AnsweredAssumed Answered

__HAL_TIM_SET_PRESCALER error

Question asked by ong.siau on Jun 7, 2017
Latest reply on Jun 8, 2017 by Imen D

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:  #20: identifier "__PRESC__" is undefined

../Src/main.c(286): error:  #20: 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

Outcomes