| [Plain Text] 纯文本查看 复制代码 static  void  OS_InitMisc (void)
 {
 #if OS_TIME_GET_SET_EN > 0  
     OSTime        = 0L;                                          /* Clear the 32-bit system clock            */
 #endif
 
     OSIntNesting  = 0;                                           /* Clear the interrupt nesting counter      */
     OSLockNesting = 0;                                           /* Clear the scheduling lock counter        */
 
     OSTaskCtr     = 0;                                           /* Clear the number of tasks                */
 
     OSRunning     = FALSE;                                       /* Indicate that multitasking not started   */
    
     OSCtxSwCtr    = 0;                                           /* Clear the context switch counter         */
     OSIdleCtr     = 0L;                                          /* Clear the 32-bit idle counter            */
 
 #if (OS_TASK_STAT_EN > 0) && (OS_TASK_CREATE_EXT_EN > 0)
     OSIdleCtrRun  = 0L;
     OSIdleCtrMax  = 0L;
     OSStatRdy     = FALSE;                                       /* Statistic task is not ready              */
 #endif
 }说明:
 
 OSRunning:多任务是否启动标志,True 为启动,False 为不启动 OSIdleCtrRun:保存上一秒空闲任务计数器 OSIdleCtr 的值 OSIdleCtrMax:1s 内空闲计数器能达到的最大值
 |