Commit 8b83a86c authored by 高士达's avatar 高士达

Merge branch 'dev' into 'release'

Dev

See merge request ty/tianying_ty100!101
parents 98b0f9b3 acf24cb3
...@@ -60,10 +60,10 @@ uint32_t Get_FaultCodeDtc1(void) ...@@ -60,10 +60,10 @@ uint32_t Get_FaultCodeDtc1(void)
DTC1 |= DTCM1 & 0xF; DTC1 |= DTCM1 & 0xF;
} }
if (DTC1 == 0) //if (DTC1 == 0)
{ //{
return 0XFFFF; // return 0XFFFF;
} //}
u16FaultCode = DTC1; u16FaultCode = DTC1;
...@@ -347,6 +347,15 @@ void FaultCode_Service(uint16_t Cycle) ...@@ -347,6 +347,15 @@ void FaultCode_Service(uint16_t Cycle)
#if 1 #if 1
uint8_t List_GetNum(FaultCodeList_t *CodeList)
{
if(CodeList == NULL)
{
return 0;
}
return CodeList->tail - CodeList->hade;
}
uint8_t List_Init(FaultCodeList_t *CodeList, uint32_t Arr[], uint8_t Len) uint8_t List_Init(FaultCodeList_t *CodeList, uint32_t Arr[], uint8_t Len)
{ {
if((CodeList == NULL) || (Arr == NULL)) if((CodeList == NULL) || (Arr == NULL))
...@@ -372,6 +381,10 @@ uint8_t List_Find(FaultCodeList_t *CodeList, uint32_t FaultCode) ...@@ -372,6 +381,10 @@ uint8_t List_Find(FaultCodeList_t *CodeList, uint32_t FaultCode)
{ {
return 2; return 2;
} }
if(List_GetNum(CodeList) == 0)
{
return 0;
}
for(int i=CodeList->hade; i<CodeList->tail; i++) for(int i=CodeList->hade; i<CodeList->tail; i++)
{ {
if(CodeList->code_list[i] == FaultCode) if(CodeList->code_list[i] == FaultCode)
...@@ -388,6 +401,10 @@ uint8_t List_add(FaultCodeList_t *CodeList, uint32_t FaultCode) ...@@ -388,6 +401,10 @@ uint8_t List_add(FaultCodeList_t *CodeList, uint32_t FaultCode)
{ {
return 3; return 3;
} }
if(FaultCode == 0)
{
return 4;//无效值:0
}
if((CodeList->tail+1) >= CodeList->len) if((CodeList->tail+1) >= CodeList->len)
{ {
return 1;//列表满 return 1;//列表满
...@@ -417,14 +434,7 @@ uint8_t List_Clear(FaultCodeList_t *CodeList) ...@@ -417,14 +434,7 @@ uint8_t List_Clear(FaultCodeList_t *CodeList)
//CodeList->code_num = 0; //CodeList->code_num = 0;
return 0; return 0;
} }
uint8_t List_GetNum(FaultCodeList_t *CodeList)
{
if(CodeList == NULL)
{
return 0;
}
return CodeList->tail - CodeList->hade;
}
uint16_t FaultTimeCount = 0; uint16_t FaultTimeCount = 0;
......
...@@ -123,7 +123,7 @@ static void Power_Wakeup_Init(void) ...@@ -123,7 +123,7 @@ static void Power_Wakeup_Init(void)
Sys_WakeUp_Init(); Sys_WakeUp_Init();
Data_TPMS_KL15_WAKE_UP_Init(); Data_TPMS_KL15_WAKE_UP_Init();
//CAN_TX_Count_Init(); CAN_TX_Count_Init();
CAN_TX_Init(); CAN_TX_Init();
//CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Enable); //CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Enable);
...@@ -161,6 +161,7 @@ static void Power_Wakeup_Init(void) ...@@ -161,6 +161,7 @@ static void Power_Wakeup_Init(void)
Common_DataInit(); Common_DataInit();
Power_KL30_Init_flag = 1; Power_KL30_Init_flag = 1;
AliveCount_KL30_ResettingFlag = 1;
} }
static void Power_LVP_Init(void) static void Power_LVP_Init(void)
...@@ -176,18 +177,20 @@ static void Power_IG_OFF_Init(void) ...@@ -176,18 +177,20 @@ static void Power_IG_OFF_Init(void)
{ {
Line_In_KL15_OFF_Init(); Line_In_KL15_OFF_Init();
Checkself_Init(); Checkself_Init();
Common_Input_Para();
//CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Disable); //CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Disable);
} }
static void Power_IG_ON_Init(void) static void Power_IG_ON_Init(void)
{ {
Checkself_Init(); CAN_TX_Count_Init();
Checkself_Init();
Line_In_KL15_ON_Init(); Line_In_KL15_ON_Init();
Telltales_KL15_Init(); Telltales_KL15_Init();
Telltales_UserInit(); Telltales_UserInit();
Fuel_KL15_Init(); Fuel_KL15_Init();
Data_Voltage_Init(); Data_Voltage_Init();
MenuData_TCS_Init(); MenuData_TCS_Init();
Data_Coolant_Temp_KL15_Init(); Data_Coolant_Temp_KL15_Init();
BlueTooth_KL30_KL15_Wakeup_Init(); BlueTooth_KL30_KL15_Wakeup_Init();
Data_TPMS_KL15_WAKE_UP_Init(); Data_TPMS_KL15_WAKE_UP_Init();
...@@ -196,7 +199,7 @@ static void Power_IG_ON_Init(void) ...@@ -196,7 +199,7 @@ static void Power_IG_ON_Init(void)
Data_Read_DiagPara(); Data_Read_DiagPara();
FaultCode_Init(); FaultCode_Init();
CAN_TX_Count_Init();
} }
static void Power_Sleep_Init(void) static void Power_Sleep_Init(void)
......
...@@ -312,13 +312,13 @@ ...@@ -312,13 +312,13 @@
#define CheckSumErr 7 // Checksum Error #define CheckSumErr 7 // Checksum Error
#define UnknownPartID 8 // Unknown Part ID #define UnknownPartID 8 // Unknown Part ID
#define SWV 0x122 // 0x100 = 1.00 software version 软件版本号 #define SWV 0x123 // 0x100 = 1.00 software version 软件版本号
#define HWV 0x103 // 0x100 = 1.00 hardware version 硬件版本号 #define HWV 0x103 // 0x100 = 1.00 hardware version 硬件版本号
#define BTV 0x100 // 0x100 = 1.00 bootloader version boot程序版本号 #define BTV 0x100 // 0x100 = 1.00 bootloader version boot程序版本号
#define INTLV 0x122 // 0x100 = 1.00 internal version 内部版本号 #define INTLV 0x123 // 0x100 = 1.00 internal version 内部版本号
#define PROG_Y 0x24 // 0x24 = 2024年, program year #define PROG_Y 0x24 // 0x24 = 2024年, program year
#define PROG_M 0x09 // 0x03 = 3月, program month #define PROG_M 0x09 // 0x03 = 3月, program month
#define PROG_D 0x19 // 0x19 = 19日, program day #define PROG_D 0x21 // 0x19 = 19日, program day
/****************************************************************************** /******************************************************************************
Bootloader Variable Bootloader Variable
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment