Commit f7898c9f authored by hu's avatar hu

调整胎压显示

parent 67e3471a
No preview for this file type
This diff is collapsed.
project .intvect 1536
project .text 309356
project .text 311500
project .rodata 410815
project .secinfo 120
project .syscall 6
......
......@@ -16,6 +16,7 @@ void Data_TPMS_KL30_Init(void)
{
TPMS_Out[FirstLOut].TPMSTyreID = FirstLOutID ;
TPMS_Out[FirstROut].TPMSTyreID = FirstROutID ;
TPMS_Out[SecondLIn].TPMSTyreID = SecondLInID ;
TPMS_Out[SecondRIn].TPMSTyreID = SecondRInID ;
......@@ -30,10 +31,9 @@ void Data_TPMS_KL30_Init(void)
TPMS_Out[FourthRIn].TPMSTyreID = FourthRInID ;
TPMS_Out[FirstLOut].TPMSDataInvalidTime = 600u;
TPMS_Out[FirstROut].TPMSDataInvalidTime = 600u;
TPMS_Out[SecondLIn].TPMSDataInvalidTime = 600u;
TPMS_Out[SecondRIn].TPMSDataInvalidTime = 600u;
......@@ -47,8 +47,10 @@ void Data_TPMS_KL30_Init(void)
TPMS_Out[FourthROut].TPMSDataInvalidTime = 600u;
TPMS_Out[FourthRIn].TPMSDataInvalidTime = 600u;
TPMS_Out[FirstLOut].TPMSGuiSta = SOLID_GRAY;
TPMS_Out[FirstROut].TPMSGuiSta = SOLID_GRAY;
TPMS_Out[SecondLIn].TPMSGuiSta = SOLID_GRAY;
TPMS_Out[SecondRIn].TPMSGuiSta = SOLID_GRAY;
......@@ -82,13 +84,9 @@ void Data_TPMS_Value_Processing(void)
{
/*报文数据获取,处理*/
Get_Data_TPMS_Value(FirstLOut);
Get_Data_TPMS_Value(FirstROut);
Get_Data_TPMS_Value(SecondLIn);
Get_Data_TPMS_Value(SecondRIn);
Get_Data_TPMS_Value(ThirdLOut);
......@@ -103,12 +101,9 @@ void Data_TPMS_Value_Processing(void)
/*报文状态获取*/
Get_Data_TPMS_Status(FirstLOut);
Get_Data_TPMS_Status(FirstROut);
Get_Data_TPMS_Status(SecondLIn);
Get_Data_TPMS_Status(SecondRIn);
Get_Data_TPMS_Status(ThirdLOut);
......@@ -132,18 +127,39 @@ void Get_Data_TPMS_Value(TPMSNUM_t TPMSTyreID)
{
uint16_t TyrePressure = 0u ;
uint32_t TyreTemp = 0ul;
if(TPMS_Out[TPMSTyreID].TPMSTyreID == Get_ID_18011733_Sig_Tire_Index())
if (TPMS_Out[TPMSTyreID].TPMSTyreID == Get_ID_18011733_Sig_Tire_Index())
{
/*胎压 数据处理*/
TPMS_Out[TPMSTyreID].TPMSPressure = Get_ID_18011733_Sig_Tire_Pressure();
/*胎温数据处理*/
TPMS_Out[TPMSTyreID].TPMSTempSign = Get_ID_18011733_Sig_Tire_Temperature_Sign();
if(TPMS_Out[TPMSTyreID].TPMSTempSign)
{//' - '
TPMS_Out[TPMSTyreID].TPMSTemp = 128 - (Get_ID_18011733_Sig_Tire_Temperature()&0x7F) ;
if (TPMS_Out[TPMSTyreID].TPMSTempSign)
{
//' - '
TPMS_Out[TPMSTyreID].TPMSTemp = 128 - (Get_ID_18011733_Sig_Tire_Temperature() & 0x7F) ;
}
else
{//' + '
{
//' + '
TPMS_Out[TPMSTyreID].TPMSTemp = Get_ID_18011733_Sig_Tire_Temperature() ;
}
}
/*数据掉线计时器*/
TPMS_Out[TPMSTyreID].TPMSDataInvalidTime = 0u;
}
else
{
if (TPMS_Out[TPMSTyreID].TPMSDataInvalidTime < 0xFFFFu)
{
TPMS_Out[TPMSTyreID].TPMSDataInvalidTime ++ ;
}
else
{
TPMS_Out[TPMSTyreID].TPMSDataInvalidTime = 0xFFFFu;
}
}
}
......@@ -155,7 +171,7 @@ void Get_Data_TPMS_Value(TPMSNUM_t TPMSTyreID)
******************************************************************************/
void Get_Data_TPMS_Status(TPMSNUM_t TPMSTyreID)
{
if(TPMS_Out[TPMSTyreID].TPMSTyreID == Get_ID_18011733_Sig_Tire_Index())
if (TPMS_Out[TPMSTyreID].TPMSTyreID == Get_ID_18011733_Sig_Tire_Index())
{
/*低气压报警 */
TPMS_Out[TPMSTyreID].TPMSLowpressure = Get_ID_18011733_Sig_Low_Presure_Alarm();
......@@ -181,19 +197,19 @@ void Get_Data_TPMS_Status(TPMSNUM_t TPMSTyreID)
******************************************************************************/
void Get_Data_TPMS_Pair(TPMSNUM_t TPMSTyreID)
{
if(TPMS_Out[TPMSTyreID].CurPoxID)
if (TPMS_Out[TPMSTyreID].CurPoxID)
{
if(TPMS_Out[TPMSTyreID].PairEn)
if (TPMS_Out[TPMSTyreID].PairEn)
{
TPMS_Out[TPMSTyreID].PairTimer ++ ;
TPMS_Out[TPMSTyreID].TPMSGuiSta = YELLOW_FLASH ;
if(Get_ID_18021733_Sig_Setup_cmd() == 0x61u)
if (Get_ID_18021733_Sig_Setup_cmd() == 0x61u)
{
TPMS_Out[TPMSTyreID].PairSuccess = 1u ;
TPMS_Out[TPMSTyreID].TPMSGuiSta = SOLID_GREEN ;
TPMS_Out[TPMSTyreID].PairEn = 0 ;
}
else if(Get_ID_18021733_Sig_Setup_cmd() == 0xffu)
else if (Get_ID_18021733_Sig_Setup_cmd() == 0xffu)
{
TPMS_Out[TPMSTyreID].PairSuccess = 0u ;
}
......@@ -290,14 +306,14 @@ uint16_t Get_DataTPMS_Temp_Sta(TPMSNUM_t TPMSTyreID)
{
Temp_Value = (uint16_t)STATUS_UNSUPPORTED ;
}
//else if (TPMS_Out[TPMSTyreID].TPMSTempSigStat == 1u ) /*正数 零 返回状态*/
//{
// Temp_Value = (uint16_t)STATUS_NONNEGATIVE;
//}
//else if (TPMS_Out[TPMSTyreID].TPMSTempSigStat == 0u ) /*负数 返回状态*/
//{
// Temp_Value = (uint16_t)STATUS_NEGATIVE;
//}
else if (TPMS_Out[TPMSTyreID].TPMSTempSigStat == 1u ) /*正数 零 返回状态*/
{
Temp_Value = (uint16_t)STATUS_NONNEGATIVE;
}
else if (TPMS_Out[TPMSTyreID].TPMSTempSigStat == 0u ) /*负数 返回状态*/
{
Temp_Value = (uint16_t)STATUS_NEGATIVE;
}
else
{
Temp_Value = (uint16_t)STATUS_SUCCESS ;
......@@ -496,32 +512,32 @@ uint8_t Get_DataTPMS_Tyre_FLASH_Sta(TPMSNUM_t TPMSTyreID)
Function:按键切换 选择轮胎
Description:选择某个轮胎
Input:输入枚举编号
Output:
Output:
UP/DOWN 按键
******************************************************************************/
void ChooseKey_TPMS_Event(TPMSNUM_t TPMSTyreID)
{
uint8_t i = 0 ;
for(i = 0 ;i < TPMSNumMax ;i ++ )
for (i = 0 ; i < TPMSNumMax ; i ++ )
{
if(TPMS_Out[i].TPMSGuiSta == WHITEBOX_GRAY)
if (TPMS_Out[i].TPMSGuiSta == WHITEBOX_GRAY)
{
TPMS_Out[i].TPMSGuiSta = SOLID_GRAY ;
TPMS_Out[i].CurPoxID = 0 ;
}
}
}
if(TPMS_Out[TPMSTyreID].TPMSGuiSta == SOLID_GRAY)
if (TPMS_Out[TPMSTyreID].TPMSGuiSta == SOLID_GRAY)
{
TPMS_Out[TPMSTyreID].TPMSGuiSta = WHITEBOX_GRAY ;
}
}
TPMS_Out[TPMSTyreID].CurPoxID = 1 ;
TPMS_Out[TPMSTyreID].CurPoxID = 1 ;
}
/******************************************************************************
Function:配对轮胎
Description:选择某个轮胎
Input:输入枚举编号
Output:
Output:
ENTER 按键
******************************************************************************/
void EnterKey_TPMS_Event(TPMSNUM_t TPMSTyreID)
......@@ -536,7 +552,7 @@ void EnterKey_TPMS_Event(TPMSNUM_t TPMSTyreID)
Function:退出配对
Description:选择某个轮胎
Input:输入枚举编号
Output:
Output:
RETURN 按键
******************************************************************************/
void ReturnKey_TPMS_Event(TPMSNUM_t TPMSTyreID)
......@@ -549,7 +565,7 @@ void ReturnKey_TPMS_Event(TPMSNUM_t TPMSTyreID)
Function:Get_TPMSSetGui_Sta
Description:胎压设定界面:某个轮胎的式样
Input:输入枚举编号
Output:
Output:
RETURN 按键
******************************************************************************/
en_TPMSGUI Get_TPMSSetGui_Sta(TPMSNUM_t TPMSTyreID)
......
......@@ -9,14 +9,14 @@ VC66对应关系
[] [] No1
[] [] No2
[] [] [] [] No3
[] [] [] [] No4
TPMS FirstLOutID 左前轮(No1)
FirstROutID 右前轮(No1)
TPMS FirstLOutID 左前轮(No1)
FirstROutID 右前轮(No1)
SecondLInID 左中前轮(No2)
SecondRInID 右中前轮(No2)
ThirdLOutID 左中后轮_外侧(No3)
......@@ -27,11 +27,11 @@ TPMS FirstLOutID 左前轮(No1)
FourthLInID 左后轮_内侧(No4)
FourthRInID 右后轮_内侧(No4)
FourthROutID 右后轮_外侧(No4)
******************************************************************************/
#define FirstLOutID 0x12u
#define FirstLOutID 0x12u
#define FirstROutID 0x13u
#define SecondLInID 0x22u
#define SecondRInID 0x23u
......@@ -50,7 +50,7 @@ TPMS FirstLOutID 左前轮(No1)
typedef enum
{
FirstLOut = 0 ,
FirstLOut = 0 ,
FirstROut ,
SecondLIn ,
SecondRIn ,
......@@ -72,7 +72,7 @@ typedef enum
WHITEBOX_GRAY ,
YELLOW_FLASH ,
SOLID_GREEN ,
}en_TPMSGUI;
} en_TPMSGUI;
......@@ -94,16 +94,10 @@ typedef struct
uint8_t TPMSStandarTempSetSts ; /*轮胎标准温度设置状态 */
uint8_t TPMSInvaliddata ; /*标识报警信号的有效性 */
uint8_t TPMSDataupdating ; /*数据有效性 */
//uint8_t TPMSLostWarningSig ; /*轮胎被盗报警信号 */
//uint8_t TPMSTemporaryNoSignal ; /*短时无信号 */
//uint8_t TPMSTempSigStat ; /*轮胎温度符号状态 */
//uint8_t TPMSTemporaryNoSignal ; /*短时无信号 */
uint8_t TPMSTempSigStat ; /*轮胎温度符号状态 */
uint16_t TPMSDataInvalidTime ; /*数据无效计时器 */
//uint16_t TPMSValueSta ; /*数据返回状态 */
......@@ -115,8 +109,6 @@ typedef struct
uint8_t PairCmd ; /*TxID 18033317 Byte1*/
uint8_t TireNumber ; /*TxID 18033317 Byte2*/
} _USER_TPMS;
extern _USER_TPMS TPMS_Out[TPMSNumMax];
......@@ -160,7 +152,7 @@ extern void EnterKey_TPMS_Event(TPMSNUM_t TPMSTyreID);
extern void ReturnKey_TPMS_Event(TPMSNUM_t TPMSTyreID);
/*Gui 调用*/
/*轮子的式样
/*轮子的式样
SOLID_GRAY - 全灰色
WHITEBOX_GRAY - 灰色白框
YELLOW_FLASH - 黄色闪烁
......
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