Skip to main content
DIvan.1
Associate III
December 3, 2020
Question

How to skip the first interrupt after starting the "Timer with interrupt" ?

  • December 3, 2020
  • 3 replies
  • 931 views

Hi Everyone!

Last few days I start to learn about Timer, especially about Timer with interrupt. I have a question about this.

When I start timer, the interrupt immediately occurred and then after every 3 seconds.

Is there any possibility to skip the first interrupt and get the first interrupt 3 seconds after starting the Timer?

Best regards,

DomenI

This topic has been closed for replies.

3 replies

Uwe Bonnes
Chief
December 3, 2020

Best is you avoid that by cleaning up before enabling the timer irq. Otherwise, have a static variable set to 0. increment in the irq and return immediate when == 1

DIvan.1
DIvan.1Author
Associate III
December 3, 2020

Good idea, thanks. I will use it.

I was just think, maybe there is some predefined function.

All the best,

Domen