00001 /**************************************************************************** 00002 ** These are a collection of routines that implement a simple timer service 00003 ** 00004 ** Created May 14, 2008 00005 ** 00006 ****************************************************************************/ 00007 00008 #ifndef TIMERSERVICES__H 00009 #define TIMERSERVICES__H 00010 00011 #include "task.h" 00012 00013 typedef struct tservice TSERVICE; 00014 00015 struct tservice{ 00016 unsigned int Time; 00017 unsigned int Counter; 00018 unsigned int Mode; 00019 void *arg; 00020 void (*callback)(void *arg); 00021 TSERVICE *next,*prev; 00022 }; 00023 00024 extern ECB *TimerServicesSem; 00025 00026 extern TSERVICE *NewTimerService(unsigned t, unsigned m, void *arg, void (*cb)(void *) ); 00027 extern void DeleteTimerService(TSERVICE *pTS); 00028 extern void StartTimer(TSERVICE *pTS); 00029 extern void KillTimer(TSERVICE *pTS); 00030 extern void InitTimerServices(void); 00031 00032 #endif