Browse Source

BUC 对上一循环是否为定时唤醒判断的修改

tengfei.qi@fast-fun.com.cn 2 years ago
parent
commit
f75a6cc45d
3 changed files with 13 additions and 3 deletions
  1. 1 0
      inc/EmbeddedCoder_inc/BCUDisp.h
  2. 11 3
      src/EmbeddedCoder_src/BCU.c
  3. 1 0
      src/EmbeddedCoder_src/BCUDisp.c

+ 1 - 0
inc/EmbeddedCoder_inc/BCUDisp.h

@@ -5,6 +5,7 @@
 extern uint16_T appv_V_cellU[cmnc_num_cellUNumMax];                        /* 静态电压 */
 extern uint8_T appd_st_preCyc;
 
+extern boolean_T  bcud_flg_firstRun;
 extern boolean_T  spmd_flg_firstRun;
 extern boolean_T  socd_flg_firstRun;
 extern boolean_T  sohd_flg_firstRun;

+ 11 - 3
src/EmbeddedCoder_src/BCU.c

@@ -61,7 +61,6 @@ void BCU(void)
             ihd_tm_parkTime = BcuDataInfo.ihd_tm_parkTimeE;
 			BcuDataInfo.ihd_tm_parkTimeE = 0;
             BcuDataInfo.appDataModify = TRUE;
-            appd_st_preCyc = 1;
             PROC_BCU_STATE_SWITCH(PROCESS_STATE_WORK);
             break;
         }
@@ -153,10 +152,18 @@ void BCU(void)
                         memcpy(appv_V_cellU, sfmv_V_cellU, sizeof(sfmv_V_cellU));
                     }
 
-                    if (ihd_tm_parkTime < cmnc_tm_parkTime || BattWorkStateDelay != 0)
+                    if (ihd_st_wakeUpStat == 8)
                     {
-                        appd_st_preCyc = 0;
+						if (bcud_flg_firstRun)
+						{
+                           appd_st_preCyc = 1;
+						}
+						if(BattWorkStateDelay != 0)
+						{
+						   appd_st_preCyc = 0;
+                        }
                     }
+					bcud_flg_firstRun = false;
                 }
                 osDelay(100);
             }
@@ -202,6 +209,7 @@ void BCU(void)
 //========================算法初始化========================================
 void BCU_Init(void)
 {
+    bcud_flg_firstRun = true;
     SFM_Init();
     TMS_Init();
     CSM_Init();

+ 1 - 0
src/EmbeddedCoder_src/BCUDisp.c

@@ -4,6 +4,7 @@
 uint16_T appv_V_cellU[cmnc_num_cellUNumMax];                        /* 静态电压 */
 uint8_T  appd_st_preCyc;
 
+boolean_T bcud_flg_firstRun;
 boolean_T  spmd_flg_firstRun;
 boolean_T  socd_flg_firstRun;
 boolean_T  sohd_flg_firstRun;