timer self-overlay
timer self-overlay
I added a timer to the program, but I can't figure out one thing. Set the timer to fire every 1 second. Now the timer will perform a certain task. But what if the duration of the task is more than 1 second? It turns out that the timer will work again and interrupt the execution of the previous task and restart it? And then the task will never be completed? Or is the timer unable to interrupt itself?
Re: timer self-overlay
Search for <Simple software WDT implementation> on the forum. I use a 70 second time period.
I think wdt_callback() and wdt_feed() takes care of the problem you raise.
I think wdt_callback() and wdt_feed() takes care of the problem you raise.
Re: timer self-overlay
That's right.
Depending on which port/board you're using for the specific implementation, but neither a hard or soft IRQ can interrupt themselves.
In general it's a really bad idea to have interrupt handlers take long to execute (i.e. they should do the minimum possible work, i.e. set a flag), and then have your main program deal with the flag.