2023-03-26 11:42 PM
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.
Solved! Go to Solution.
2023-03-27 12:02 AM
It's solved Thank you.
2023-03-27 12:02 AM
It's solved Thank you.