Question
Is Systick the way to generate a delay function
Posted on April 12, 2013 at 08:49
Hi Folks (and Clive)
I have generated timing delays using systick and I want some comments on whether it was the right way to go:-GPIO_InitTypeDef GPIO_InitStructure;static __IO uint32_t TimingDelay;void Delay(__IO uint32_t nTime) { TimingDelay = nTime; while (TimingDelay != 0) ; }void TimingDelay_Decrement(void) { if (TimingDelay != 0x00) { TimingDelay--; } }extern ''C'' void SysTick_Handler(void) { TimingDelay_Decrement(); }I believe that systick is a low priority - so can this code get stuck if there is a pending higher priority interrupt??CS