|
@@ -3,9 +3,9 @@
|
|
* @Date : 2021-12-15 10:40:06
|
|
* @Date : 2021-12-15 10:40:06
|
|
* @Version : V3.0
|
|
* @Version : V3.0
|
|
* @LastEditors : ChenJie
|
|
* @LastEditors : ChenJie
|
|
- * @LastEditTime : 2022-05-10 19:26:35
|
|
|
|
|
|
+ * @LastEditTime : 2022-05-17 19:27:00
|
|
* @Description : AppFunc
|
|
* @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 "string.h"
|
|
#include "stdlib.h"
|
|
#include "stdlib.h"
|
|
@@ -353,10 +353,10 @@ void FaultDiagnosisFunc(void)
|
|
sfmd_flg_Temp2Over2 = FALSE;
|
|
sfmd_flg_Temp2Over2 = FALSE;
|
|
sfmd_flg_Temp3Over2 = FALSE;
|
|
sfmd_flg_Temp3Over2 = FALSE;
|
|
sfmd_flg_Temp4Over2 = 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) //解锁诊断
|
|
if (ebcd_st_SwitchCtrlFlg == Unlock) //解锁诊断
|
|
@@ -403,22 +403,22 @@ void FaultDiagnosisFunc(void)
|
|
ebcd_st_pedstSucJug = 2;
|
|
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)
|
|
if (sfmd_flg_Temp1Openflt)
|
|
{
|
|
{
|
|
@@ -501,12 +501,12 @@ void FaultDiagnosisFunc(void)
|
|
* @param {UINT16} Thr 判断次数阈值
|
|
* @param {UINT16} Thr 判断次数阈值
|
|
* @return {*}
|
|
* @return {*}
|
|
*/
|
|
*/
|
|
-BOOL JudgeTimeSystem(BOOL Enable, BOOL Input, UINT8 *N, UINT8 Thr)
|
|
|
|
|
|
+BOOL JudgeTimeSystem(BOOL Enable, BOOL Input, UINT16 *N, UINT16 Thr)
|
|
{
|
|
{
|
|
BOOL Flg = FALSE;
|
|
BOOL Flg = FALSE;
|
|
if (Input && Enable)
|
|
if (Input && Enable)
|
|
{
|
|
{
|
|
- *N = (*N + 1) > 2008 ? 2008 : (*N + 1);
|
|
|
|
|
|
+ *N = (*N + 1) > 2000 ? 2000 : (*N + 1);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|