ex_tick.c

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

00001 
00006 #include "net\tick.h"
00007 
00008 void main(void) {
00009 
00010     //The default tick period is 10ms
00011     TICK   t = 0;           //Default TICK, Has 32 Bits, range of 0 - 2^32
00012 
00013     //Infinite loop
00014     while(1)
00015 
00016         //Use default tick (32 bit), execute every half a second
00017         //This method uses a 32 bit tick, which produces the slowest code but has the
00018         //longest tick range, 0 - 497 days. It has a resolution of 10ms.
00019         if ( TickGetDiff(t) >= ((TICK)(TICKS_PER_SECOND/2)) )
00020         {
00021             t = TickGet();
00022 
00023             //Add uses code here. This code is executed every half a second
00024             ...
00025         }
00026    }
00027 }

Generated on Mon Oct 9 11:35:13 2006 for SBC68EC Web Server by  doxygen 1.4.7