Commit e0f90aa6 authored by 张金硕's avatar 张金硕

feat:新增故障码显16进制接口

parent bf741393
...@@ -160,7 +160,7 @@ TEXT_STRUCT TextPara[TEXT_NUM_TOTAL] = ...@@ -160,7 +160,7 @@ TEXT_STRUCT TextPara[TEXT_NUM_TOTAL] =
{TEXT_NUM_INFORMATION_HW, 0x4014, 0}, //23F 23E {TEXT_NUM_INFORMATION_HW, 0x4014, 0}, //23F 23E
{TEXT_NUM_INFORMATION_OS, 0x4015, 0}, {TEXT_NUM_INFORMATION_OS, 0x4015, 0},
{TEXT_NUM_INFORMATION_MCU, 0x4016, 0}, {TEXT_NUM_INFORMATION_MCU, 0x4016, 0},
{TEXT_NUM_ROAD_NAME, 0x4022, 0}, {TEXT_NUM_FAUULT_CODE, 0x4022, 0},
}; };
...@@ -173,6 +173,7 @@ uint8_t LastBlueToothName[20]; ...@@ -173,6 +173,7 @@ uint8_t LastBlueToothName[20];
uint8_t PhoneNumberTotal[20]; uint8_t PhoneNumberTotal[20];
uint8_t InformationOSVersion[20]; uint8_t InformationOSVersion[20];
uint8_t InformationMCUVersion[26]; uint8_t InformationMCUVersion[26];
uint8_t TextFaultCodeNum[10];
void TextService(void) void TextService(void)
{ {
...@@ -215,6 +216,7 @@ void TextService(void) ...@@ -215,6 +216,7 @@ void TextService(void)
memset(BlueToothName, 0, sizeof(BlueToothName)); memset(BlueToothName, 0, sizeof(BlueToothName));
memset(LastBlueToothName, 0, sizeof(LastBlueToothName)); memset(LastBlueToothName, 0, sizeof(LastBlueToothName));
memset(PhoneNumberTotal, 0, sizeof(PhoneNumberTotal)); memset(PhoneNumberTotal, 0, sizeof(PhoneNumberTotal));
memset(TextFaultCodeNum, 0, sizeof(TextFaultCodeNum));
for (uint8_t i = 0; i < sizeof(OSVersionASCLLList); i++) for (uint8_t i = 0; i < sizeof(OSVersionASCLLList); i++)
{ {
...@@ -284,6 +286,63 @@ void TextService(void) ...@@ -284,6 +286,63 @@ void TextService(void)
TextPara[TEXT_NUM_PHONE_NUMBER_TOTAL].Vaild = 0x01; TextPara[TEXT_NUM_PHONE_NUMBER_TOTAL].Vaild = 0x01;
LastPhoneBookTotalCount = BlueToothPhoneData.PhoneBookTotalCount; LastPhoneBookTotalCount = BlueToothPhoneData.PhoneBookTotalCount;
} }
if(CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CH0_402_Msg_Count) == CAN_SIG_LOST)
{
;
}
else
{
uint8_t FaultCodeNumCnts = 0;
uint8_t FaultCodeHighNum = 0;
uint8_t FaultCodeMidNum = 0;
FaultCodeHighNum = Get_Current_Hight_FaultCode();
FaultCodeMidNum = Get_Current_Mid_FaultCode();
TextFaultCodeNum[FaultCodeNumCnts++] = 0x50;
TextFaultCodeNum[FaultCodeNumCnts++] = 0x00;
if((((FaultCodeHighNum)&(0xF0)) >> 4)<10)
{
TextFaultCodeNum[FaultCodeNumCnts++] = (((FaultCodeHighNum)&(0xF0)) >> 4) + 0x30;
TextFaultCodeNum[FaultCodeNumCnts++] = 0x00;
}
else
{
TextFaultCodeNum[FaultCodeNumCnts++] = ((((FaultCodeHighNum)&(0xF0)) >> 4) % 10) + 0x41;
TextFaultCodeNum[FaultCodeNumCnts++] = 0x00;
}
if((((FaultCodeHighNum)&(0x0F)))<10)
{
TextFaultCodeNum[FaultCodeNumCnts++] = ((FaultCodeHighNum)&(0x0F)) + 0x30;
TextFaultCodeNum[FaultCodeNumCnts++] = 0x00;
}
else
{
TextFaultCodeNum[FaultCodeNumCnts++] = (((FaultCodeHighNum)&(0x0F)) % 10) + 0x41;
TextFaultCodeNum[FaultCodeNumCnts++] = 0x00;
}
if((((FaultCodeMidNum)&(0xF0)) >> 4)<10)
{
TextFaultCodeNum[FaultCodeNumCnts++] = (((FaultCodeMidNum)&(0xF0)) >> 4) + 0x30;
TextFaultCodeNum[FaultCodeNumCnts++] = 0x00;
}
else
{
TextFaultCodeNum[FaultCodeNumCnts++] = ((((FaultCodeMidNum)&(0xF0)) >> 4) % 10) + 0x41;
TextFaultCodeNum[FaultCodeNumCnts++] = 0x00;
}
if((((FaultCodeMidNum)&(0x0F)))<10)
{
TextFaultCodeNum[FaultCodeNumCnts++] = ((FaultCodeMidNum)&(0x0F)) + 0x30;
TextFaultCodeNum[FaultCodeNumCnts++] = 0x00;
}
else
{
TextFaultCodeNum[FaultCodeNumCnts++] = (((FaultCodeMidNum)&(0x0F)) % 10) + 0x41;
TextFaultCodeNum[FaultCodeNumCnts++] = 0x00;
}
TextPara[TEXT_NUM_FAUULT_CODE].Vaild = 0x01;
}
} }
...@@ -13,7 +13,7 @@ typedef enum { ...@@ -13,7 +13,7 @@ typedef enum {
TEXT_NUM_INFORMATION_HW, TEXT_NUM_INFORMATION_HW,
TEXT_NUM_INFORMATION_OS, TEXT_NUM_INFORMATION_OS,
TEXT_NUM_INFORMATION_MCU, TEXT_NUM_INFORMATION_MCU,
TEXT_NUM_ROAD_NAME, TEXT_NUM_FAUULT_CODE,
TEXT_NUM_TOTAL, TEXT_NUM_TOTAL,
} TEXT_NUM_ENUM; } TEXT_NUM_ENUM;
...@@ -47,6 +47,7 @@ extern uint8_t BlueToothName[40]; ...@@ -47,6 +47,7 @@ extern uint8_t BlueToothName[40];
extern uint8_t PhoneNumberTotal[20]; extern uint8_t PhoneNumberTotal[20];
extern uint8_t InformationOSVersion[20]; extern uint8_t InformationOSVersion[20];
extern uint8_t InformationMCUVersion[26]; extern uint8_t InformationMCUVersion[26];
extern uint8_t TextFaultCodeNum[10];
extern TEXT_STRUCT TextPara[]; extern TEXT_STRUCT TextPara[];
#endif #endif
\ No newline at end of file
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