DC_CheckWatchdog
来源:互联网 发布:网络兼职诈骗案开庭 编辑:程序博客网 时间:2024/06/05 13:34
//////////////////////////////////////////////////////////////////////////////////////////** \brief 这个函数检查当前的Sync状态和设置本地的标志位,本地地址的分析是在“checkIfEcatError”里面处理*////////////////////////////////////////////////////////////////////////////////////////void DC_CheckWatchdog(void){ if(bDcSyncActive) {#if TIESC_HW #ifdef ENABLE_SYNC_TASK DISABLE_ESC_INT();#endif#endif /*检查Sync0的周期,如果Sync0看门狗是使能的*/ if(Sync0WdValue > 0) { Sync0WdCounter ++; if(Sync0WdCounter > Sync0WdValue) { /*Sync0的看门狗超时*/ bDcRunning = FALSE; } } if(bDcRunning) { if(sSyncManOutPar.u32SmEventMissedCounter < sErrorSettings.u32SyncErrorCounterLimit) { bPllRunning = TRUE; /*等待PLL是激活状态,增加PLL的有效计数*/ if(i16WaitForPllRunningTimeout > 0) { i16WaitForPllRunningCnt++; } } else { bPllRunning = FALSE; sSyncManOutPar.u16SyncError = 1; /*等待PLL是激活状态,重置PLL的有效计数*/ if(i16WaitForPllRunningTimeout > 0) { i16WaitForPllRunningCnt = 0; } } } else { bPllRunning = FALSE; }#if TIESC_HW #ifdef ENABLE_SYNC_TASK ENABLE_ESC_INT(); #endif#endif }}#endif //#if DC_SUPPORTED