cancel
Showing results for 
Search instead for 
Did you mean: 

Doubt regarding timer interrupt stop function

Killstreet30
Associate III

Hi,

I had a doubt regarding the timer interrupt stop function.

if(isOpen_Unload == 1){

 HAL_NVIC_DisableIRQ(EXTI15_10_IRQn);

 HAL_NVIC_EnableIRQ(EXTI9_5_IRQn);

 Start_Motor(1);

 HAL_Delay(5000);

 HAL_NVIC_EnableIRQ(EXTI15_10_IRQn);

 HAL_TIM_Base_Start_IT(&htim3);

 time_up = 0;

 close_tray_unloading();

 }

void close_tray_unloading(){

 curr = 0;

 while(!time_up){

  curr = final_load();

  if(curr < initial_weight){

   HAL_TIM_Base_Stop_IT(&htim3);

   if(isClose_Unload == 1){

       isClose = 1;

      }

   break;

  }

 }

}

Now in the above code as you can see I have started the timer interrupt after motor starts running and it is set to 15 secs. But I want to stop the timer interrupt when my current weight < initial weight as you can see in the condition but even though my current weight < initial weight it never stops the timer and timer interrupt gets completed. Have tried debugging using breakpoints but it never reaches HAL_TIM_base stop when though current weight is less than initial weight. Please help.

1 ACCEPTED SOLUTION

Accepted Solutions
Killstreet30
Associate III

It's solved Thank you.

View solution in original post

1 REPLY 1
Killstreet30
Associate III

It's solved Thank you.