Browse Source

Merge branch 'HuaLinVer' into BeiBenVer

# Conflicts:
#	System/Vehicle/AppFunc.c
#	System/Vehicle/AppFunc.h
#	System/Vehicle/AppVar.h
CHENJIE-PC\QiXiang_CHENJIE 2 years ago
parent
commit
43ab564626
3 changed files with 62 additions and 62 deletions
  1. 21 21
      System/Vehicle/AppFunc.c
  2. 3 3
      System/Vehicle/AppFunc.h
  3. 38 38
      System/Vehicle/AppVar.h

+ 21 - 21
System/Vehicle/AppFunc.c

@@ -3,9 +3,9 @@
  * @Date         : 2021-12-15 10:40:06
  * @Version      : V3.0
  * @LastEditors  : ChenJie
- * @LastEditTime : 2022-05-10 19:26:35
+ * @LastEditTime : 2022-05-17 19:27:00
  * @Description  : AppFunc
- * @FilePath     : \VehicleControl\VehicleControl\src\System\Vehicle\AppFunc.c
+ * @FilePath     : \undefinedd:\1_WorkFiles\2_Software\10_ReplaceBatteryControl\ECTEK_ToolChain\VehicleControl\VehicleControl\src\System\Vehicle\AppFunc.c
  */
 #include "string.h"
 #include "stdlib.h"
@@ -353,10 +353,10 @@ void FaultDiagnosisFunc(void)
 		sfmd_flg_Temp2Over2 = FALSE;
 		sfmd_flg_Temp3Over2 = FALSE;
 		sfmd_flg_Temp4Over2 = FALSE;
-		sfmd_flg_Temp1Over3 = getbit(sfmv_Num_FltEEsave,0);
-		sfmd_flg_Temp2Over3 = getbit(sfmv_Num_FltEEsave,1);
-		sfmd_flg_Temp3Over3 = getbit(sfmv_Num_FltEEsave,2);
-		sfmd_flg_Temp4Over3 = getbit(sfmv_Num_FltEEsave,3);
+		sfmd_flg_Temp1Over3 = getbit(sfmv_Num_FltEEsave, 0);
+		sfmd_flg_Temp2Over3 = getbit(sfmv_Num_FltEEsave, 1);
+		sfmd_flg_Temp3Over3 = getbit(sfmv_Num_FltEEsave, 2);
+		sfmd_flg_Temp4Over3 = getbit(sfmv_Num_FltEEsave, 3);
 	}
 	/*锁紧与解锁诊断*/
 	if (ebcd_st_SwitchCtrlFlg == Unlock) //解锁诊断
@@ -403,22 +403,22 @@ void FaultDiagnosisFunc(void)
 		ebcd_st_pedstSucJug = 2;
 	}
 	/*温度传感器开路诊断*/
-	sfmd_flg_Temp1Openflt = JudgeTimeSystem(1U, (ebcd_T_plugin[0] == 0), DiagErrFaulNum.DiagErrFaulN25, 5U);
-	sfmd_flg_Temp2Openflt = JudgeTimeSystem(1U, (ebcd_T_plugin[1] == 0), DiagErrFaulNum.DiagErrFaulN26, 5U);
-	sfmd_flg_Temp3Openflt = JudgeTimeSystem(1U, (ebcd_T_plugin[2] == 0), DiagErrFaulNum.DiagErrFaulN27, 5U);
-	sfmd_flg_Temp4Openflt = JudgeTimeSystem(1U, (ebcd_T_plugin[3] == 0), DiagErrFaulNum.DiagErrFaulN28, 5U);
+	sfmd_flg_Temp1Openflt = JudgeTimeSystem(1U, (ebcd_T_plugin[0] == 0), (UINT16 *)&DiagErrFaulNum.DiagErrFaulN25, 5U);
+	sfmd_flg_Temp2Openflt = JudgeTimeSystem(1U, (ebcd_T_plugin[1] == 0), (UINT16 *)&DiagErrFaulNum.DiagErrFaulN26, 5U);
+	sfmd_flg_Temp3Openflt = JudgeTimeSystem(1U, (ebcd_T_plugin[2] == 0), (UINT16 *)&DiagErrFaulNum.DiagErrFaulN27, 5U);
+	sfmd_flg_Temp4Openflt = JudgeTimeSystem(1U, (ebcd_T_plugin[3] == 0), (UINT16 *)&DiagErrFaulNum.DiagErrFaulN28, 5U);
 	/*温度传感器三级过温诊断*/
-	sfmd_flg_Temp1Over3 = DiagThrSystem1(1, !sfmd_flg_Temp1Openflt, ebcd_T_plugin[0], sfmd_Th_Temp1Over3Faul, sfmd_Th_Temp1Over3Reco, 30, 30, DiagErrFaulNum.DiagErrFaulN17, DiagErrRecoNum.DiagErrRecoN17, sfmd_flg_Temp1Over3);
-	sfmd_flg_Temp2Over3 = DiagThrSystem1(1, !sfmd_flg_Temp2Openflt, ebcd_T_plugin[1], sfmd_Th_Temp2Over3Faul, sfmd_Th_Temp2Over3Reco, 30, 30, DiagErrFaulNum.DiagErrFaulN18, DiagErrRecoNum.DiagErrRecoN18, sfmd_flg_Temp2Over3);
-	sfmd_flg_Temp3Over3 = DiagThrSystem1(1, !sfmd_flg_Temp3Openflt, ebcd_T_plugin[2], sfmd_Th_Temp3Over3Faul, sfmd_Th_Temp3Over3Reco, 30, 30, DiagErrFaulNum.DiagErrFaulN19, DiagErrRecoNum.DiagErrRecoN19, sfmd_flg_Temp3Over3);
-	sfmd_flg_Temp4Over3 = DiagThrSystem1(1, !sfmd_flg_Temp4Openflt, ebcd_T_plugin[3], sfmd_Th_Temp4Over3Faul, sfmd_Th_Temp4Over3Reco, 30, 30, DiagErrFaulNum.DiagErrFaulN20, DiagErrRecoNum.DiagErrRecoN20, sfmd_flg_Temp4Over3);
+	sfmd_flg_Temp1Over3 = DiagThrSystem1(1, !sfmd_flg_Temp1Openflt, ebcd_T_plugin[0], sfmd_Th_Temp1Over3Faul, sfmd_Th_Temp1Over3Reco, 30, 30, (UINT16 *)&DiagErrFaulNum.DiagErrFaulN17, (UINT16 *)&DiagErrRecoNum.DiagErrRecoN17, sfmd_flg_Temp1Over3);
+	sfmd_flg_Temp2Over3 = DiagThrSystem1(1, !sfmd_flg_Temp2Openflt, ebcd_T_plugin[1], sfmd_Th_Temp2Over3Faul, sfmd_Th_Temp2Over3Reco, 30, 30, (UINT16 *)&DiagErrFaulNum.DiagErrFaulN18, (UINT16 *)&DiagErrRecoNum.DiagErrRecoN18, sfmd_flg_Temp2Over3);
+	sfmd_flg_Temp3Over3 = DiagThrSystem1(1, !sfmd_flg_Temp3Openflt, ebcd_T_plugin[2], sfmd_Th_Temp3Over3Faul, sfmd_Th_Temp3Over3Reco, 30, 30, (UINT16 *)&DiagErrFaulNum.DiagErrFaulN19, (UINT16 *)&DiagErrRecoNum.DiagErrRecoN19, sfmd_flg_Temp3Over3);
+	sfmd_flg_Temp4Over3 = DiagThrSystem1(1, !sfmd_flg_Temp4Openflt, ebcd_T_plugin[3], sfmd_Th_Temp4Over3Faul, sfmd_Th_Temp4Over3Reco, 30, 30, (UINT16 *)&DiagErrFaulNum.DiagErrFaulN20, (UINT16 *)&DiagErrRecoNum.DiagErrRecoN20, sfmd_flg_Temp4Over3);
 	/*温度传感器二级过温诊断*/
-	sfmd_flg_Temp1Over2 = DiagThrSystem1(1, !sfmd_flg_Temp1Over3 && !sfmd_flg_Temp1Openflt, ebcd_T_plugin[0], sfmd_Th_Temp1Over2Faul, sfmd_Th_Temp1Over2Reco, 30, 30, DiagErrFaulNum.DiagErrFaulN9, DiagErrRecoNum.DiagErrRecoN9, sfmd_flg_Temp1Over2);
-	sfmd_flg_Temp2Over2 = DiagThrSystem1(1, !sfmd_flg_Temp2Over3 && !sfmd_flg_Temp2Openflt, ebcd_T_plugin[1], sfmd_Th_Temp2Over2Faul, sfmd_Th_Temp2Over2Reco, 30, 30, DiagErrFaulNum.DiagErrFaulN10, DiagErrRecoNum.DiagErrRecoN10, sfmd_flg_Temp2Over2);
-	sfmd_flg_Temp3Over2 = DiagThrSystem1(1, !sfmd_flg_Temp3Over3 && !sfmd_flg_Temp3Openflt, ebcd_T_plugin[2], sfmd_Th_Temp3Over2Faul, sfmd_Th_Temp3Over2Reco, 30, 30, DiagErrFaulNum.DiagErrFaulN11, DiagErrRecoNum.DiagErrRecoN11, sfmd_flg_Temp3Over2);
-	sfmd_flg_Temp4Over2 = DiagThrSystem1(1, !sfmd_flg_Temp4Over3 && !sfmd_flg_Temp4Openflt, ebcd_T_plugin[3], sfmd_Th_Temp4Over2Faul, sfmd_Th_Temp4Over2Reco, 30, 30, DiagErrFaulNum.DiagErrFaulN12, DiagErrRecoNum.DiagErrRecoN12, sfmd_flg_Temp4Over2);
+	sfmd_flg_Temp1Over2 = DiagThrSystem1(1, !sfmd_flg_Temp1Over3 && !sfmd_flg_Temp1Openflt, ebcd_T_plugin[0], sfmd_Th_Temp1Over2Faul, sfmd_Th_Temp1Over2Reco, 30, 30, (UINT16 *)&DiagErrFaulNum.DiagErrFaulN9, (UINT16 *)&DiagErrRecoNum.DiagErrRecoN9, sfmd_flg_Temp1Over2);
+	sfmd_flg_Temp2Over2 = DiagThrSystem1(1, !sfmd_flg_Temp2Over3 && !sfmd_flg_Temp2Openflt, ebcd_T_plugin[1], sfmd_Th_Temp2Over2Faul, sfmd_Th_Temp2Over2Reco, 30, 30, (UINT16 *)&DiagErrFaulNum.DiagErrFaulN10, (UINT16 *)&DiagErrRecoNum.DiagErrRecoN10, sfmd_flg_Temp2Over2);
+	sfmd_flg_Temp3Over2 = DiagThrSystem1(1, !sfmd_flg_Temp3Over3 && !sfmd_flg_Temp3Openflt, ebcd_T_plugin[2], sfmd_Th_Temp3Over2Faul, sfmd_Th_Temp3Over2Reco, 30, 30, (UINT16 *)&DiagErrFaulNum.DiagErrFaulN11, (UINT16 *)&DiagErrRecoNum.DiagErrRecoN11, sfmd_flg_Temp3Over2);
+	sfmd_flg_Temp4Over2 = DiagThrSystem1(1, !sfmd_flg_Temp4Over3 && !sfmd_flg_Temp4Openflt, ebcd_T_plugin[3], sfmd_Th_Temp4Over2Faul, sfmd_Th_Temp4Over2Reco, 30, 30, (UINT16 *)&DiagErrFaulNum.DiagErrFaulN12, (UINT16 *)&DiagErrRecoNum.DiagErrRecoN12, sfmd_flg_Temp4Over2);
 
-	sfmv_Num_FltEEsave = ((sfmd_flg_Temp4Over3&0x01)<<3)|((sfmd_flg_Temp3Over3&0x01)<<2)|((sfmd_flg_Temp2Over3&0x01)<<1)|(sfmd_flg_Temp1Over3);
+	sfmv_Num_FltEEsave = ((sfmd_flg_Temp4Over3 & 0x01) << 3) | ((sfmd_flg_Temp3Over3 & 0x01) << 2) | ((sfmd_flg_Temp2Over3 & 0x01) << 1) | (sfmd_flg_Temp1Over3);
 	/*故障代码写入*/
 	if (sfmd_flg_Temp1Openflt)
 	{
@@ -501,12 +501,12 @@ void FaultDiagnosisFunc(void)
  * @param {UINT16} Thr 判断次数阈值
  * @return {*}
  */
-BOOL JudgeTimeSystem(BOOL Enable, BOOL Input, UINT8 *N, UINT8 Thr)
+BOOL JudgeTimeSystem(BOOL Enable, BOOL Input, UINT16 *N, UINT16 Thr)
 {
 	BOOL Flg = FALSE;
 	if (Input && Enable)
 	{
-		*N = (*N + 1) > 2008 ? 2008 : (*N + 1);
+		*N = (*N + 1) > 2000 ? 2000 : (*N + 1);
 	}
 	else
 	{

+ 3 - 3
System/Vehicle/AppFunc.h

@@ -3,9 +3,9 @@
  * @Date         : 2021-12-15 10:42:35
  * @Version      : V3.0
  * @LastEditors  : ChenJie
- * @LastEditTime : 2022-05-10 18:56:12
+ * @LastEditTime : 2022-05-17 19:25:55
  * @Description  :  AppFuncion.h
- * @FilePath     : \VehicleControl\VehicleControl\src\System\Vehicle\AppFunc.h
+ * @FilePath     : \undefinedd:\1_WorkFiles\2_Software\10_ReplaceBatteryControl\ECTEK_ToolChain\VehicleControl\VehicleControl\src\System\Vehicle\AppFunc.h
  */
 /*
  * AppFuncion.h
@@ -23,7 +23,7 @@ void GetAIOValue(void);
 void LockAndUnlockCtrl();
 uint16 Look1_u32u8(uint32 u0, uint32 *bp0, uint8 *table, uint16 MaxLen);
 void FaultDiagnosisFunc(void);
-BOOL JudgeTimeSystem(BOOL Enable, BOOL Input, UINT8 *N, UINT8 Thr);
+BOOL JudgeTimeSystem(BOOL Enable, BOOL Input, UINT16 *N, UINT16 Thr);
 BOOL DiagThrSystem1(BOOL Enable, BOOL precondition, UINT16 Input, UINT16 fltThr, UINT16 recThr, UINT16 fltNumThr, UINT16 recNumThr, UINT16 *fltNum, UINT16 *recNum, UINT8 *fitFlg);
 UINT16 GetErrorNum(UINT16 *ErrorArray, UINT8 Errorlen);
 UINT8 PutErrorNum(UINT16 *ErrorArray, UINT8 Errorlen, UINT16 ErrorNum);

+ 38 - 38
System/Vehicle/AppVar.h

@@ -3,54 +3,54 @@
  * @Date         : 2022-05-10 10:20:28
  * @Version      : V3.0
  * @LastEditors  : ChenJie
- * @LastEditTime : 2022-05-10 20:08:06
+ * @LastEditTime : 2022-05-17 19:25:27
  * @Description  : file content ±ê¶¨±äÁ¿
- * @FilePath     : \VehicleControl\VehicleControl\src\System\Vehicle\AppVar.h
+ * @FilePath     : \undefinedd:\1_WorkFiles\2_Software\10_ReplaceBatteryControl\ECTEK_ToolChain\VehicleControl\VehicleControl\src\System\Vehicle\AppVar.h
  */
 #include "Std_Types.h"
 #include "HardwareLib.h"
 typedef struct
 {
-    UINT8 DiagErrFaulN9;
-    UINT8 DiagErrFaulN10;
-    UINT8 DiagErrFaulN11;
-    UINT8 DiagErrFaulN12;
-    UINT8 DiagErrFaulN13;
-    UINT8 DiagErrFaulN14;
-    UINT8 DiagErrFaulN15;
-    UINT8 DiagErrFaulN16;
-    UINT8 DiagErrFaulN17;
-    UINT8 DiagErrFaulN18;
-    UINT8 DiagErrFaulN19;
-    UINT8 DiagErrFaulN20;
-    UINT8 DiagErrFaulN21;
-    UINT8 DiagErrFaulN22;
-    UINT8 DiagErrFaulN23;
-    UINT8 DiagErrFaulN24;
-    UINT8 DiagErrFaulN25;
-    UINT8 DiagErrFaulN26;
-    UINT8 DiagErrFaulN27;
-    UINT8 DiagErrFaulN28;
+    UINT16 DiagErrFaulN9;
+    UINT16 DiagErrFaulN10;
+    UINT16 DiagErrFaulN11;
+    UINT16 DiagErrFaulN12;
+    UINT16 DiagErrFaulN13;
+    UINT16 DiagErrFaulN14;
+    UINT16 DiagErrFaulN15;
+    UINT16 DiagErrFaulN16;
+    UINT16 DiagErrFaulN17;
+    UINT16 DiagErrFaulN18;
+    UINT16 DiagErrFaulN19;
+    UINT16 DiagErrFaulN20;
+    UINT16 DiagErrFaulN21;
+    UINT16 DiagErrFaulN22;
+    UINT16 DiagErrFaulN23;
+    UINT16 DiagErrFaulN24;
+    UINT16 DiagErrFaulN25;
+    UINT16 DiagErrFaulN26;
+    UINT16 DiagErrFaulN27;
+    UINT16 DiagErrFaulN28;
 } DiagErrFaulNum_t;
 
 typedef struct
 {
-    UINT8 DiagErrRecoN9;
-    UINT8 DiagErrRecoN10;
-    UINT8 DiagErrRecoN11;
-    UINT8 DiagErrRecoN12;
-    UINT8 DiagErrRecoN13;
-    UINT8 DiagErrRecoN14;
-    UINT8 DiagErrRecoN15;
-    UINT8 DiagErrRecoN16;
-    UINT8 DiagErrRecoN17;
-    UINT8 DiagErrRecoN18;
-    UINT8 DiagErrRecoN19;
-    UINT8 DiagErrRecoN20;
-    UINT8 DiagErrRecoN21;
-    UINT8 DiagErrRecoN22;
-    UINT8 DiagErrRecoN23;
-    UINT8 DiagErrRecoN24;
+    UINT16 DiagErrRecoN9;
+    UINT16 DiagErrRecoN10;
+    UINT16 DiagErrRecoN11;
+    UINT16 DiagErrRecoN12;
+    UINT16 DiagErrRecoN13;
+    UINT16 DiagErrRecoN14;
+    UINT16 DiagErrRecoN15;
+    UINT16 DiagErrRecoN16;
+    UINT16 DiagErrRecoN17;
+    UINT16 DiagErrRecoN18;
+    UINT16 DiagErrRecoN19;
+    UINT16 DiagErrRecoN20;
+    UINT16 DiagErrRecoN21;
+    UINT16 DiagErrRecoN22;
+    UINT16 DiagErrRecoN23;
+    UINT16 DiagErrRecoN24;
 } DiagErrRecoNum_t;
 /*ConstVar*/
 extern const UINT8 sfmd_Th_Temp1Over2Faul;