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

Merge branch 'lijianshuang' into 'dev'

Lijianshuang

See merge request !65
parents b9007b5d b0d02a3c
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
; *** Scatter-Loading Description File generated by uVision *** ; *** Scatter-Loading Description File generated by uVision ***
; ************************************************************* ; *************************************************************
LR_IROM1 0x00008000 0x00040000 { ; load region size_region LR_IROM1 0x00000000 0x00040000 { ; load region size_region
ER_IROM1 0x00008000 0x00040000 { ; load address = execution address ER_IROM1 0x00000000 0x00040000 { ; load address = execution address
*.o (RESET, +First) *.o (RESET, +First)
*(InRoot$$Sections) *(InRoot$$Sections)
.ANY (+RO) .ANY (+RO)
......
...@@ -362,7 +362,7 @@ ...@@ -362,7 +362,7 @@
</Aads> </Aads>
<LDads> <LDads>
<umfTarg>0</umfTarg> <umfTarg>0</umfTarg>
<Ropi>1</Ropi> <Ropi>0</Ropi>
<Rwpi>0</Rwpi> <Rwpi>0</Rwpi>
<noStLib>0</noStLib> <noStLib>0</noStLib>
<RepFail>1</RepFail> <RepFail>1</RepFail>
...@@ -503,16 +503,6 @@ ...@@ -503,16 +503,6 @@
<FileType>5</FileType> <FileType>5</FileType>
<FilePath>..\..\..\..\Source\Application\CAN_User\Can_App.h</FilePath> <FilePath>..\..\..\..\Source\Application\CAN_User\Can_App.h</FilePath>
</File> </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> <File>
<FileName>Data_TPMS.c</FileName> <FileName>Data_TPMS.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
...@@ -593,6 +583,16 @@ ...@@ -593,6 +583,16 @@
<FileType>5</FileType> <FileType>5</FileType>
<FilePath>..\..\..\..\Source\Application\FaultCode\code.h</FilePath> <FilePath>..\..\..\..\Source\Application\FaultCode\code.h</FilePath>
</File> </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> </Files>
</Group> </Group>
<Group> <Group>
......
...@@ -14,7 +14,6 @@ SET CPU_CLOCK=0x00B71B00 ...@@ -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\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_user.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\can_app.__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\data_tpms.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\faultcode.__i" "C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\faultcode.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\data_voltage.__i" "C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\data_voltage.__i"
...@@ -23,6 +22,7 @@ SET CPU_CLOCK=0x00B71B00 ...@@ -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_lib.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\protocol_user.__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\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\bu98r10.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\services_mileage_user.__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" "C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\eemanager_interface.__i"
......
...@@ -23,31 +23,32 @@ void BackLight_Process(void) ...@@ -23,31 +23,32 @@ void BackLight_Process(void)
{ {
if (SYS_OPR_STAT_IGN_ON) 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 (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); TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_NIGHT);
} }
......
...@@ -38,7 +38,120 @@ void Data_Coolant_Temp_KL15_Init ( void ) ...@@ -38,7 +38,120 @@ void Data_Coolant_Temp_KL15_Init ( void )
DataCoolantTemp_Dis.u8_Flg = 0; 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; uint16_t Coolant_Temperature = 0;
uint8_t Coolant_Temperature_State = 0; uint8_t Coolant_Temperature_State = 0;
...@@ -165,27 +278,45 @@ void Data_Coolant_Temp_Display ( void ) ...@@ -165,27 +278,45 @@ void Data_Coolant_Temp_Display ( void )
if(DataCoolantTemp_Dis.u8_CurSeg > DataCoolantTemp_Dis.u8_DestSeg ) 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_UpFlashtimer = 0;
DataCoolantTemp_Dis.u8_Holdtimer = 0;
DataCoolantTemp_Dis.u8_DownFlashtimer++; DataCoolantTemp_Dis.u8_DownFlashtimer++;
if(DataCoolantTemp_Dis.u8_DownFlashtimer >= DataCoolantTemp_Dis.u8_Downtimer) if(DataCoolantTemp_Dis.u8_DownFlashtimer >= DataCoolantTemp_Dis.u8_Downtimer)
{ {
DataCoolantTemp_Dis.u8_DownFlashtimer = 0; 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)
{ {
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_DownFlashtimer = 0;
DataCoolantTemp_Dis.u8_Holdtimer = 0;
DataCoolantTemp_Dis.u8_UpFlashtimer++; DataCoolantTemp_Dis.u8_UpFlashtimer++;
if(DataCoolantTemp_Dis.u8_UpFlashtimer >= DataCoolantTemp_Dis.u8_Uptimer) if (DataCoolantTemp_Dis.u8_UpFlashtimer >= DataCoolantTemp_Dis.u8_Uptimer)
{ {
DataCoolantTemp_Dis.u8_UpFlashtimer = 0; DataCoolantTemp_Dis.u8_UpFlashtimer = 0;
DataCoolantTemp_Dis.u8_CurSeg ++; DataCoolantTemp_Dis.u8_CurSeg++;
} }
} }
//warning 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);
}
if( DataCoolantTemp.Valid == 0 ) // warning
if (DataCoolantTemp.Valid == 0)
{ {
DataCoolantTemp_Dis.u8_Warnflg = 1; DataCoolantTemp_Dis.u8_Warnflg = 1;
} }
...@@ -195,7 +326,7 @@ void Data_Coolant_Temp_Display ( void ) ...@@ -195,7 +326,7 @@ void Data_Coolant_Temp_Display ( void )
{ {
DataCoolantTemp_Dis.u8_Warnflg = 2; DataCoolantTemp_Dis.u8_Warnflg = 2;
} }
else if(DataCoolantTemp.Value <= 112) else if (DataCoolantTemp.Value <= 112)
{ {
DataCoolantTemp_Dis.u8_Warnflg = 0; DataCoolantTemp_Dis.u8_Warnflg = 0;
} }
...@@ -203,11 +334,7 @@ void Data_Coolant_Temp_Display ( void ) ...@@ -203,11 +334,7 @@ void Data_Coolant_Temp_Display ( void )
{ {
; ;
} }
} }
} }
else else
{ {
...@@ -217,25 +344,21 @@ void Data_Coolant_Temp_Display ( void ) ...@@ -217,25 +344,21 @@ void Data_Coolant_Temp_Display ( void )
DataCoolantTemp_Dis.u8_Warnflg = 0; DataCoolantTemp_Dis.u8_Warnflg = 0;
DataCoolantTemp_Dis.u8_Flg = 0; DataCoolantTemp_Dis.u8_Flg = 0;
} }
} }
uint8_t Get_Coolant_Temp_Seg(uint16_t Temp_Value)
void 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) else if (DataCoolantTemp_Dis.u8_CurSeg > 0)
{ {
if(Temp_Value <= 47) if (Temp_Value <= 47)
{ {
DataCoolantTemp_Dis.u8_DestSeg = 0; DataCoolantTemp_Dis.u8_DestSeg = 0;
} }
...@@ -245,15 +368,15 @@ void Get_Coolant_Temp_Seg(uint16_t Temp_Value) ...@@ -245,15 +368,15 @@ void Get_Coolant_Temp_Seg(uint16_t Temp_Value)
DataCoolantTemp_Dis.u8_DestSeg = 0; 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 ) else if (DataCoolantTemp_Dis.u8_CurSeg > 1)
{ {
if(Temp_Value <= 59) if (Temp_Value <= 59)
{ {
DataCoolantTemp_Dis.u8_DestSeg = 1; DataCoolantTemp_Dis.u8_DestSeg = 1;
} }
...@@ -263,15 +386,15 @@ void Get_Coolant_Temp_Seg(uint16_t Temp_Value) ...@@ -263,15 +386,15 @@ void Get_Coolant_Temp_Seg(uint16_t Temp_Value)
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;
} }
...@@ -281,15 +404,15 @@ void Get_Coolant_Temp_Seg(uint16_t Temp_Value) ...@@ -281,15 +404,15 @@ void Get_Coolant_Temp_Seg(uint16_t Temp_Value)
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;
} }
...@@ -299,11 +422,11 @@ void Get_Coolant_Temp_Seg(uint16_t Temp_Value) ...@@ -299,11 +422,11 @@ void Get_Coolant_Temp_Seg(uint16_t Temp_Value)
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;
} }
...@@ -317,42 +440,37 @@ void Get_Coolant_Temp_Seg(uint16_t Temp_Value) ...@@ -317,42 +440,37 @@ void Get_Coolant_Temp_Seg(uint16_t Temp_Value)
{ {
DataCoolantTemp_Dis.u8_DestSeg = 5; DataCoolantTemp_Dis.u8_DestSeg = 5;
} }
return DataCoolantTemp_Dis.u8_DestSeg;
} }
// 水温显示格数
//水温显示格数
uint8_t GET_DataCoolantTempSegDisp(void) 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) uint16_t GET_DataCoolantTempValueDisp(void)
{ {
return DataCoolantTemp.Value ; return DataCoolantTemp.Value;
}
uint16_t GET_DataCoolantSegValue(void)
{
return u32ColCurNum/10;
} }
uint8_t GET_DataCollantTempValueValid(void) uint8_t GET_DataCollantTempValueValid(void)
{ {
return DataCoolantTemp.Valid; return DataCoolantTemp.Valid;
} }
//水温灯及显示的报警信号 0:无报警,正常显示 1:掉线或者state无效,白色闪烁 2:高温,红色闪烁 // 水温灯及显示的报警信号 0:无报警,正常显示 1:掉线或者state无效,白色闪烁 2:高温,红色闪烁
uint8_t GET_DataCollantTempWarnflg(void) uint8_t GET_DataCollantTempWarnflg(void)
{ {
return DataCoolantTemp_Dis.u8_Warnflg; return DataCoolantTemp_Dis.u8_Warnflg;
} }
...@@ -17,12 +17,14 @@ typedef struct __attribute__((aligned(4))) ...@@ -17,12 +17,14 @@ typedef struct __attribute__((aligned(4)))
uint8_t u8_DestSeg; uint8_t u8_DestSeg;
uint8_t u8_CurSeg; uint8_t u8_CurSeg;
uint8_t u8_UpFlashtimer ; uint8_t u8_UpFlashtimer ;
uint8_t u8_Holdtimer ;
uint8_t u8_DownFlashtimer ; uint8_t u8_DownFlashtimer ;
uint8_t u8_Uptimer ; uint8_t u8_Uptimer ;
uint8_t u8_Downtimer ; uint8_t u8_Downtimer ;
uint8_t u8_Flashflg; uint8_t u8_Flashflg;
uint8_t u8_Warnflg; uint8_t u8_Warnflg;
uint8_t u8_Flg; uint8_t u8_Flg;
uint8_t u8Reserved;
}DataCoolantTempDisStruct; }DataCoolantTempDisStruct;
...@@ -43,15 +45,16 @@ typedef struct __attribute__((aligned(4))) ...@@ -43,15 +45,16 @@ typedef struct __attribute__((aligned(4)))
void Data_Coolant_Temp_KL30_Init(void); void Data_Coolant_Temp_KL30_Init(void);
void Data_Coolant_Temp_KL15_Init(void); void Data_Coolant_Temp_KL15_Init(void);
void Data_Coolant_Temp_Processing_Service(void); void Data_Coolant_Temp_Processing_Service(void);
void Get_Coolant_Temp_Seg(uint16_t Temp_Value); uint8_t Get_Coolant_Temp_Seg(uint16_t Temp_Value);
void Data_Coolant_Temp_Display ( void ); void Data_Coolant_Temp_Display (void);
uint8_t GET_DataCollantTempSegValid(void); uint8_t GET_DataCollantTempSegValid(void);
uint8_t GET_DataCoolantTempSegDisp(void); uint8_t GET_DataCoolantTempSegDisp(void);
uint16_t GET_DataCoolantTempValueDisp(void); uint16_t GET_DataCoolantTempValueDisp(void);
uint8_t GET_DataCollantTempWarnflg(void); uint8_t GET_DataCollantTempWarnflg(void);
uint16_t GET_DataCoolantSegValue(void);
extern DataCoolantTempStruct DataCoolantTemp ; extern DataCoolantTempStruct DataCoolantTemp;
#endif #endif
...@@ -18,9 +18,9 @@ const RTE_GPIO_Config_st_t KL30_Init_GpioConfig[Gpio_Max] = ...@@ -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_PIN01 */ {RTE_GPIO_PORT00_PIN01, RTE_GPIO_DIR_IN},
/* PORT0_PIN02 */ {RTE_GPIO_PORT00_PIN02, RTE_GPIO_DIR_IN}, /* PORT0_PIN02 */ {RTE_GPIO_PORT00_PIN02, GpioOut_Low},
/* PORT0_PIN03 */ {RTE_GPIO_PORT00_PIN03, RTE_GPIO_DIR_IN}, /* PORT0_PIN03 */ {RTE_GPIO_PORT00_PIN03, GpioOut_Low},
/* PORT0_PIN04 */ {RTE_GPIO_PORT00_PIN04, RTE_GPIO_DIR_IN}, /* PORT0_PIN04 */ {RTE_GPIO_PORT00_PIN04, GpioOut_Low},
/* PORT0_PIN05 */ {RTE_GPIO_PORT00_PIN05, RTE_GPIO_DIR_IN}, /* PORT0_PIN05 */ {RTE_GPIO_PORT00_PIN05, RTE_GPIO_DIR_IN},
/* PORT0_PIN06 */ {RTE_GPIO_PORT00_PIN06, 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] = ...@@ -55,9 +55,9 @@ const RTE_GPIO_Config_st_t KL30_Init_GpioConfig[Gpio_Max] =
/* PORT6_PIN62 */ {RTE_GPIO_PORT06_PIN02, GpioOut_Low}, /* PORT6_PIN62 */ {RTE_GPIO_PORT06_PIN02, GpioOut_Low},
/* PORT6_PIN63 */ {RTE_GPIO_PORT06_PIN03, GpioOut_Low}, /* PORT6_PIN63 */ {RTE_GPIO_PORT06_PIN03, GpioOut_Low},
/* PORT7_PIN70 */ {RTE_GPIO_PORT07_PIN00, RTE_GPIO_DIR_IN}, /* PORT7_PIN70 */ {RTE_GPIO_PORT07_PIN00, GpioOut_Low},
/* PORT7_PIN71 */ {RTE_GPIO_PORT07_PIN01, RTE_GPIO_DIR_IN}, /* PORT7_PIN71 */ {RTE_GPIO_PORT07_PIN01, GpioOut_Low},
/* PORT7_PIN72 */ {RTE_GPIO_PORT07_PIN02, RTE_GPIO_DIR_IN}, /* PORT7_PIN72 */ {RTE_GPIO_PORT07_PIN02, GpioOut_Low},
/* PORT7_PIN73 */ {RTE_GPIO_PORT07_PIN03, RTE_GPIO_DIR_IN}, /* PORT7_PIN73 */ {RTE_GPIO_PORT07_PIN03, RTE_GPIO_DIR_IN},
/* PORT7_PIN74 */ {RTE_GPIO_PORT07_PIN04, RTE_GPIO_DIR_IN}, /* PORT7_PIN74 */ {RTE_GPIO_PORT07_PIN04, RTE_GPIO_DIR_IN},
/* PORT7_PIN75 */ {RTE_GPIO_PORT07_PIN05, RTE_GPIO_DIR_IN}, /* PORT7_PIN75 */ {RTE_GPIO_PORT07_PIN05, RTE_GPIO_DIR_IN},
......
...@@ -119,7 +119,7 @@ void Gauge_Service(void) ...@@ -119,7 +119,7 @@ void Gauge_Service(void)
Gauge_Clock_Display(); Gauge_Clock_Display();
SEG_SET_FuelDial(1, Get_CurFuelSetp()); SEG_SET_FuelDial(1, Get_CurFuelSetp());
SEG_SET_EspeedDial(1, Get_DispEngineSpeed()/500); 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()); SEG_SET_Voltage_NUM(1, Get_Battery_Voltage());
#if(IC_Current == TY200_080000b_ty) #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()); 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) ...@@ -24,13 +24,13 @@ void BU98R10_CHIP0_SET_SD_LEVEL(uint8_t Level)
{ {
if (Level) if (Level)
{ {
RTE_GPIO_Config(BU98R10_CHIP0_SD, RTE_GPIO_DIR_OUT | 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); RTE_GPIO_Set_Level(BU98R10_CHIP0_SD, RTE_GPIO_LEVEL_HIGH);
} }
else else
{ {
RTE_GPIO_Config(BU98R10_CHIP0_SD, RTE_GPIO_DIR_OUT | 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); RTE_GPIO_Set_Level(BU98R10_CHIP0_SD, RTE_GPIO_LEVEL_LOW);
} }
} }
void BU98R10_CHIP1_SET_SD_LEVEL(uint8_t Level); void BU98R10_CHIP1_SET_SD_LEVEL(uint8_t Level);
...@@ -38,13 +38,13 @@ void BU98R10_CHIP1_SET_SD_LEVEL(uint8_t Level) ...@@ -38,13 +38,13 @@ void BU98R10_CHIP1_SET_SD_LEVEL(uint8_t Level)
{ {
if (Level) if (Level)
{ {
RTE_GPIO_Config(BU98R10_CHIP1_SD, RTE_GPIO_DIR_OUT | 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); RTE_GPIO_Set_Level(BU98R10_CHIP1_SD, RTE_GPIO_LEVEL_HIGH);
} }
else else
{ {
RTE_GPIO_Config(BU98R10_CHIP1_SD, RTE_GPIO_DIR_OUT | 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); RTE_GPIO_Set_Level(BU98R10_CHIP1_SD, RTE_GPIO_LEVEL_LOW);
} }
} }
void BU98R10_CHIP0_SET_CSB_LEVEL(uint8_t Level); void BU98R10_CHIP0_SET_CSB_LEVEL(uint8_t Level);
...@@ -52,13 +52,13 @@ void BU98R10_CHIP0_SET_CSB_LEVEL(uint8_t Level) ...@@ -52,13 +52,13 @@ void BU98R10_CHIP0_SET_CSB_LEVEL(uint8_t Level)
{ {
if (Level) if (Level)
{ {
RTE_GPIO_Config(BU98R10_CHIP0_CSB, RTE_GPIO_DIR_OUT | 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); RTE_GPIO_Set_Level(BU98R10_CHIP0_CSB, RTE_GPIO_LEVEL_HIGH);
} }
else else
{ {
RTE_GPIO_Config(BU98R10_CHIP0_CSB, RTE_GPIO_DIR_OUT | 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); RTE_GPIO_Set_Level(BU98R10_CHIP0_CSB, RTE_GPIO_LEVEL_LOW);
} }
} }
void BU98R10_CHIP1_SET_CSB_LEVEL(uint8_t Level); void BU98R10_CHIP1_SET_CSB_LEVEL(uint8_t Level);
...@@ -66,13 +66,13 @@ void BU98R10_CHIP1_SET_CSB_LEVEL(uint8_t Level) ...@@ -66,13 +66,13 @@ void BU98R10_CHIP1_SET_CSB_LEVEL(uint8_t Level)
{ {
if (Level) if (Level)
{ {
RTE_GPIO_Config(BU98R10_CHIP1_CSB, RTE_GPIO_DIR_OUT | 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); RTE_GPIO_Set_Level(BU98R10_CHIP1_CSB, RTE_GPIO_LEVEL_HIGH);
} }
else else
{ {
RTE_GPIO_Config(BU98R10_CHIP1_CSB, RTE_GPIO_DIR_OUT | 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); RTE_GPIO_Set_Level(BU98R10_CHIP1_CSB, RTE_GPIO_LEVEL_LOW);
} }
} }
void BU98R10_CHIP0_SET_SCL_LEVEL(uint8_t Level); void BU98R10_CHIP0_SET_SCL_LEVEL(uint8_t Level);
...@@ -80,13 +80,13 @@ void BU98R10_CHIP0_SET_SCL_LEVEL(uint8_t Level) ...@@ -80,13 +80,13 @@ void BU98R10_CHIP0_SET_SCL_LEVEL(uint8_t Level)
{ {
if (Level) if (Level)
{ {
RTE_GPIO_Config(BU98R10_CHIP0_SCL, RTE_GPIO_DIR_OUT | 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); RTE_GPIO_Set_Level(BU98R10_CHIP0_SCL, RTE_GPIO_LEVEL_HIGH);
} }
else else
{ {
RTE_GPIO_Config(BU98R10_CHIP0_SCL, RTE_GPIO_DIR_OUT | 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); RTE_GPIO_Set_Level(BU98R10_CHIP0_SCL, RTE_GPIO_LEVEL_LOW);
} }
} }
void BU98R10_CHIP1_SET_SCL_LEVEL(uint8_t Level); void BU98R10_CHIP1_SET_SCL_LEVEL(uint8_t Level);
...@@ -94,13 +94,13 @@ void BU98R10_CHIP1_SET_SCL_LEVEL(uint8_t Level) ...@@ -94,13 +94,13 @@ void BU98R10_CHIP1_SET_SCL_LEVEL(uint8_t Level)
{ {
if (Level) if (Level)
{ {
RTE_GPIO_Config(BU98R10_CHIP1_SCL, RTE_GPIO_DIR_OUT | 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); RTE_GPIO_Set_Level(BU98R10_CHIP1_SCL, RTE_GPIO_LEVEL_HIGH);
} }
else else
{ {
RTE_GPIO_Config(BU98R10_CHIP1_SCL, RTE_GPIO_DIR_OUT | 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); RTE_GPIO_Set_Level(BU98R10_CHIP1_SCL, RTE_GPIO_LEVEL_LOW);
} }
} }
void BU98R10_CHIP0_SET_SD_DIR(uint8_t Dir); void BU98R10_CHIP0_SET_SD_DIR(uint8_t Dir);
...@@ -108,7 +108,8 @@ void BU98R10_CHIP0_SET_SD_DIR(uint8_t Dir) ...@@ -108,7 +108,8 @@ void BU98R10_CHIP0_SET_SD_DIR(uint8_t Dir)
{ {
if (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 else
{ {
...@@ -120,6 +121,7 @@ void BU98R10_CHIP1_SET_SD_DIR(uint8_t Dir) ...@@ -120,6 +121,7 @@ void BU98R10_CHIP1_SET_SD_DIR(uint8_t Dir)
{ {
if (Dir) if (Dir)
{ {
//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_Config(BU98R10_CHIP1_SD, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_HIGH);
} }
else else
......
...@@ -12,7 +12,7 @@ const Line_In_Attribute_st g_stLineInAttribute[LINE_IN_MAX] = ...@@ -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, 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, 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, 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, }, {LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 500U, 500U, Get_LINE_IN_Little_Lamp, },
}; };
......
...@@ -50,6 +50,10 @@ static void Power_KL30_Init(void) ...@@ -50,6 +50,10 @@ static void Power_KL30_Init(void)
eeprom_StoreInfo_Init(); eeprom_StoreInfo_Init();
Can_Init(); Can_Init();
CAN_TX_Count_Init();
CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Enable);
Data_TPMS_KL30_Init ();
DFlash_init(); DFlash_init();
Data_Read_DiagPara(); Data_Read_DiagPara();
Analog_Signal_Conv_Init(); Analog_Signal_Conv_Init();
...@@ -82,7 +86,7 @@ static void Power_KL30_Init(void) ...@@ -82,7 +86,7 @@ static void Power_KL30_Init(void)
Telltales_Init(); Telltales_Init();
Telltales_UserInit(); Telltales_UserInit();
MenuData_Unit_Init(); MenuData_Unit_Init();
Data_TPMS_KL30_Init ();
RTCInformation.u8RTCSecond = 0; RTCInformation.u8RTCSecond = 0;
RTCInformation.u8RTCMinute = 0; RTCInformation.u8RTCMinute = 0;
RTCInformation.u8RTCHour = 0; RTCInformation.u8RTCHour = 0;
...@@ -93,8 +97,7 @@ static void Power_KL30_Init(void) ...@@ -93,8 +97,7 @@ static void Power_KL30_Init(void)
RTE_DEEPSLEEP_GPIO_Interrupt_Enable(WAKEUP_KL15_In,Trigger_Rising); RTE_DEEPSLEEP_GPIO_Interrupt_Enable(WAKEUP_KL15_In,Trigger_Rising);
FaultCode_Init(); FaultCode_Init();
CAN_TX_Count_Init();
CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Enable);
} }
extern uint32_t PowerIgnOffTimeLine; extern uint32_t PowerIgnOffTimeLine;
......
...@@ -44,6 +44,9 @@ static void LED_Tire_Pressure_Execution(Tellib_uint16_t led_status); ...@@ -44,6 +44,9 @@ static void LED_Tire_Pressure_Execution(Tellib_uint16_t led_status);
//Led_HighBeam_Count HighBeam_Timer; //Led_HighBeam_Count HighBeam_Timer;
Tellib_uint16_t LED_Battery_Voltage = 0; Tellib_uint16_t LED_Battery_Voltage = 0;
Tellib_uint16_t Battery_Voltage_valid = 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 ] = { const LED_Attribute_st LED_Attribute [ LED_Max ] = {
/* 指示灯索引 是否自检 外部信号自检 工作电源状态 自检开始时间 自检持续时间 指示灯点亮条件 指示灯执行函数 */ /* 指示灯索引 是否自检 外部信号自检 工作电源状态 自检开始时间 自检持续时间 指示灯点亮条件 指示灯执行函数 */
...@@ -380,6 +383,78 @@ static void LED_Bluetooth_Execution(Tellib_uint16_t led_status) ...@@ -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) static Tellib_uint16_t LED_TCS_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 0u; Tellib_uint16_t LED_STATE = 0u;
...@@ -419,6 +494,8 @@ static Tellib_uint16_t LED_TCS_Judgement(void) ...@@ -419,6 +494,8 @@ static Tellib_uint16_t LED_TCS_Judgement(void)
return LED_STATE; return LED_STATE;
} }
#endif
static void LED_TCS_Execution(Tellib_uint16_t led_status) static void LED_TCS_Execution(Tellib_uint16_t led_status)
{ {
if ( led_status == 1u ) 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