#include "task.h" #include "task_type.h" #include "cfg/task_cfg.h" #include "string.h" #ifdef __cplusplus extern "C" { #endif AL_STATIC XDATA TASK_DATA TaskDb[]={ {1, TASK_MODE_PERIOD, TASK_ID(TaskTimer), TASK_NAME(TaskTimer), 100L, 1L, TaskTimer, 0 } , // TASK_NAME(TaskTimer), #include "cfg/task_container.h" }; AL_STATIC XDATA TIMER_DATA TimerData[MAX_TIMER]; AL_STATIC IDATA volatile uint8_t TMP1msCount = 0; AL_STATIC IDATA volatile uint32_t AllTickCount = 0; void TaskFunc (void) { //////////////////////////////////////// uint8_t ret = 0; uint8_t j = 0; uint8_t size = sizeof(TaskDb)/sizeof(TaskDb[0]); _nop_(); InitTaskStack(); //计算堆栈用的 for(j=0;j=MAX_TIMER || index==-1) return -1; // timer number error TimerData[index].cUse=0; if(TimerData[index].TimerID!=NULL) { *TimerData[index].TimerID = -1; TimerData[index].TimerID = NULL; } *pcTimerNumber = -1; return 0; } /*********************************************************************************************************** FUNCTION: StopAllTimer PURPOSE: stop all timer count ************************************************************************************************************/ void StopAllTimer(void) { unsigned char i; memset(TimerData,0,sizeof(TimerData)); for(i=0;i