VOS_VOID RNIC_StopAllTimer( VOS_VOID ) { RNIC_TIMER_CTX_STRU *pstRnicTimerCtx; VOS_UINT32 i; pstRnicTimerCtx = RNIC_GetTimerAddr(); for (i = 0 ; i < RNIC_MAX_TIMER_NUM ; i++) { if (RNIC_TIMER_STATUS_RUNING == pstRnicTimerCtx[i].enTimerStatus) { /* 停止VOS定时器 */ VOS_StopRelTimer(&(pstRnicTimerCtx[i].hTimer)); pstRnicTimerCtx[i].hTimer = VOS_NULL_PTR; pstRnicTimerCtx[i].enTimerStatus = RNIC_TIMER_STATUS_STOP; } } #if (FEATURE_ON == FEATURE_LTE) /* 如果已经设置了唤醒源标志,则清除该标志,并且设置32K时钟为非唤醒源 */ if (VOS_TRUE == RNIC_GetTimer4WakeFlg()) { BSP_PWC_DelTimer4WakeSrc(); RNIC_SetTimer4WakeFlg(VOS_FALSE); } #endif }
VOS_VOID RNIC_StopTimer( RNIC_TIMER_ID_ENUM_UINT16 enTimerId ) { RNIC_TIMER_CTX_STRU *pstRnicTimerCtx; VOS_UINT32 i; pstRnicTimerCtx = RNIC_GetTimerAddr(); for ( i = 0 ; i < RNIC_MAX_TIMER_NUM ; i++ ) { if ( ( RNIC_TIMER_STATUS_RUNING == pstRnicTimerCtx[i].enTimerStatus ) && ( enTimerId == pstRnicTimerCtx[i].enTimerId)) { break; } } if ( i >= RNIC_MAX_TIMER_NUM) { RNIC_WARNING_LOG1(ACPU_PID_RNIC, "RNIC_StopTimer:too many timer", enTimerId); return; } /* 停止VOS定时器: 当定时器的指针已经为空的时候, 说明其已经停止或者超时 */ if (VOS_NULL_PTR != pstRnicTimerCtx[i].hTimer) { VOS_StopRelTimer(&(pstRnicTimerCtx[i].hTimer)); } pstRnicTimerCtx[i].hTimer = VOS_NULL_PTR; pstRnicTimerCtx[i].enTimerId = TI_RNIC_TIMER_BUTT; pstRnicTimerCtx[i].enTimerStatus = RNIC_TIMER_STATUS_STOP; /* 定时器状态勾包出来 */ #if (FEATURE_ON == FEATURE_LTE) /* 如果已经设置了唤醒源标志,并且是按需断开定时器,则清除该标志,并且设置32K时钟为非唤醒源 */ if ((VOS_TRUE == RNIC_GetTimer4WakeFlg()) && (TI_RNIC_DEMAND_DIAL_DISCONNECT == enTimerId)) { BSP_PWC_DelTimer4WakeSrc(); RNIC_SetTimer4WakeFlg(VOS_FALSE); } #endif }
VOS_VOID RNIC_StopTimer( RNIC_TIMER_ID_ENUM_UINT16 enTimerId ) { RNIC_TIMER_CTX_STRU *pstRnicTimerCtx; pstRnicTimerCtx = RNIC_GetTimerAddr(); /* 不在使用的定时器范围内 */ if (enTimerId >= RNIC_MAX_TIMER_NUM) { return; } /* 没有启动则不需要停止 */ if (RNIC_TIMER_STATUS_RUNING != pstRnicTimerCtx[enTimerId].enTimerStatus) { return; } /* 停止VOS定时器: 当定时器的指针已经为空的时候, 说明其已经停止或者超时 */ if (VOS_NULL_PTR != pstRnicTimerCtx[enTimerId].hTimer) { VOS_StopRelTimer(&(pstRnicTimerCtx[enTimerId].hTimer)); } pstRnicTimerCtx[enTimerId].hTimer = VOS_NULL_PTR; pstRnicTimerCtx[enTimerId].enTimerStatus = RNIC_TIMER_STATUS_STOP; /* 定时器状态勾包出来 */ #if (FEATURE_ON == FEATURE_LTE) /* 如果已经设置了唤醒源标志,并且是按需断开定时器,则清除该标志,并且设置32K时钟为非唤醒源 */ if ((VOS_TRUE == RNIC_GetTimer4WakeFlg()) && (TI_RNIC_DEMAND_DIAL_DISCONNECT == enTimerId)) { BSP_PWC_DelTimer4WakeSrc(); RNIC_SetTimer4WakeFlg(VOS_FALSE); } #endif }