ex_tick8.c

This example code shows how to use the 8 bit Tick functions.

#include "net\tick.h"

void main(void) {
    
    //The default tick period is 10ms
    TICK8  t8Bit = 0;       //Has 8 Bits, range of 0 - 255 = 255 x 10ms = 2.55 seconds

    //Infinite loop
    while(1)

        //Use 8 bit tick, execute every half a second
        //This method uses a 8 bit tick, which produces small and fast
        //code, but only has a range of 0 - 2.55 seconds. It has a resolution of 10ms.
        if ( TickGetDiff8bit(t8Bit) >= ((TICK8)TICKS_PER_SECOND / (TICK8)2) )
        {
            t8Bit = TickGet8bit();

            //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