/* demo5 for DT_timer for LED display. with XS_09300.LIB */ #include #include #include //#include"..\lib\7188e.h" #include"..\lib\8000a.h" #include"..\lib\tcpip32.h" #include"..\lib\MFW.H" void printHello(void); void printBye(void); void XS_UserInit(int argc,char *argv[]) { char version[20]; int i; InitLib(); XS_GetVersion(version); Print("[X-Server library]: version=%s ",version); XS_GetLibDate(version); Print("date=%s\r\n",version); Print("Tcpip library version:%X, Library Date is %s\r\n",GetTcpipLibVer(),version); XS_AddSystemLoopFun(UserLoop); /* need add this line for the library 0.9.100 date after 2004/06/02 */ DT_AddTimer(10,500,1,printHello); DT_AddTimer(5,1000,1,printBye); //this line is executed at the same time as to above } void XS_UserEnd(void) { DT_DeleteTimer(1,2); //DT_DeleteTimer(id,number); number= the number of DT_AddTimer used } void UserLoop(void) { //DT_DeleteTimer(1,5); if(Kbhit()){ switch(Getch()){ case 27: //27 = ESC QuitMain=1; break; } } } /************************************************************************/ /* XS 0.9.200 or later must add the function main() */ void main(int argc,char *argv[]) { XS_main(argc,argv); /* call the XS library main function. */ } /*************************************************************************/ void printHello(void){ Print("Hello! "); } /*************************************************************************/ void printBye(void){ Print("Bye! "); }