Commit 4e6b837e authored by 高士达's avatar 高士达

Merge branch 'lijianshuang' into 'dev'

Lijianshuang

See merge request !65
parents b9007b5d b0d02a3c
......@@ -2,8 +2,8 @@
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
LR_IROM1 0x00008000 0x00040000 { ; load region size_region
ER_IROM1 0x00008000 0x00040000 { ; load address = execution address
LR_IROM1 0x00000000 0x00040000 { ; load region size_region
ER_IROM1 0x00000000 0x00040000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
......
......@@ -362,7 +362,7 @@
</Aads>
<LDads>
<umfTarg>0</umfTarg>
<Ropi>1</Ropi>
<Ropi>0</Ropi>
<Rwpi>0</Rwpi>
<noStLib>0</noStLib>
<RepFail>1</RepFail>
......@@ -503,16 +503,6 @@
<FileType>5</FileType>
<FilePath>..\..\..\..\Source\Application\CAN_User\Can_App.h</FilePath>
</File>
<File>
<FileName>Data_Coolant.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\Source\Application\Data_Coolant\Data_Coolant.c</FilePath>
</File>
<File>
<FileName>Data_Coolant.h</FileName>
<FileType>5</FileType>
<FilePath>..\..\..\..\Source\Application\Data_Coolant\Data_Coolant.h</FilePath>
</File>
<File>
<FileName>Data_TPMS.c</FileName>
<FileType>1</FileType>
......@@ -593,6 +583,16 @@
<FileType>5</FileType>
<FilePath>..\..\..\..\Source\Application\FaultCode\code.h</FilePath>
</File>
<File>
<FileName>Data_Coolant.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\Source\Application\Data_Coolant\Data_Coolant.c</FilePath>
</File>
<File>
<FileName>Data_Coolant.h</FileName>
<FileType>5</FileType>
<FilePath>..\..\..\..\Source\Application\Data_Coolant\Data_Coolant.h</FilePath>
</File>
</Files>
</Group>
<Group>
......
......@@ -14,7 +14,6 @@ SET CPU_CLOCK=0x00B71B00
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\gui_display.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\can_user.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\can_app.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\data_coolant.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\data_tpms.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\faultcode.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\data_voltage.__i"
......@@ -23,6 +22,7 @@ SET CPU_CLOCK=0x00B71B00
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\protocol_lib.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\protocol_user.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\code.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\data_coolant.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\bu98r10.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\services_mileage_user.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\eemanager_interface.__i"
......
......@@ -23,31 +23,32 @@ void BackLight_Process(void)
{
if (SYS_OPR_STAT_IGN_ON)
{
//if (Line_In_Get_Status(LINE_IN_Little_Lamp))
//{
// if(LED_Turnon < 5)
// {
// LED_Turnon ++ ;
// }
// else
// {
// LED_Turnon = 5;
// LED_Turnoff = 0;
// }
//}
//else
//{
// if(LED_Turnoff < 5)
// {
// LED_Turnoff ++ ;
// }
// else
// {
// LED_Turnoff = 5;
// LED_Turnon = 0;
// }
//}
//if ( LED_Turnon == 5 )
if (Line_In_Get_Status(LINE_IN_Little_Lamp))
{
if(LED_Turnon < 5)
{
LED_Turnon ++ ;
}
else
{
LED_Turnon = 5;
LED_Turnoff = 0;
}
}
else
{
if(LED_Turnoff < 5)
{
LED_Turnoff ++ ;
}
else
{
LED_Turnoff = 5;
LED_Turnon = 0;
}
}
if ( LED_Turnon == 5 )
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_NIGHT);
}
......
......@@ -38,7 +38,120 @@ void Data_Coolant_Temp_KL15_Init ( void )
DataCoolantTemp_Dis.u8_Flg = 0;
}
void Data_Coolant_Temp_Processing_Service ( void )
#define COOLANT_NUM_TIME 5 // 数显多久变化一次,暂定100ms
typedef struct
{
/*该段的下限值*/
uint16_t u16HYSSegLow;
/*该段的上限值*/
uint16_t u16HYSSegHigh;
} HYS_Seg_Table_st_t;
const HYS_Seg_Table_st_t stHYSSegTableTemp[7] =
{
{0U, 470U}, // 0
{500U, 590U}, // 1
{620U, 770U}, // 2
{800U, 950U}, // 3
{980U, 1120U}, // 4
{1150U, 1990U}, // 5
{1990U, 2000U}, // 6
};
uint32_t u32CoolantDataTimeCount = 0UL;
uint32_t u32ColCurNum = 0UL; /*阻尼数显*/
/*
u32CoolantDir:0:下行,1:上行 2:无变化
*/
uint32_t Data_Coolant_Cal_Num(uint32_t u32CoolantCurSeg, uint32_t u32CoolantDir, uint32_t u32CoolantRemTime, uint32_t u32CoolantCurNum, uint32_t u32CoolantDesNum)
{
uint32_t u32CoolantNum = u32CoolantCurNum;
uint32_t u32CoolantNumMax = 0UL;
uint32_t u32CoolantNumMin = 0UL;
uint32_t u32CoolantSegDesNum = 0UL;
uint32_t u32CoolantCalBuf = 0UL;
uint32_t u32CoolantCalBuf1 = 0UL;
/*计算当前格对应的目标数值*/
/*当前格数对应的数值范围,目标数值是否在这个范围内,如果在就直接用目标值。如果不在就根据上下行选择该范围内的极大和极小值。*/
/*这样就找到了当前格对应的目标数值*/
u32CoolantNumMax = stHYSSegTableTemp[u32CoolantCurSeg + 1].u16HYSSegLow;
if (u32CoolantCurSeg)
{
u32CoolantNumMin = stHYSSegTableTemp[u32CoolantCurSeg - 1].u16HYSSegHigh;
}
else
{
u32CoolantNumMin = stHYSSegTableTemp[u32CoolantCurSeg].u16HYSSegLow;
}
if ((u32CoolantDesNum >= u32CoolantNumMin) && (u32CoolantDesNum <= u32CoolantNumMax))
{
u32CoolantSegDesNum = u32CoolantDesNum;
}
else
{
if (u32CoolantDir == 1) // UP
{
u32CoolantSegDesNum = u32CoolantNumMax;
}
else if (u32CoolantDir == 0) // down
{
u32CoolantSegDesNum = u32CoolantNumMin;
}
else
{
u32CoolantSegDesNum = u32CoolantDesNum;
}
}
if (u32CoolantDataTimeCount < COOLANT_NUM_TIME)
{
u32CoolantDataTimeCount++;
}
else
{
u32CoolantDataTimeCount = 0UL;
u32CoolantCalBuf = u32CoolantRemTime / COOLANT_NUM_TIME;
if (u32CoolantCalBuf)
{
if (u32CoolantNum < u32CoolantSegDesNum)
{
u32CoolantCalBuf1 = u32CoolantSegDesNum - u32CoolantNum;
u32CoolantCalBuf1 = u32CoolantCalBuf1 / u32CoolantCalBuf;
u32CoolantNum += u32CoolantCalBuf1;
if (u32CoolantNum > u32CoolantSegDesNum)
{
u32CoolantNum = u32CoolantSegDesNum;
}
}
else
{
u32CoolantCalBuf1 = u32CoolantNum - u32CoolantSegDesNum;
u32CoolantCalBuf1 = u32CoolantCalBuf1 / u32CoolantCalBuf;
u32CoolantNum -= u32CoolantCalBuf1;
if (u32CoolantNum < u32CoolantSegDesNum)
{
u32CoolantNum = u32CoolantSegDesNum;
}
}
}
else // 0
{
u32CoolantNum = u32CoolantSegDesNum;
}
}
/*根据目标数值计算每个变化周期内数值变化的大小,*/
/*根据目标数值以及剩余时间,修改当前显示值*/
return u32CoolantNum;
}
void Data_Coolant_Temp_Processing_Service(void)
{
uint16_t Coolant_Temperature = 0;
uint8_t Coolant_Temperature_State = 0;
......@@ -165,27 +278,45 @@ void Data_Coolant_Temp_Display ( void )
if(DataCoolantTemp_Dis.u8_CurSeg > DataCoolantTemp_Dis.u8_DestSeg )
{
u32ColCurNum = Data_Coolant_Cal_Num(DataCoolantTemp_Dis.u8_CurSeg, 0, (DataCoolantTemp_Dis.u8_Downtimer - DataCoolantTemp_Dis.u8_DownFlashtimer), u32ColCurNum, DataCoolantTemp.Value*10);
DataCoolantTemp_Dis.u8_UpFlashtimer = 0;
DataCoolantTemp_Dis.u8_Holdtimer = 0;
DataCoolantTemp_Dis.u8_DownFlashtimer++;
if(DataCoolantTemp_Dis.u8_DownFlashtimer >= DataCoolantTemp_Dis.u8_Downtimer)
{
DataCoolantTemp_Dis.u8_DownFlashtimer = 0;
DataCoolantTemp_Dis.u8_CurSeg --;
}
DataCoolantTemp_Dis.u8_CurSeg--;
}
}
else if(DataCoolantTemp_Dis.u8_CurSeg < DataCoolantTemp_Dis.u8_DestSeg)
else if (DataCoolantTemp_Dis.u8_CurSeg < DataCoolantTemp_Dis.u8_DestSeg)
{
DataCoolantTemp_Dis.u8_DownFlashtimer = 0;
DataCoolantTemp_Dis.u8_UpFlashtimer++;
if(DataCoolantTemp_Dis.u8_UpFlashtimer >= DataCoolantTemp_Dis.u8_Uptimer)
u32ColCurNum = Data_Coolant_Cal_Num(DataCoolantTemp_Dis.u8_CurSeg, 1, (DataCoolantTemp_Dis.u8_Uptimer - DataCoolantTemp_Dis.u8_UpFlashtimer), u32ColCurNum, DataCoolantTemp.Value*10);
DataCoolantTemp_Dis.u8_DownFlashtimer = 0;
DataCoolantTemp_Dis.u8_Holdtimer = 0;
DataCoolantTemp_Dis.u8_UpFlashtimer++;
if (DataCoolantTemp_Dis.u8_UpFlashtimer >= DataCoolantTemp_Dis.u8_Uptimer)
{
DataCoolantTemp_Dis.u8_UpFlashtimer = 0;
DataCoolantTemp_Dis.u8_CurSeg ++;
}
}
//warning
if( DataCoolantTemp.Valid == 0 )
DataCoolantTemp_Dis.u8_CurSeg++;
}
}
else
{
DataCoolantTemp_Dis.u8_DownFlashtimer = 0;
DataCoolantTemp_Dis.u8_UpFlashtimer = 0;
DataCoolantTemp_Dis.u8_Holdtimer++;
if (DataCoolantTemp_Dis.u8_Holdtimer >= CoolantFlashtimer)
{
DataCoolantTemp_Dis.u8_Holdtimer = CoolantFlashtimer;
}
/*目标格和当前格一致时,数显如何处理*/
/*5S后更新为目标数值*/
u32ColCurNum = Data_Coolant_Cal_Num(DataCoolantTemp_Dis.u8_CurSeg, 2, (CoolantFlashtimer-DataCoolantTemp_Dis.u8_Holdtimer ), u32ColCurNum, DataCoolantTemp.Value*10);
}
// warning
if (DataCoolantTemp.Valid == 0)
{
DataCoolantTemp_Dis.u8_Warnflg = 1;
}
......@@ -195,7 +326,7 @@ void Data_Coolant_Temp_Display ( void )
{
DataCoolantTemp_Dis.u8_Warnflg = 2;
}
else if(DataCoolantTemp.Value <= 112)
else if (DataCoolantTemp.Value <= 112)
{
DataCoolantTemp_Dis.u8_Warnflg = 0;
}
......@@ -203,39 +334,31 @@ void Data_Coolant_Temp_Display ( void )
{
;
}
}
}
else
else
{
DataCoolantTemp_Dis.Dis_Valid = 0;
DataCoolantTemp_Dis.u8_UpFlashtimer = DataCoolantTemp_Dis.u8_Uptimer;
DataCoolantTemp_Dis.u8_DownFlashtimer = DataCoolantTemp_Dis.u8_Downtimer;
DataCoolantTemp_Dis.u8_Warnflg = 0;
DataCoolantTemp_Dis.Dis_Valid = 0;
DataCoolantTemp_Dis.u8_UpFlashtimer = DataCoolantTemp_Dis.u8_Uptimer;
DataCoolantTemp_Dis.u8_DownFlashtimer = DataCoolantTemp_Dis.u8_Downtimer;
DataCoolantTemp_Dis.u8_Warnflg = 0;
DataCoolantTemp_Dis.u8_Flg = 0;
}
}
}
void Get_Coolant_Temp_Seg(uint16_t Temp_Value)
uint8_t Get_Coolant_Temp_Seg(uint16_t Temp_Value)
{
//uint8_t TempSeg;
//uint8_t CurTempSeg;
// uint8_t CurTempSeg;
if(Temp_Value < 50)
if (Temp_Value < 50)
{
if(DataCoolantTemp_Dis.u8_CurSeg > 1)
if (DataCoolantTemp_Dis.u8_CurSeg > 1)
{
DataCoolantTemp_Dis.u8_DestSeg = 1;
DataCoolantTemp_Dis.u8_DestSeg = 1;
}
else if (DataCoolantTemp_Dis.u8_CurSeg > 0)
{
if(Temp_Value <= 47)
if (Temp_Value <= 47)
{
DataCoolantTemp_Dis.u8_DestSeg = 0;
}
......@@ -245,114 +368,109 @@ void Get_Coolant_Temp_Seg(uint16_t Temp_Value)
DataCoolantTemp_Dis.u8_DestSeg = 0;
}
}
else if((Temp_Value < 62)&&(Temp_Value >= 50))
else if ((Temp_Value < 62) && (Temp_Value >= 50))
{
if(DataCoolantTemp_Dis.u8_CurSeg > 2)
if (DataCoolantTemp_Dis.u8_CurSeg > 2)
{
DataCoolantTemp_Dis.u8_DestSeg = 2;
DataCoolantTemp_Dis.u8_DestSeg = 2;
}
else if(DataCoolantTemp_Dis.u8_CurSeg > 1 )
{
if(Temp_Value <= 59)
else if (DataCoolantTemp_Dis.u8_CurSeg > 1)
{
if (Temp_Value <= 59)
{
DataCoolantTemp_Dis.u8_DestSeg = 1;
}
}
else
{
DataCoolantTemp_Dis.u8_DestSeg = 1;
}
DataCoolantTemp_Dis.u8_DestSeg = 1;
}
}
else if((Temp_Value < 80)&&(Temp_Value >= 62))
else if ((Temp_Value < 80) && (Temp_Value >= 62))
{
if(DataCoolantTemp_Dis.u8_CurSeg > 3)
if (DataCoolantTemp_Dis.u8_CurSeg > 3)
{
DataCoolantTemp_Dis.u8_DestSeg = 3;
DataCoolantTemp_Dis.u8_DestSeg = 3;
}
else if(DataCoolantTemp_Dis.u8_CurSeg > 2)
else if (DataCoolantTemp_Dis.u8_CurSeg > 2)
{
if(Temp_Value <= 77)
if (Temp_Value <= 77)
{
DataCoolantTemp_Dis.u8_DestSeg = 2;
DataCoolantTemp_Dis.u8_DestSeg = 2;
}
}
else
{
DataCoolantTemp_Dis.u8_DestSeg = 2;
DataCoolantTemp_Dis.u8_DestSeg = 2;
}
}
else if((Temp_Value < 98)&&(Temp_Value >= 80))
else if ((Temp_Value < 98) && (Temp_Value >= 80))
{
if(DataCoolantTemp_Dis.u8_CurSeg > 4)
if (DataCoolantTemp_Dis.u8_CurSeg > 4)
{
DataCoolantTemp_Dis.u8_DestSeg = 4;
DataCoolantTemp_Dis.u8_DestSeg = 4;
}
else if(DataCoolantTemp_Dis.u8_CurSeg > 3)
else if (DataCoolantTemp_Dis.u8_CurSeg > 3)
{
if(Temp_Value <= 95 )
if (Temp_Value <= 95)
{
DataCoolantTemp_Dis.u8_DestSeg = 3;
DataCoolantTemp_Dis.u8_DestSeg = 3;
}
}
else
{
DataCoolantTemp_Dis.u8_DestSeg = 3;
DataCoolantTemp_Dis.u8_DestSeg = 3;
}
}
else if((Temp_Value < 115)&&(Temp_Value >= 98))
else if ((Temp_Value < 115) && (Temp_Value >= 98))
{
if(DataCoolantTemp_Dis.u8_CurSeg > 4)
if (DataCoolantTemp_Dis.u8_CurSeg > 4)
{
if(Temp_Value <= 112)
if (Temp_Value <= 112)
{
DataCoolantTemp_Dis.u8_DestSeg = 4;
DataCoolantTemp_Dis.u8_DestSeg = 4;
}
}
else
{
DataCoolantTemp_Dis.u8_DestSeg = 4;
DataCoolantTemp_Dis.u8_DestSeg = 4;
}
}
}
else
{
DataCoolantTemp_Dis.u8_DestSeg = 5;
}
DataCoolantTemp_Dis.u8_DestSeg = 5;
}
return DataCoolantTemp_Dis.u8_DestSeg;
}
//水温显示格数
// 水温显示格数
uint8_t GET_DataCoolantTempSegDisp(void)
{
return DataCoolantTemp_Dis.u8_CurSeg;
return DataCoolantTemp_Dis.u8_CurSeg;
}
//水温显示有效标志
uint8_t GET_DataCollantTempSegValid(void)
// 水温显示有效标志
uint8_t GET_DataCollantTempSegValid(void)
{
return DataCoolantTemp_Dis.Dis_Valid;
return DataCoolantTemp_Dis.Dis_Valid;
}
//水温数显。作为外发使用的时候+40
// 水温数显。作为外发使用的时候+40
uint16_t GET_DataCoolantTempValueDisp(void)
{
return DataCoolantTemp.Value ;
return DataCoolantTemp.Value;
}
uint8_t GET_DataCollantTempValueValid(void)
uint16_t GET_DataCoolantSegValue(void)
{
return DataCoolantTemp.Valid;
return u32ColCurNum/10;
}
//水温灯及显示的报警信号 0:无报警,正常显示 1:掉线或者state无效,白色闪烁 2:高温,红色闪烁
uint8_t GET_DataCollantTempWarnflg(void)
uint8_t GET_DataCollantTempValueValid(void)
{
return DataCoolantTemp_Dis.u8_Warnflg;
return DataCoolantTemp.Valid;
}
// 水温灯及显示的报警信号 0:无报警,正常显示 1:掉线或者state无效,白色闪烁 2:高温,红色闪烁
uint8_t GET_DataCollantTempWarnflg(void)
{
return DataCoolantTemp_Dis.u8_Warnflg;
}
......@@ -17,12 +17,14 @@ typedef struct __attribute__((aligned(4)))
uint8_t u8_DestSeg;
uint8_t u8_CurSeg;
uint8_t u8_UpFlashtimer ;
uint8_t u8_Holdtimer ;
uint8_t u8_DownFlashtimer ;
uint8_t u8_Uptimer ;
uint8_t u8_Downtimer ;
uint8_t u8_Flashflg;
uint8_t u8_Warnflg;
uint8_t u8_Flg;
uint8_t u8Reserved;
}DataCoolantTempDisStruct;
......@@ -43,15 +45,16 @@ typedef struct __attribute__((aligned(4)))
void Data_Coolant_Temp_KL30_Init(void);
void Data_Coolant_Temp_KL15_Init(void);
void Data_Coolant_Temp_Processing_Service(void);
void Get_Coolant_Temp_Seg(uint16_t Temp_Value);
void Data_Coolant_Temp_Display ( void );
uint8_t Get_Coolant_Temp_Seg(uint16_t Temp_Value);
void Data_Coolant_Temp_Display (void);
uint8_t GET_DataCollantTempSegValid(void);
uint8_t GET_DataCoolantTempSegDisp(void);
uint16_t GET_DataCoolantTempValueDisp(void);
uint8_t GET_DataCollantTempWarnflg(void);
uint16_t GET_DataCoolantSegValue(void);
extern DataCoolantTempStruct DataCoolantTemp ;
extern DataCoolantTempStruct DataCoolantTemp;
#endif
......@@ -18,9 +18,9 @@ const RTE_GPIO_Config_st_t KL30_Init_GpioConfig[Gpio_Max] =
/* PORT0_PIN01 */ {RTE_GPIO_PORT00_PIN01, RTE_GPIO_DIR_IN},
/* PORT0_PIN02 */ {RTE_GPIO_PORT00_PIN02, RTE_GPIO_DIR_IN},
/* PORT0_PIN03 */ {RTE_GPIO_PORT00_PIN03, RTE_GPIO_DIR_IN},
/* PORT0_PIN04 */ {RTE_GPIO_PORT00_PIN04, RTE_GPIO_DIR_IN},
/* PORT0_PIN02 */ {RTE_GPIO_PORT00_PIN02, GpioOut_Low},
/* PORT0_PIN03 */ {RTE_GPIO_PORT00_PIN03, GpioOut_Low},
/* PORT0_PIN04 */ {RTE_GPIO_PORT00_PIN04, GpioOut_Low},
/* PORT0_PIN05 */ {RTE_GPIO_PORT00_PIN05, RTE_GPIO_DIR_IN},
/* PORT0_PIN06 */ {RTE_GPIO_PORT00_PIN06, RTE_GPIO_DIR_IN},
......@@ -55,9 +55,9 @@ const RTE_GPIO_Config_st_t KL30_Init_GpioConfig[Gpio_Max] =
/* PORT6_PIN62 */ {RTE_GPIO_PORT06_PIN02, GpioOut_Low},
/* PORT6_PIN63 */ {RTE_GPIO_PORT06_PIN03, GpioOut_Low},
/* PORT7_PIN70 */ {RTE_GPIO_PORT07_PIN00, RTE_GPIO_DIR_IN},
/* PORT7_PIN71 */ {RTE_GPIO_PORT07_PIN01, RTE_GPIO_DIR_IN},
/* PORT7_PIN72 */ {RTE_GPIO_PORT07_PIN02, RTE_GPIO_DIR_IN},
/* PORT7_PIN70 */ {RTE_GPIO_PORT07_PIN00, GpioOut_Low},
/* PORT7_PIN71 */ {RTE_GPIO_PORT07_PIN01, GpioOut_Low},
/* PORT7_PIN72 */ {RTE_GPIO_PORT07_PIN02, GpioOut_Low},
/* PORT7_PIN73 */ {RTE_GPIO_PORT07_PIN03, RTE_GPIO_DIR_IN},
/* PORT7_PIN74 */ {RTE_GPIO_PORT07_PIN04, RTE_GPIO_DIR_IN},
/* PORT7_PIN75 */ {RTE_GPIO_PORT07_PIN05, RTE_GPIO_DIR_IN},
......
......@@ -119,7 +119,7 @@ void Gauge_Service(void)
Gauge_Clock_Display();
SEG_SET_FuelDial(1, Get_CurFuelSetp());
SEG_SET_EspeedDial(1, Get_DispEngineSpeed()/500);
SEG_SET_CoolantDial(1, GET_DataCoolantTempSegDisp(), GET_DataCoolantTempValueDisp(), GET_DataCollantTempSegValid());
SEG_SET_CoolantDial(1, GET_DataCoolantTempSegDisp(), GET_DataCoolantSegValue(), GET_DataCollantTempSegValid());
SEG_SET_Voltage_NUM(1, Get_Battery_Voltage());
#if(IC_Current == TY200_080000b_ty)
SEG_SET_TPMS_DISPLAY(1, Get_Front_TPMS_Sig_Value(), Get_Rear_TPMS_Sig_Value(), 0 ,Get_Front_TPMS_Sig_Vaild(), Get_Rear_TPMS_Sig_Vaild());
......
......@@ -24,13 +24,13 @@ void BU98R10_CHIP0_SET_SD_LEVEL(uint8_t Level)
{
if (Level)
{
RTE_GPIO_Config(BU98R10_CHIP0_SD, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_HIGH);
//RTE_GPIO_Set_Level(BU98R10_CHIP0_SD, RTE_GPIO_LEVEL_HIGH);
//RTE_GPIO_Config(BU98R10_CHIP0_SD, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_HIGH);
RTE_GPIO_Set_Level(BU98R10_CHIP0_SD, RTE_GPIO_LEVEL_HIGH);
}
else
{
RTE_GPIO_Config(BU98R10_CHIP0_SD, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_LOW);
//RTE_GPIO_Set_Level(BU98R10_CHIP0_SD, RTE_GPIO_LEVEL_LOW);
//RTE_GPIO_Config(BU98R10_CHIP0_SD, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_LOW);
RTE_GPIO_Set_Level(BU98R10_CHIP0_SD, RTE_GPIO_LEVEL_LOW);
}
}
void BU98R10_CHIP1_SET_SD_LEVEL(uint8_t Level);
......@@ -38,13 +38,13 @@ void BU98R10_CHIP1_SET_SD_LEVEL(uint8_t Level)
{
if (Level)
{
RTE_GPIO_Config(BU98R10_CHIP1_SD, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_HIGH);
//RTE_GPIO_Set_Level(BU98R10_CHIP1_SD, RTE_GPIO_LEVEL_HIGH);
//RTE_GPIO_Config(BU98R10_CHIP1_SD, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_HIGH);
RTE_GPIO_Set_Level(BU98R10_CHIP1_SD, RTE_GPIO_LEVEL_HIGH);
}
else
{
RTE_GPIO_Config(BU98R10_CHIP1_SD, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_LOW);
//RTE_GPIO_Set_Level(BU98R10_CHIP1_SD, RTE_GPIO_LEVEL_LOW);
//RTE_GPIO_Config(BU98R10_CHIP1_SD, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_LOW);
RTE_GPIO_Set_Level(BU98R10_CHIP1_SD, RTE_GPIO_LEVEL_LOW);
}
}
void BU98R10_CHIP0_SET_CSB_LEVEL(uint8_t Level);
......@@ -52,13 +52,13 @@ void BU98R10_CHIP0_SET_CSB_LEVEL(uint8_t Level)
{
if (Level)
{
RTE_GPIO_Config(BU98R10_CHIP0_CSB, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_HIGH);
//RTE_GPIO_Set_Level(BU98R10_CHIP0_CSB, RTE_GPIO_LEVEL_HIGH);
// RTE_GPIO_Config(BU98R10_CHIP0_CSB, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_HIGH);
RTE_GPIO_Set_Level(BU98R10_CHIP0_CSB, RTE_GPIO_LEVEL_HIGH);
}
else
{
RTE_GPIO_Config(BU98R10_CHIP0_CSB, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_LOW);
//RTE_GPIO_Set_Level(BU98R10_CHIP0_CSB, RTE_GPIO_LEVEL_LOW);
// RTE_GPIO_Config(BU98R10_CHIP0_CSB, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_LOW);
RTE_GPIO_Set_Level(BU98R10_CHIP0_CSB, RTE_GPIO_LEVEL_LOW);
}
}
void BU98R10_CHIP1_SET_CSB_LEVEL(uint8_t Level);
......@@ -66,13 +66,13 @@ void BU98R10_CHIP1_SET_CSB_LEVEL(uint8_t Level)
{
if (Level)
{
RTE_GPIO_Config(BU98R10_CHIP1_CSB, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_HIGH);
//RTE_GPIO_Set_Level(BU98R10_CHIP1_CSB, RTE_GPIO_LEVEL_HIGH);
// RTE_GPIO_Config(BU98R10_CHIP1_CSB, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_HIGH);
RTE_GPIO_Set_Level(BU98R10_CHIP1_CSB, RTE_GPIO_LEVEL_HIGH);
}
else
{
RTE_GPIO_Config(BU98R10_CHIP1_CSB, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_LOW);
//RTE_GPIO_Set_Level(BU98R10_CHIP1_CSB, RTE_GPIO_LEVEL_LOW);
//RTE_GPIO_Config(BU98R10_CHIP1_CSB, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_LOW);
RTE_GPIO_Set_Level(BU98R10_CHIP1_CSB, RTE_GPIO_LEVEL_LOW);
}
}
void BU98R10_CHIP0_SET_SCL_LEVEL(uint8_t Level);
......@@ -80,13 +80,13 @@ void BU98R10_CHIP0_SET_SCL_LEVEL(uint8_t Level)
{
if (Level)
{
RTE_GPIO_Config(BU98R10_CHIP0_SCL, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_HIGH);
//RTE_GPIO_Set_Level(BU98R10_CHIP0_SCL, RTE_GPIO_LEVEL_HIGH);
//RTE_GPIO_Config(BU98R10_CHIP0_SCL, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_HIGH);
RTE_GPIO_Set_Level(BU98R10_CHIP0_SCL, RTE_GPIO_LEVEL_HIGH);
}
else
{
RTE_GPIO_Config(BU98R10_CHIP0_SCL, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_LOW);
//RTE_GPIO_Set_Level(BU98R10_CHIP0_SCL, RTE_GPIO_LEVEL_LOW);
//RTE_GPIO_Config(BU98R10_CHIP0_SCL, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_LOW);
RTE_GPIO_Set_Level(BU98R10_CHIP0_SCL, RTE_GPIO_LEVEL_LOW);
}
}
void BU98R10_CHIP1_SET_SCL_LEVEL(uint8_t Level);
......@@ -94,13 +94,13 @@ void BU98R10_CHIP1_SET_SCL_LEVEL(uint8_t Level)
{
if (Level)
{
RTE_GPIO_Config(BU98R10_CHIP1_SCL, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_HIGH);
//RTE_GPIO_Set_Level(BU98R10_CHIP1_SCL, RTE_GPIO_LEVEL_HIGH);
//RTE_GPIO_Config(BU98R10_CHIP1_SCL, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_HIGH);
RTE_GPIO_Set_Level(BU98R10_CHIP1_SCL, RTE_GPIO_LEVEL_HIGH);
}
else
{
RTE_GPIO_Config(BU98R10_CHIP1_SCL, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_LOW);
//RTE_GPIO_Set_Level(BU98R10_CHIP1_SCL, RTE_GPIO_LEVEL_LOW);
//RTE_GPIO_Config(BU98R10_CHIP1_SCL, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_LOW);
RTE_GPIO_Set_Level(BU98R10_CHIP1_SCL, RTE_GPIO_LEVEL_LOW);
}
}
void BU98R10_CHIP0_SET_SD_DIR(uint8_t Dir);
......@@ -108,7 +108,8 @@ void BU98R10_CHIP0_SET_SD_DIR(uint8_t Dir)
{
if (Dir)
{
RTE_GPIO_Config(BU98R10_CHIP0_SD, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_HIGH);
RTE_GPIO_Set_Level(BU98R10_CHIP0_SD, RTE_GPIO_LEVEL_HIGH);
// RTE_GPIO_Config(BU98R10_CHIP0_SD, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_HIGH);
}
else
{
......@@ -120,7 +121,8 @@ void BU98R10_CHIP1_SET_SD_DIR(uint8_t Dir)
{
if (Dir)
{
RTE_GPIO_Config(BU98R10_CHIP1_SD, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_HIGH);
//RTE_GPIO_Set_Level(BU98R10_CHIP1_SD, RTE_GPIO_LEVEL_HIGH);
RTE_GPIO_Config(BU98R10_CHIP1_SD, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_HIGH);
}
else
{
......
......@@ -12,7 +12,7 @@ const Line_In_Attribute_st g_stLineInAttribute[LINE_IN_MAX] =
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 120U, 20U, Get_LINE_IN_FAULT_ELECTROSPRAY, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 170U, 20U, Get_LINE_IN_Fault_ABS, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 500U, 20U, Get_LINE_IN_Oil_Pressure, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 150U, 20U, Get_LINE_IN_Auto_Start_Stop, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 140U, 20U, Get_LINE_IN_Auto_Start_Stop, },
{LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 500U, 500U, Get_LINE_IN_Little_Lamp, },
};
......
......@@ -49,6 +49,10 @@ static void Power_KL30_Init(void)
Gpio_Init(Gpio_KL30_Init);
eeprom_StoreInfo_Init();
Can_Init();
CAN_TX_Count_Init();
CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Enable);
Data_TPMS_KL30_Init ();
DFlash_init();
Data_Read_DiagPara();
......@@ -82,7 +86,7 @@ static void Power_KL30_Init(void)
Telltales_Init();
Telltales_UserInit();
MenuData_Unit_Init();
Data_TPMS_KL30_Init ();
RTCInformation.u8RTCSecond = 0;
RTCInformation.u8RTCMinute = 0;
RTCInformation.u8RTCHour = 0;
......@@ -93,8 +97,7 @@ static void Power_KL30_Init(void)
RTE_DEEPSLEEP_GPIO_Interrupt_Enable(WAKEUP_KL15_In,Trigger_Rising);
FaultCode_Init();
CAN_TX_Count_Init();
CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Enable);
}
extern uint32_t PowerIgnOffTimeLine;
......
......@@ -44,6 +44,9 @@ static void LED_Tire_Pressure_Execution(Tellib_uint16_t led_status);
//Led_HighBeam_Count HighBeam_Timer;
Tellib_uint16_t LED_Battery_Voltage = 0;
Tellib_uint16_t Battery_Voltage_valid = 0;
Tellib_uint8_t LED_TCS_STATE = 0;
Tellib_uint8_t LED_TCS_CUR_STATE = 0;
Tellib_uint8_t LED_TCS_VALUE = 0;
const LED_Attribute_st LED_Attribute [ LED_Max ] = {
/* 指示灯索引 是否自检 外部信号自检 工作电源状态 自检开始时间 自检持续时间 指示灯点亮条件 指示灯执行函数 */
......@@ -380,6 +383,78 @@ static void LED_Bluetooth_Execution(Tellib_uint16_t led_status)
}
}
static Tellib_uint16_t LED_TCS_Judgement(void)
{
Tellib_uint16_t LED_STATE = 0u;
if (Get_Dis_Tcs_Val() == 1)
{
if ((CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x120_Msg_Count) == CAN_SIG_LOST))
{
LED_TCS_STATE = 1;
}
else
{
if ((Get_CAN_CH0_ID_120_Sig_TCSStatus() == 1) || (Get_CAN_CH0_ID_120_Sig_TCSStatus() == 2) || (Get_CAN_CH0_ID_120_Sig_TCSStatus() == 3) || (Get_CAN_CH0_ID_120_Sig_TCSStatus() == 5))
{
LED_TCS_STATE = 1;
}
else if (Get_CAN_CH0_ID_120_Sig_TCSStatus() == 4)
{
LED_TCS_STATE = 2;
}
else if (Get_CAN_CH0_ID_120_Sig_TCSStatus() == 6)
{
LED_TCS_STATE = 3;
}
else if ((Get_CAN_CH0_ID_120_Sig_TCSStatus() == 0) || (Get_CAN_CH0_ID_120_Sig_TCSStatus() == 7))
{
LED_TCS_STATE = 0;
}
}
}
else
{
LED_TCS_STATE = 0;
}
if ((LED_TCS_CUR_STATE == 2))
{
if ((LED_TCS_VALUE == 0) && (FLASH_SYNC_1Hz))
{
LED_TCS_CUR_STATE = LED_TCS_STATE;
}
LED_TCS_VALUE = FLASH_SYNC_1Hz;
LED_STATE = FLASH_SYNC_1Hz;
}
else if (LED_TCS_CUR_STATE == 3)
{
if ((LED_TCS_VALUE == 0) && (FLASH_SYNC_2Hz))
{
LED_TCS_CUR_STATE = LED_TCS_STATE;
}
LED_TCS_VALUE = FLASH_SYNC_2Hz;
LED_STATE = FLASH_SYNC_2Hz;
}
if ((LED_TCS_CUR_STATE != 2) && (LED_TCS_CUR_STATE != 3))
{
LED_TCS_CUR_STATE = LED_TCS_STATE;
if (LED_TCS_CUR_STATE)
{
LED_STATE = 1;
}
else
{
LED_STATE = 0;
}
}
return LED_STATE;
}
#if 0
static Tellib_uint16_t LED_TCS_Judgement(void)
{
Tellib_uint16_t LED_STATE = 0u;
......@@ -419,6 +494,8 @@ static Tellib_uint16_t LED_TCS_Judgement(void)
return LED_STATE;
}
#endif
static void LED_TCS_Execution(Tellib_uint16_t led_status)
{
if ( led_status == 1u )
......
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