AnsweredAssumed Answered

disable interrupt

Question asked by Mr.Cscn on Jan 18, 2016
Latest reply on Jan 19, 2016 by dembek.radoslaw.001
i know how to set properly timer interrupt and it works fine. now i'm trying to create a function to disable interrupt. i should be something like this:

void TimDisableInterrupt(TIM_TypeDef* TIMx)

     case (int)TIM2:
     case (int)TIM3:
     case (int)TIM4:
     case (int)TIM5:
     case (int)TIM6:
     case (int)TIM7:

     NVIC_InitTypeDef nvicStructure;

     nvicStructure.NVIC_IRQChannelCmd = DISABLE;


     TIM_ITConfig(TIMx, TIM_IT_Update, DISABLE);
     TIM_Cmd(TIMx, DISABLE);
     TIM_ClearITPendingBit(TIMx, TIM_IT_Update);

so TimDisableInterrupt(TIM6) should disable TIM6 interrupt, but it doesn't work and it continue to go inside here:

void TIM6_IRQHandler(void)
    if (TIM_GetITStatus(TIM6, TIM_IT_Update) != RESET)
    /*do something */
    TIM_ClearITPendingBit(TIM6, TIM_IT_Update);

i'm using stm32f10x