I have read post on making an accurate delay function and not sysctldelay But none gave I certain solution with code.
on a post an employee said something about :"Better way would be to use a WDT to fire a NMI which will always be serviced in a fixed amount of time and that can be factored into the wait time"
can you explain it and give an example?
i was thinking on setting timer to the half frequency and use a Boolean on the delay function.Everytime the bool is true then the delay will decrease the number of time(given in argument) till it reaches zero. The interupt handler will change the state of Boolean so the half cases the delay function will wait. The only thing I am not sure is how to make delay function to decrease one time the number when the trigger sets it in the condition that decrement happens.
also there is a site that does something with timer and sysctldelay and a volatile variable Millis that was I cemented according sysctldelay and timer uses a subtraction of Millis and a temp store of itsself To check that is smaller that the delay time asked.I will try to find the site to post it.
is there any ready solution?