ex_tick.c

This example code shows how to use the default Tick functions.

#include "net\tick.h"

void main(void) {

    //The default tick period is 10ms
    TICK   t = 0;           //Default TICK, Has 32 Bits, range of 0 - 2^32

    //Infinite loop
    while(1)

        //Use default tick (32 bit), execute every half a second
        //This method uses a 32 bit tick, which produces the slowest code but has the
        //longest tick range, 0 - 497 days. It has a resolution of 10ms.
        if ( TickGetDiff(t) >= ((TICK)TICKS_PER_SECOND / (TICK)2) )
        {
            t = TickGet();

            //Add uses code here. This code is executed every half a second
            ...
        }
   }
}

Generated on Wed Feb 3 12:45:33 2010 for SBC65EC Web Server by  doxygen 1.5.8