# 1 "../task/task.c" # 1 "C:\\WorkSpace32\\blinkled\\Release//" # 1 "" # 1 "../task/task.c" # 1 "../task/task.h" 1 # 12 "../task/task.h" # 1 "C:/Program Files (x86)/ChipON IDE/KungFu32/ChipONCC32/include/Sys/stdint.h" 1 # 16 "C:/Program Files (x86)/ChipON IDE/KungFu32/ChipONCC32/include/Sys/stdint.h" # 1 "C:/Program Files (x86)/ChipON IDE/KungFu32/ChipONCC32/include/Sys/stddef.h" 1 # 24 "C:/Program Files (x86)/ChipON IDE/KungFu32/ChipONCC32/include/Sys/stddef.h" typedef int ptrdiff_t; typedef unsigned int size_t; typedef unsigned short wchar_t; # 17 "C:/Program Files (x86)/ChipON IDE/KungFu32/ChipONCC32/include/Sys/stdint.h" 2 typedef signed char int8_t; typedef unsigned char uint8_t; typedef short int16_t; typedef unsigned short uint16_t; typedef int int32_t; typedef unsigned int uint32_t; typedef long long int64_t; typedef unsigned long long uint64_t; typedef signed char int_least8_t; typedef unsigned char uint_least8_t; typedef short int_least16_t; typedef unsigned short uint_least16_t; typedef int int_least32_t; typedef unsigned int uint_least32_t; typedef long long int_least64_t; typedef unsigned long long uint_least64_t; typedef char int_fast8_t; typedef unsigned char uint_fast8_t; typedef short int_fast16_t; typedef unsigned short uint_fast16_t; typedef int int_fast32_t; typedef unsigned int uint_fast32_t; typedef long long int_fast64_t; typedef unsigned long long uint_fast64_t; # 60 "C:/Program Files (x86)/ChipON IDE/KungFu32/ChipONCC32/include/Sys/stdint.h" typedef int intptr_t; # 69 "C:/Program Files (x86)/ChipON IDE/KungFu32/ChipONCC32/include/Sys/stdint.h" typedef unsigned int uintptr_t; typedef long long intmax_t; typedef unsigned long long uintmax_t; # 13 "../task/task.h" 2 # 1 "C:\\WorkSpace32\\blinkled/taskdef.h" 1 # 15 "../task/task.h" 2 enum TASK_ID { TASK_TIMER = 1, # 1 "C:\\WorkSpace32\\blinkled/taskid.h" 1 TASK_BLINK, # 20 "../task/task.h" 2 }; enum TASK_MODE {TASK_MODE_ONCE,TASK_MODE_PERIOD}; void TaskProc(void); void Task_SysTick_Handler(void); # 8 "../task/task.c" 2 typedef struct mytask { uint8_t cActive; uint8_t cTaskMode; uint8_t cType; uint8_t reserve1; int32_t lLastTime; int32_t lPeriod; void (*TaskProc)(void); }TASK_DATA,*PTASK_DATA; enum TIMER_MODE { TIMER_MODE_TIMER = 0, TIMER_MODE_ONCEROUTINE, TIMER_MODE_CYCROUTINE }; typedef struct mytimer { uint8_t cUse; uint8_t cMode; int16_t reserve1; int32_t lPeriod; int32_t lLastTime; void (*routine)(void * Param1); void *Param1; }TIMER_DATA,*PTIMER_DATA; static void TaskTimer(void); static TASK_DATA TaskDb[]={ {1, TASK_MODE_PERIOD, 10L, 10L, 0, TASK_TIMER, TaskTimer} , }; static TIMER_DATA TimerData[5]; static uint32_t TMP1msCount = 0; static void idle(void) { } void TaskProc(void) { uint32_t i = 0; while(1) { if(!TMP1msCount) { idle(); } else { if(TMP1msCount>0) { for(i=0;icUse) continue; if((--(pt->lLastTime))<=0) { switch(pt->cMode) { case TIMER_MODE_TIMER: pt->cUse=0; break; case TIMER_MODE_CYCROUTINE: pt->lLastTime+=pt->lPeriod; pt->routine(pt->Param1); break; case TIMER_MODE_ONCEROUTINE: pt->cUse=0; pt->routine(pt->Param1); break; default: pt->cUse=0; break; } } } } void Task_SysTick_Handler(void) { TMP1msCount++; }