00001 00006 #include "net\tick.h" 00007 00008 void main(void) { 00009 00010 //The default tick period is 10ms 00011 TICK16 t16Bit = 0; //Has 16 Bits, range of 0 - 65535 = 65535 x 10ms 00012 // = 655 seconds = 10.9 minutes 00013 //Infinite loop 00014 while(1) 00015 00016 //Use 16 bit tick, execute every half a second 00017 //This method uses a 16 bit tick, which produces medium size code and 00018 //has a range of 0 - 655 seconds. It has a resolution of 10ms. 00019 if ( TickGetDiff16bit(t16Bit) >= ((TICK16)(TICKS_PER_SECOND/2)) ) 00020 { 00021 t16Bit = TickGet16bit(); 00022 00023 //Add uses code here. This code is executed every half a second 00024 ... 00025 } 00026 } 00027 }
1.4.7