Dear friend, can anybody explain me why this kind of Static function used and when it should be used?
static void delay (unsigned long cnt) { while (cnt--); }
The use of static functions touches the concept of implementation hiding: en.wikipedia.org/.../Implementation_Hiding Basically, if nobody should need to call the function, the function should be excluded from the global name space using the static keyword. Reducing the number of identifiers in the global name space is a good thing.
Thank-you for directly answering the posted question instead of getting off on a tangent.