timer lag

This commit is contained in:
leo 2023-09-18 16:48:23 +02:00
parent 052e7b5a4b
commit 38e7b72b95
Signed by: leo
GPG Key ID: 0DD993BFB2B307DB

View File

@ -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;