Commit 71f49b74 authored by 陈家乐's avatar 陈家乐

🐞 fix:62817 故障码0不显示

parent b2270b14
......@@ -60,10 +60,10 @@ uint32_t Get_FaultCodeDtc1(void)
DTC1 |= DTCM1 & 0xF;
}
if (DTC1 == 0)
{
return 0XFFFF;
}
//if (DTC1 == 0)
//{
// return 0XFFFF;
//}
u16FaultCode = DTC1;
......@@ -347,6 +347,15 @@ void FaultCode_Service(uint16_t Cycle)
#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)
{
if((CodeList == NULL) || (Arr == NULL))
......@@ -372,6 +381,10 @@ uint8_t List_Find(FaultCodeList_t *CodeList, uint32_t FaultCode)
{
return 2;
}
if(List_GetNum(CodeList) == 0)
{
return 0;
}
for(int i=CodeList->hade; i<CodeList->tail; i++)
{
if(CodeList->code_list[i] == FaultCode)
......@@ -388,6 +401,10 @@ uint8_t List_add(FaultCodeList_t *CodeList, uint32_t FaultCode)
{
return 3;
}
if(FaultCode == 0)
{
return 4;//无效值:0
}
if((CodeList->tail+1) >= CodeList->len)
{
return 1;//列表满
......@@ -417,14 +434,7 @@ uint8_t List_Clear(FaultCodeList_t *CodeList)
//CodeList->code_num = 0;
return 0;
}
uint8_t List_GetNum(FaultCodeList_t *CodeList)
{
if(CodeList == NULL)
{
return 0;
}
return CodeList->tail - CodeList->hade;
}
uint16_t FaultTimeCount = 0;
......
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