Home > other >  System timer and main program of parallel "tick"? How can it realize blocking timing effec
System timer and main program of parallel "tick"? How can it realize blocking timing effec

Time:01-21

Watch the source program on atomic time delay block the timing is all with the SysTick "tick" clock timing delay for the main program, this let me wondering: is not to say that the SysTick independent? That is run in parallel with the main program, only when the interrupt will make the jump in interrupt service functions, the main program that such "tick" is how to rise to block the timing function when the timer? Like IIC is punctuated with time delay is blocking time delay, delay here is to make the main program card, "tick" timer is how to achieve?

CodePudding user response:

Delay (int m)
{
Int t0=gettick ();
While (gettick () - t0 & lt; M) {}
}
  • Related