AnsweredAssumed Answered

Delay function in ms how?

Question asked by eich.alexander on Nov 22, 2011
Latest reply on Nov 22, 2011 by Clive One
Hi,
I need a delay(uint) function for my stm32f103ze project.

My IDE is KEIL with STM32 Std.Periph. v3.5.0

I found a snipped in a KEIL example but I don't understand it and I dont know if its correct.



volatile unsigned long TimeTick;

/*------------------------------------------------------------------------------
  Delay function
  delays number of tick Systicks (happens every 10 ms)
*------------------------------------------------------------------------------*/
void Delay (unsigned long tick)
{
    unsigned long timetick;

    timetick = TimeTick;
    while ((TimeTick - timetick) < tick);
}


Do you guys would help me please to find a solution?

with regards
alex

Outcomes