cancel
Showing results for 
Search instead for 
Did you mean: 

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

DIvan.1
Associate III

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

3 REPLIES 3
Uwe Bonnes
Principal II

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

Good idea, thanks. I will use it.

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

All the best,

Domen