00001 /************************************************** 00002 * Task to run in operation 00003 * Function: Real time clock control 00004 * 00005 * File: rtc_task.c 00006 * Author: Book Chen 00007 * 2008.08.08 00008 **************************************************** 00009 */ 00010 #include "..\inc\includes.h" 00011 #include "..\tasks\task_includes.h" 00012 #include "..\os_core\os_includes.h" 00013 00014 void F_RtcTaskInit(void) LargeReentrant; 00015 void F_RtcTask(void) LargeReentrant; 00016 00017 void F_RtcTaskInit(void) LargeReentrant{ 00018 F_RtcPowerOnInit(); 00019 } 00020 void F_RtcTask(void) LargeReentrant{ 00021 F_RtcTaskInit(); 00022 while(1){ 00023 if(RtcCtrl.State==RtcIdleState){ 00024 while(RtcCtrl.Timer!=0){ 00025 #if(ENABLE_TASK_LEVEL_CSW==1) 00026 OS_ENTER_CRITICAL(); 00027 OsCoreScheduler(); 00028 OS_EXIT_CRITICAL(); 00029 #endif 00030 } 00031 RtcCtrl.Timer=RtcControlTime; 00032 RtcCtrl.State=RtcReadSecondState; 00033 } 00034 F_RtcSvc(); 00035 } 00036 } 00037