diff --git a/stm32f1xx_hal.c b/stm32f1xx_hal.c index 683c76e..af71b1d 100644 --- a/stm32f1xx_hal.c +++ b/stm32f1xx_hal.c @@ -45,9 +45,9 @@ static void* tim_handler(void* arg){ unsigned int nb_exec = time * 1000 / delay_ps; int backlog = nb_exec - exec_counter; + if(backlog > 10) + printf("timer simulation lagging behind (%d ticks)\n", backlog); while(backlog > 0){ - if(backlog > 10) - printf("timer simulation lagging behind (%d ticks)\n", backlog); HAL_TIM_PeriodElapsedCallback(htim); exec_counter++; backlog = nb_exec - exec_counter;