00001 /************************************************** 00002 * Task to run in operation 00003 * Function: Stepping motor control 00004 * 00005 * File: motor_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_MotorTaskInit(void) LargeReentrant{ 00015 F_MotorPowerOnInit(); 00016 } 00017 void F_MotorTask(void) LargeReentrant{ 00018 F_MotorTaskInit(); 00019 while(1){ 00020 while(StepMotorCtrl.Timer!=0){ 00021 #if(ENABLE_TASK_LEVEL_CSW==1) 00022 OS_ENTER_CRITICAL(); 00023 OsCoreScheduler(); 00024 OS_EXIT_CRITICAL(); 00025 #endif 00026 } 00027 StepMotorCtrl.Timer=MotorStepTime; 00028 F_MotorSvc(); 00029 } 00030 } 00031