ex_tick_sec.c

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

00001 
00006 #include "net\tick.h"
00007 
00008 void main(void) {
00009 
00010     //Second tick variables
00011     TICK16 tsec = 0;        //16 Bit Second Tick, range of 0 to 65,536 sec = 0 to 18.2 hours
00012 
00013     //Infinite loop
00014     while(1)
00015 
00016         //Use 16 bit second tick, execute every second
00017         //This method uses a 16 bit second tick, which produces medium size
00018         //code, and has a range of 0 to 65,536 sec = 0 to 18.2 hours.
00019         //It has a resolution of 1 second.
00020         if ( TickGetDiffSec(tsec) >= 1)
00021         {
00022             tsec = TickGetSec();
00023 
00024             //Add uses code here. This code is executed every second
00025             ...        
00026         }
00027     }
00028 }

Generated on Mon Oct 9 13:22:06 2006 for SBC65EC Web Server by  doxygen 1.4.7