CHENJIE-PC\QiXiang_CHENJIE 4 years ago
parent
commit
8af7bff2b4
1 changed files with 11 additions and 10 deletions
  1. 11 10
      src/app.c

+ 11 - 10
src/app.c

@@ -295,13 +295,14 @@ static void process0AppTask(void* arg)//任务调度程序
                 {
                     sleep_index = 0;
                 }
-                #ifdef USING_PRINTF
-                    printf("sleep_index:%d,Current:%x,CAN:%x \n",sleep_index,Uart_Rece_BattI,Can_Rece_buffer[0]);
-                #endif
+
                 if (sleep_index >=6000)
                 {
                     PROC_Task_STATE_SWITCH(PROCESS_STATE_SLEEP);
                     sleep_index = 0;
+				    #ifdef USING_PRINTF
+                    	printf("sleep_index:%d,Current:%x,CAN:%x \n",sleep_index,Uart_Rece_BattI,Can_Rece_buffer[0]);
+                	#endif
                 }
                 break;
                 
@@ -359,7 +360,7 @@ static void process1AppTask(void* arg)
     uint8_t *Uart_Reve_Point = NULL;
     Uart_Receive_Type Uart_Receive_Msg;
 	PROC_Uart_STATE_SWITCH(PROCESS_Uart_STATE_IDLE);
-    slpManApplyPlatVoteHandle("process1slp",&process1SlpHandler);
+	slpManApplyPlatVoteHandle("process1slp",&process1SlpHandler);
     slpManPlatVoteDisableSleep(process1SlpHandler, SLP_SLP2_STATE); 
     Uart_Receive_Msg.Bms_Address = 0x01;
     Uart_Receive_Msg.Bms_Read_Funcode = 0x03;
@@ -505,8 +506,8 @@ static void process1AppTask(void* arg)
             case PROCESS_Uart_STATE_SLEEP:
             {	
 			    free(Uart_Rece_buffer); 
-                slpManPlatVoteEnableSleep(process2SlpHandler, SLP_SLP2_STATE);  
-                slpManPlatVoteDisableSleep(process2SlpHandler, SLP_HIB_STATE);  
+                slpManPlatVoteEnableSleep(process1SlpHandler, SLP_SLP2_STATE);  
+                slpManPlatVoteDisableSleep(process1SlpHandler, SLP_HIB_STATE);  
                 while(1)
                 {
                     osDelay(3000);
@@ -706,8 +707,8 @@ static void process2AppTask(void* arg)
             }
             case PROCESS_STATE_SLEEP:
             {   
-                slpManPlatVoteEnableSleep(process1SlpHandler, SLP_SLP2_STATE); 
-                slpManPlatVoteDisableSleep(process1SlpHandler, SLP_HIB_STATE);   
+                slpManPlatVoteEnableSleep(process2SlpHandler, SLP_SLP2_STATE); 
+                slpManPlatVoteDisableSleep(process2SlpHandler, SLP_HIB_STATE);   
                 while(1)
                 {
                     osDelay(3000);
@@ -889,11 +890,11 @@ static void process3AppTask(void* arg)
             }
             case PROCESS_NB_STATE_SLEEP:
             {   
-                // tcpipConnectionClose(TcpConnectID);  
+            	tcpipConnectionClose(TcpConnectID);  
                 // posGGAServiceStop();
+				free(TcpSendBuffer);
                 slpManPlatVoteEnableSleep(process3SlpHandler, SLP_SLP2_STATE);  // cancel the prohibition of sleep2
 				slpManPlatVoteDisableSleep(process3SlpHandler, SLP_HIB_STATE);
-                free(TcpSendBuffer);
                 while(1)
                 {
                     osDelay(3000);