User timer interrupt for capture multiple time
Hi all,
I'm working with STM32F4 discovery board, and I'd like to know if I can use one timer with interrupt to capture multiple time.
For example I'd like to use TIM16, and be able to check 4 times : 150ms, 250ms, 500ms and 1000ms is it possible? After some researches I think I have to use `CNT` value. But how can I know if the time ellasped is 500ms for example ?
I've already do something like this in my while loop, it's working but I'd like to do thaht in an interrupt
// If enough time has passed (1 second), toggle LED and get new timestamp
if (__HAL_TIM_GET_COUNTER(&htim16) - timer_val >= 10000)
{
HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_5);
timer_val = __HAL_TIM_GET_COUNTER(&htim16);
}
