ex_tick_sec.c

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

#include "net\tick.h"

void main(void) {

    //Second tick variables
    TICK16 tsec = 0;        //16 Bit Second Tick, range of 0 to 65,536 sec = 0 to 18.2 hours

    //Infinite loop
    while(1)

        //Use 16 bit second tick, execute every second
        //This method uses a 16 bit second tick, which produces medium size
        //code, and has a range of 0 to 65,536 sec = 0 to 18.2 hours.
        //It has a resolution of 1 second.
        if ( TickGetDiffSec(tsec) >= (TICK16)1)
        {
            tsec = TickGetSec();

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

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