Selaa lähdekoodia

版本号:2.0.0.4,10套量产包发布修改版,修改了睡眠问题,如果不睡眠应该立即重启

CHENJIE-PC\QiXiang_CHENJIE 3 vuotta sitten
vanhempi
commit
ec1f322d47
5 muutettua tiedostoa jossa 18 lisäystä ja 11 poistoa
  1. 4 4
      inc/app.h
  2. 1 1
      src/CANTask.c
  3. 11 4
      src/MainTask.c
  4. 1 1
      src/UartTask.c
  5. 1 1
      src/app.c

+ 4 - 4
inc/app.h

@@ -13,9 +13,9 @@
 extern "C" {
 #endif
 //全局定义声明区
-#define BMS_MANUFACTURE (2) //BMS制造商表示1-超力源,2-美顺
+#define BMS_MANUFACTURE (1) //BMS制造商表示1-超力源,2-美顺
 #define DATA_MODULE_TYPE (1) //1表示NB模块,2表示4G cat1
-#define BMS_INFO  (1)       //1-1表示超力源4830,1-2表示超力源6060,2-1表示美顺6455
+#define BMS_INFO  (2)       //1-1表示超力源4830,1-2表示超力源6060,2-1表示美顺6455
 
 #if  BMS_MANUFACTURE==1
     #if BMS_INFO==1
@@ -43,8 +43,8 @@ extern "C" {
 #define HWVERSION		    0x0102    //硬件主版本,现为V1.2板
 #define	BLSWVERSION		0x01020000    //BootLoader版本号V1.2.0.0
 #define	DRVSWVERSION		0x01040000     //驱动层版本号V1.4.0.0
-#define	APPSWVERSION		0x01020201     
-//#define	APPSWVERSION		0x02000003
+//#define	APPSWVERSION		0x01020201     
+#define	APPSWVERSION		0x02000004
 //--------------------------------------------------------------------------------
 
 #define APP_CONFIG_FILE_LATEST_VERSION 0

+ 1 - 1
src/CANTask.c

@@ -93,7 +93,7 @@ static void Can_Receive()
 					{								
 						if(CanRxMsg[i].Id == 0x7A0)
 						{	
-							#ifdef USING_PRINTF
+							#ifdef USING_PRINTF1
 								printf("ID = 0x%x\n",CanRxMsg[i].Id);
 								for(UINT8 j = 0; j<8;j++)
 								{

+ 11 - 4
src/MainTask.c

@@ -111,7 +111,7 @@ static void MainTask(void* arg)
         printf("%d ",*(pReadAppConfig+i));
     printf("\n");
     #endif
-    #ifdef USING_PRINTF
+    #ifdef USING_PRINTF1
     UINT8 *pReadAppData;
     UINT32 readCount;
     //AppConfigHeader    AppConfigHr;
@@ -227,12 +227,19 @@ static void MainTask(void* arg)
                     printf("which slpstate can go now :%d \n",slpstate);
                 #endif
                 slpManDeepSlpTimerStart(deepslpTimerID, AppNVMData.sleepTime*1000*60);
+                UINT8 sleeptime_count;
                 while(1)
                 {
-                    osDelay(20*60*1000/portTICK_PERIOD_MS);
-                    break;
+                    if(!slpManDeepSlpTimerIsRunning(deepslpTimerID))
+					    slpManDeepSlpTimerDel(deepslpTimerID);
+				    slpManDeepSlpTimerStart(deepslpTimerID, AppNVMData.sleepTime*1000*60);
+                    osDelay(1*60*1000/portTICK_PERIOD_MS);
+                    sleeptime_count++;
+                    if(sleeptime_count>5)
+                    {
+                        EC_SystemReset();
+                    }
                 }
-                PROC_MAIN_STATE_SWITCH(PROCESS_STATE_IDLE);
                 break;
             }
             default:

+ 1 - 1
src/UartTask.c

@@ -110,7 +110,7 @@ static void UartTask(void* arg)
 			{
 				UINT8 EncryptFlag=0x00;
 				UINT8 EncryptCount=0;
-				while(EncryptFlag!=0x01&&EncryptCount<=5)
+				while(EncryptFlag!=0x01&&EncryptCount<=3)
 				{
 					EncryptFlag = Uart_Encrypt_Send();
 					EncryptCount++;

+ 1 - 1
src/app.c

@@ -30,7 +30,7 @@
 #include "TcpTask.h"
 void appInit(void *arg)
 {
-    #ifdef USING_PRINTF	
+    #ifdef USING_PRINTF1	
     	printf("%s[%d]\r\n",__FUNCTION__, __LINE__);
     #endif
     MainTaskInit(arg);