Browse Source

V17_3_0:修改定时器位置,避免定时器失效不唤醒

CHENJIE-PC\QiXiang_CHENJIE 4 years ago
parent
commit
2937b0fc35
1 changed files with 4 additions and 6 deletions
  1. 4 6
      src/app.c

+ 4 - 6
src/app.c

@@ -345,14 +345,12 @@ static void Main_Task(void* arg)
                 #ifdef USING_PRINTF
                     printf("which slpstate can go now :%d \n",slpstate);
                 #endif
-                for (int i = 0; i < 7; i++)
-                {
-                    slpManDeepSlpTimerDel(i);
-                }
-                slpManDeepSlpTimerStart(deepslpTimerID, Sleep_Time);
                 while(1)
                 {
-                    osDelay(60000/portTICK_PERIOD_MS);
+                    if(!slpManDeepSlpTimerIsRunning(deepslpTimerID))
+                        slpManDeepSlpTimerDel(deepslpTimerID);
+                    slpManDeepSlpTimerStart(deepslpTimerID, Sleep_Time);
+                    osDelay(30000/portTICK_PERIOD_MS);
                 }
                 break;
             }