|
@@ -35,7 +35,7 @@ void SOH(void)
|
|
|
uint16_T SumQ;
|
|
|
//
|
|
|
static uint16_T sohn_V_chrgStartStat[cmnc_num_cellUNumMax];
|
|
|
- static uint8_T ihd_st_workStat_Delay;
|
|
|
+ static uint8_T sohn_st_workStat_Delay;
|
|
|
static boolean_T sohn_flg_chrgEnd_Delay;
|
|
|
boolean_T sohn_flg_chrgEnd;
|
|
|
//
|
|
@@ -51,12 +51,25 @@ void SOH(void)
|
|
|
sfmn_flg_currFlt_keep = false;
|
|
|
sohn_flg_currFlt = false;
|
|
|
Ahincr = 0;
|
|
|
- ihd_st_workStat_Delay = 0;
|
|
|
- sohn_flg_chrgEnd_Delay = false;
|
|
|
- memset(sohv_V_chrgStartStatEo,0, sizeof(sohv_V_chrgStartStatEo));
|
|
|
- sohd_Q_chrgEo = 0 ;
|
|
|
- sohd_flg_chrgEndEo = false;
|
|
|
+ sohn_st_workStat_Delay = 0;
|
|
|
+ if(ihd_st_reSet == 1)
|
|
|
+ {
|
|
|
+ memcpy(sohv_V_chrgStartStatEo,sohv_V_chrgStartStatEi, sizeof(sohv_V_chrgStartStatEo));
|
|
|
+ sohd_Q_chrgEo = sohd_Q_chrgEi;
|
|
|
+ sohd_flg_chrgEndEo = sohd_flg_chrgEndEi;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ memset(sohv_V_chrgStartStatEo,0, sizeof(sohv_V_chrgStartStatEo));
|
|
|
+ sohd_Q_chrgEo = 0 ;
|
|
|
+ sohd_flg_chrgEndEo = 0;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
if(FirstRun_SOH)
|
|
|
{
|
|
@@ -156,7 +169,7 @@ void SOH(void)
|
|
|
memcpy(sohv_Q_cellCapArrEo,sohn_Q_cellCapArrEE, sizeof(sohv_Q_cellCapArrEo));
|
|
|
}
|
|
|
memcpy(sohv_Q_cellCap,sohv_Q_cellCapArrEo, sizeof(sohv_Q_cellCapArrEo));
|
|
|
- // printf("sohv_Q_cellCapArrEo[16]:%d,update:%d,En:%d\n",sohv_Q_cellCapArrEo[16],sohn_flg_update,sohn_flg_countEn);
|
|
|
+
|
|
|
|
|
|
SumQ = 0;
|
|
|
for(i = 0; i < 10;i++)
|
|
@@ -180,7 +193,7 @@ void SOH(void)
|
|
|
memcpy(sohn_V_chrgStartStat,sfmv_V_cellU, sizeof(sfmv_V_cellU));
|
|
|
}
|
|
|
//
|
|
|
- if((ihd_st_workStat == 2) && (ihd_st_workStat_Delay != 2))
|
|
|
+ if((ihd_st_workStat == 2) && (sohn_st_workStat_Delay != 2))
|
|
|
{
|
|
|
memcpy(sohv_V_chrgStartStatEo,sohn_V_chrgStartStat, sizeof(sohv_V_chrgStartStatEo));
|
|
|
}
|
|
@@ -211,23 +224,22 @@ void SOH(void)
|
|
|
//=======================================================================================
|
|
|
//----------------------充电结速信息------------------------------------------------------
|
|
|
//=======================================================================================
|
|
|
- if((ihd_st_workStat != 2) && (ihd_st_workStat_Delay == 2))
|
|
|
+ if((ihd_st_workStat != 2) && (sohn_st_workStat_Delay == 2))
|
|
|
{
|
|
|
- sohn_flg_chrgEnd = true;
|
|
|
+ sohd_flg_chrgEndEo = true;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- sohn_flg_chrgEnd = ( sfmd_I_curr < 10 && sfmd_I_curr > -10) && sohn_flg_chrgEnd_Delay;
|
|
|
+ sohd_flg_chrgEndEo = ( sfmd_I_curr < 10 && sfmd_I_curr > -10) && sohd_flg_chrgEndEo;
|
|
|
}
|
|
|
-
|
|
|
- sohn_flg_chrgEnd_Delay = sohn_flg_chrgEnd;
|
|
|
- sohd_flg_chrgEndEo = !sohn_flg_currFlt && sohn_flg_chrgEnd;
|
|
|
- ihd_st_workStat_Delay = ihd_st_workStat;
|
|
|
+ sohd_flg_chrgEndEo = !sohn_flg_currFlt && sohd_flg_chrgEndEo;
|
|
|
+
|
|
|
+ //
|
|
|
+ sohn_st_workStat_Delay = ihd_st_workStat;
|
|
|
FirstRun_SOH = false;
|
|
|
- //printf("sohd_flg_chrgEndEo:%d\n",sohd_flg_chrgEndEo);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
-
|
|
|
////////////////////////////////////////////////////////////////
|
|
|
uint16_T ArrMax(uint16_T *Data, uint16_T m)
|
|
|
{
|