Commit c19632df authored by 李俭双's avatar 李俭双

Merge branch 'lijianshuang' into 'dev'

Lijianshuang

See merge request !8
parents c8beb033 b21e326f
SET PATH=C:\Keil_v5\ARM\ARMCC\Bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Users\tyw05\AppData\Local\Microsoft\WindowsApps; SET PATH=C:\Keil_v5\ARM\ARMCC\Bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Users\tyw05\AppData\Local\Microsoft\WindowsApps;
SET ARMCC5_ASMOPT=--diag_suppress=9931
SET ARMCC5_CCOPT=--diag_suppress=9931
SET ARMCC5_LINKOPT=--diag_suppress=9931
SET CPU_TYPE=BAT32G139GK64FB SET CPU_TYPE=BAT32G139GK64FB
SET CPU_VENDOR=Cmsemicon SET CPU_VENDOR=Cmsemicon
SET UV2_TARGET=TianYing200 SET UV2_TARGET=TianYing200
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#define BACK_LIGHT_DAY 600 #define BACK_LIGHT_DAY 600
#define BACK_LIGHT_NIGHT 200 #define BACK_LIGHT_NIGHT 420
_Light g_Light; _Light g_Light;
void BackLight_Init(void) void BackLight_Init(void)
...@@ -19,32 +19,16 @@ void BackLight_Process(void) ...@@ -19,32 +19,16 @@ void BackLight_Process(void)
{ {
if (SYS_OPR_STAT_IGN_ON) if (SYS_OPR_STAT_IGN_ON)
{ {
// if(ALS_Get_Data1() > 200)//data1 500以内,data0 3000以内 if ( HighBeam_Timer.LED_Turnon == 5 )
// { {
// if (g_Light.Light_Day < 15)//1.5s 1500ms TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_NIGHT);
// { }
// g_Light.Light_Day++;//100ms else
// } {
// else
// {
// g_Light.Light_Night = 0;
// TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_DAY);
// }
// }
// else
// {
// if (g_Light.Light_Night < 15)
// {
// g_Light.Light_Night++;
// }
// else
// {
// g_Light.Light_Day = 0;
// TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_NIGHT);
// }
// }
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_DAY); TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_DAY);
} }
}
else else
{ {
g_Light.Light_Day = 0; g_Light.Light_Day = 0;
......
...@@ -30,7 +30,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] = ...@@ -30,7 +30,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u}, {0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u}, {0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u}, {0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
5000ul, 1000ul,
0x341ul, 0x341ul,
(( void * )0), (( void * )0),
(( void * )0), (( void * )0),
...@@ -40,7 +40,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] = ...@@ -40,7 +40,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u}, {0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u}, {0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u}, {0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
5000ul, 1000ul,
0x111ul, 0x111ul,
(( void * )0), (( void * )0),
(( void * )0), (( void * )0),
...@@ -50,7 +50,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] = ...@@ -50,7 +50,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u}, {0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u}, {0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u}, {0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
5000ul, 1000ul,
0x401ul, 0x401ul,
(( void * )0), (( void * )0),
(( void * )0), (( void * )0),
......
...@@ -47,10 +47,10 @@ typedef enum ...@@ -47,10 +47,10 @@ typedef enum
LampCh0_26_Tire_PressureW, LampCh0_26_Tire_PressureW,
LampCh0_27_Tire_PressureY, LampCh0_27_Tire_PressureY,
LampCh0_28_Auto_Star_Stop, LampCh0_28_Auto_Star_Stop,
LampCh0_29_MPH, LampCh0_29_High_Beam,
LampCh0_30_High_Beam, LampCh0_30_Lateral_Support,
LampCh0_31_Lateral_Support, LampCh0_31_Low_Voltage,
LampCh0_32_Fault_Diagnosis, LampCh0_32_Fault_Diagnosis,
LampCh0_33_Upkeep, LampCh0_33_Upkeep,
LampCh0_34_TRIP, LampCh0_34_TRIP,
......
...@@ -50,7 +50,6 @@ static void Power_KL30_Init(void) ...@@ -50,7 +50,6 @@ static void Power_KL30_Init(void)
DFlash_init(); DFlash_init();
Analog_Signal_Conv_Init(); Analog_Signal_Conv_Init();
BU98R10_Init(); BU98R10_Init();
BackLight_Init();
Sys_KL30_Init(); Sys_KL30_Init();
Checkself_Init(); Checkself_Init();
Data_Vehicle_Speed_KL30_Init(); Data_Vehicle_Speed_KL30_Init();
...@@ -71,6 +70,7 @@ static void Power_KL30_Init(void) ...@@ -71,6 +70,7 @@ static void Power_KL30_Init(void)
TimerM_PWM_CH_Output_init(TIMERM_COUNTER1, TIMERM_CHB, ActiveLevel_High); TimerM_PWM_CH_Output_init(TIMERM_COUNTER1, TIMERM_CHB, ActiveLevel_High);
Telltales_Init(); Telltales_Init();
Telltales_UserInit();
MenuData_Unit_Init(); MenuData_Unit_Init();
g_stRTCInformation.u8RTCSecond = 0; g_stRTCInformation.u8RTCSecond = 0;
g_stRTCInformation.u8RTCMinute = 0; g_stRTCInformation.u8RTCMinute = 0;
...@@ -93,7 +93,6 @@ static void Power_Wakeup_Init(void) ...@@ -93,7 +93,6 @@ static void Power_Wakeup_Init(void)
Analog_Signal_Conv_Init(); Analog_Signal_Conv_Init();
Data_User_Mileage_WakeupInit(); Data_User_Mileage_WakeupInit();
BU98R10_Init(); BU98R10_Init();
BackLight_Init();
Sys_WakeUp_Init(); Sys_WakeUp_Init();
Data_Vehicle_Speed_KL30_Init(); Data_Vehicle_Speed_KL30_Init();
Data_Vehicle_Speed_Wakeup_Init(); Data_Vehicle_Speed_Wakeup_Init();
...@@ -113,6 +112,7 @@ static void Power_Wakeup_Init(void) ...@@ -113,6 +112,7 @@ static void Power_Wakeup_Init(void)
TimerM_PWM_CH_Output_init(TIMERM_COUNTER0, TIMERM_CHD, ActiveLevel_High); TimerM_PWM_CH_Output_init(TIMERM_COUNTER0, TIMERM_CHD, ActiveLevel_High);
TimerM_PWM_CH_Output_init(TIMERM_COUNTER1, TIMERM_CHB, ActiveLevel_High); TimerM_PWM_CH_Output_init(TIMERM_COUNTER1, TIMERM_CHB, ActiveLevel_High);
Telltales_Init(); Telltales_Init();
Telltales_UserInit();
RTE_DEEPSLEEP_GPIO_Interrupt_Enable(WAKEUP_KL15_In,Trigger_Rising); RTE_DEEPSLEEP_GPIO_Interrupt_Enable(WAKEUP_KL15_In,Trigger_Rising);
} }
...@@ -134,10 +134,10 @@ static void Power_IG_OFF_Init(void) ...@@ -134,10 +134,10 @@ static void Power_IG_OFF_Init(void)
static void Power_IG_ON_Init(void) static void Power_IG_ON_Init(void)
{ {
ClearODO_Flag = 0; ClearODO_Flag = 0;
BackLight_Init();
Checkself_Init(); Checkself_Init();
Line_In_KL15_ON_Init(); Line_In_KL15_ON_Init();
Telltales_KL15_Init(); Telltales_KL15_Init();
Telltales_UserInit();
Fuel_KL15_Init(); Fuel_KL15_Init();
} }
......
...@@ -27,8 +27,8 @@ static Tellib_uint16_t LED_TCS_Judgement(void); ...@@ -27,8 +27,8 @@ static Tellib_uint16_t LED_TCS_Judgement(void);
static void LED_TCS_Execution(Tellib_uint16_t led_status); static void LED_TCS_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_Auto_Start_Judgement(void); static Tellib_uint16_t LED_Auto_Start_Judgement(void);
static void LED_Auto_Start_Execution(Tellib_uint16_t led_status); static void LED_Auto_Start_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_Keys_Judgement(void); //static Tellib_uint16_t LED_Keys_Judgement(void);
static void LED_Keys_Execution(Tellib_uint16_t led_status); //static void LED_Keys_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_Maintain_Judgement(void); static Tellib_uint16_t LED_Maintain_Judgement(void);
static void LED_Maintain_Execution(Tellib_uint16_t led_status); static void LED_Maintain_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_Low_Batt_Judgement(void); static Tellib_uint16_t LED_Low_Batt_Judgement(void);
...@@ -42,6 +42,7 @@ static void LED_Navigato_Execution(Tellib_uint16_t led_status); ...@@ -42,6 +42,7 @@ static void LED_Navigato_Execution(Tellib_uint16_t led_status);
Led_HighBeam_Count HighBeam_Timer; Led_HighBeam_Count HighBeam_Timer;
Tellib_uint16_t LED_Battery_Voltage = 0;
const LED_Attribute_st LED_Attribute [ LED_Max ] = { const LED_Attribute_st LED_Attribute [ LED_Max ] = {
/* 指示灯索引 是否自检 外部信号自检 工作电源状态 自检开始时间 自检持续时间 指示灯点亮条件 指示灯执行函数 */ /* 指示灯索引 是否自检 外部信号自检 工作电源状态 自检开始时间 自检持续时间 指示灯点亮条件 指示灯执行函数 */
...@@ -54,7 +55,7 @@ const LED_Attribute_st LED_Attribute [ LED_Max ] = { ...@@ -54,7 +55,7 @@ const LED_Attribute_st LED_Attribute [ LED_Max ] = {
{em_LED_Bluetooth, SelfCheck, NoExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Bluetooth_Judgement, LED_Bluetooth_Execution}, {em_LED_Bluetooth, SelfCheck, NoExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Bluetooth_Judgement, LED_Bluetooth_Execution},
{em_LED_TCS, SelfCheck, NoExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_TCS_Judgement, LED_TCS_Execution}, {em_LED_TCS, SelfCheck, NoExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_TCS_Judgement, LED_TCS_Execution},
{em_LED_Auto_Start_Stop, SelfCheck, NoExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Auto_Start_Judgement, LED_Auto_Start_Execution}, {em_LED_Auto_Start_Stop, SelfCheck, NoExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Auto_Start_Judgement, LED_Auto_Start_Execution},
{em_LED_Keys, SelfCheck, NoExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Keys_Judgement, LED_Keys_Execution}, //{em_LED_Keys, SelfCheck, NoExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Keys_Judgement, LED_Keys_Execution},
{em_LED_Maintain, SelfCheck, NoExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Maintain_Judgement, LED_Maintain_Execution}, {em_LED_Maintain, SelfCheck, NoExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Maintain_Judgement, LED_Maintain_Execution},
{em_LED_Low_Batt_Vol, SelfCheck, NoExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Low_Batt_Judgement, LED_Low_Batt_Execution}, {em_LED_Low_Batt_Vol, SelfCheck, NoExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Low_Batt_Judgement, LED_Low_Batt_Execution},
{em_LED_Lateral_Strut, SelfCheck, NoExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Lateral_Strut_Judgement, LED_Lateral_Strut_Execution}, {em_LED_Lateral_Strut, SelfCheck, NoExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Lateral_Strut_Judgement, LED_Lateral_Strut_Execution},
...@@ -74,8 +75,13 @@ void Telltales_Init(void) ...@@ -74,8 +75,13 @@ void Telltales_Init(void)
m_ExtPara.LED_PowerON_TimerCbk = Common_GetIgnOnTime; m_ExtPara.LED_PowerON_TimerCbk = Common_GetIgnOnTime;
m_ExtPara.LED_PowerCbk = Common_Get_IG_Sts; m_ExtPara.LED_PowerCbk = Common_Get_IG_Sts;
Telltales_KL30_Wakeup_Init(Tel_Mem, LED_Attribute, &m_ExtPara); Telltales_KL30_Wakeup_Init(Tel_Mem, LED_Attribute, &m_ExtPara);
}
void Telltales_UserInit(void)
{
HighBeam_Timer.LED_Turnon = 0; HighBeam_Timer.LED_Turnon = 0;
HighBeam_Timer.LED_Turnoff = 0; HighBeam_Timer.LED_Turnoff = 0;
LED_Battery_Voltage = 0;
} }
static Tellib_uint16_t LED_High_Beam_Judgement(void) static Tellib_uint16_t LED_High_Beam_Judgement(void)
...@@ -115,11 +121,11 @@ static void LED_High_Beam_Execution(Tellib_uint16_t led_status) ...@@ -115,11 +121,11 @@ static void LED_High_Beam_Execution(Tellib_uint16_t led_status)
{ {
if ( led_status == 1u ) if ( led_status == 1u )
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_30_High_Beam, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_29_High_Beam, LED_ON);
} }
else else
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_30_High_Beam, LED_OFF); LED_Driver_Channel_Set(LampChannel_0, LampCh0_29_High_Beam, LED_OFF);
} }
} }
static Tellib_uint16_t LED_FAULT_ELECTROSPRAY_Judgement(void) static Tellib_uint16_t LED_FAULT_ELECTROSPRAY_Judgement(void)
...@@ -154,24 +160,9 @@ static Tellib_uint16_t LED_ABS_Judgement(void) ...@@ -154,24 +160,9 @@ static Tellib_uint16_t LED_ABS_Judgement(void)
LED_STATE = 0; LED_STATE = 0;
} }
else else
{
if((CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x120_Msg_Count) == CAN_SIG_LOST) || (Get_CAN_CH0_ID_120_Sig_ABS_Warning_lamp() == 1) || (Get_CAN_CH0_ID_120_Sig_ABS_Warning_lamp() == 3))
{ {
LED_STATE = 1; LED_STATE = 1;
} }
else if(Get_CAN_CH0_ID_120_Sig_ABS_Warning_lamp() == 2)
{
LED_STATE = 2;
}
else if (Get_CAN_CH0_ID_120_Sig_ABS_Warning_lamp() == 0)
{
LED_STATE = 0;
}
else
{
;
}
}
return LED_STATE; return LED_STATE;
} }
static void LED_ABS_Execution(Tellib_uint16_t led_status) static void LED_ABS_Execution(Tellib_uint16_t led_status)
...@@ -180,17 +171,6 @@ static void LED_ABS_Execution(Tellib_uint16_t led_status) ...@@ -180,17 +171,6 @@ static void LED_ABS_Execution(Tellib_uint16_t led_status)
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_12_ABS_Alarm, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_12_ABS_Alarm, LED_ON);
} }
else if ( led_status == 2u)
{
if(FLASH_SYNC_1Hz)
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_12_ABS_Alarm, LED_ON);
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_12_ABS_Alarm, LED_OFF);
}
}
else else
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_12_ABS_Alarm, LED_OFF); LED_Driver_Channel_Set(LampChannel_0, LampCh0_12_ABS_Alarm, LED_OFF);
...@@ -238,12 +218,12 @@ static Tellib_uint16_t LED_Fuel_Judgement(void) ...@@ -238,12 +218,12 @@ static Tellib_uint16_t LED_Fuel_Judgement(void)
} }
else else
{ {
LED_STATE = 2;//开路 LED_STATE = 2;//开路,黄灯闪
} }
} }
else else
{ {
LED_STATE = 1; //黄灯 LED_STATE = 1; //黄灯常亮
} }
return LED_STATE; return LED_STATE;
} }
...@@ -295,39 +275,130 @@ static void LED_Coolant_Execution(Tellib_uint16_t led_status) ...@@ -295,39 +275,130 @@ static void LED_Coolant_Execution(Tellib_uint16_t led_status)
static Tellib_uint16_t LED_Bluetooth_Judgement(void) static Tellib_uint16_t LED_Bluetooth_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 0u; Tellib_uint16_t LED_STATE = 0u;
if (0)
{
LED_STATE = 1u;
}
else
{
LED_STATE = 0u;
}
return LED_STATE; return LED_STATE;
} }
static void LED_Bluetooth_Execution(Tellib_uint16_t led_status) static void LED_Bluetooth_Execution(Tellib_uint16_t led_status)
{ {
; if ( led_status == 1u )
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_23_Bluetooth, LED_ON);
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_23_Bluetooth, LED_OFF);
}
} }
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;
if((CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x120_Msg_Count) == CAN_SIG_LOST) )
{
LED_STATE = 1;
}
else
{
if (Get_Dis_Tcs_Val() == 1)
{
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_STATE = 1;
}
else if (Get_CAN_CH0_ID_120_Sig_TCSStatus() == 4)
{
LED_STATE = 2; //1HZ闪烁
}
else if (Get_CAN_CH0_ID_120_Sig_TCSStatus() == 6)
{
LED_STATE = 3; //2HZ闪烁
}
else if ((Get_CAN_CH0_ID_120_Sig_TCSStatus() == 0) || (Get_CAN_CH0_ID_120_Sig_TCSStatus() == 7))
{
LED_STATE = 0;
}
}
else
{
LED_STATE = 0;
}
}
return LED_STATE; return LED_STATE;
} }
static void LED_TCS_Execution(Tellib_uint16_t led_status) static void LED_TCS_Execution(Tellib_uint16_t led_status)
{ {
; if ( led_status == 1u )
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_25_TCS_Alarm, LED_ON);
}
else if ( led_status == 2u )
{
if (FLASH_SYNC_1Hz)
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_25_TCS_Alarm, LED_ON);
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_25_TCS_Alarm, LED_OFF);
}
}
else if ( led_status == 3u )
{
if (FLASH_SYNC_2Hz)
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_25_TCS_Alarm, LED_ON);
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_25_TCS_Alarm, LED_OFF);
}
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_25_TCS_Alarm, LED_OFF);
}
} }
static Tellib_uint16_t LED_Auto_Start_Judgement(void) static Tellib_uint16_t LED_Auto_Start_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 0u; Tellib_uint16_t LED_STATE = 0u;
if (Line_In_Get_Status(LINE_IN_Auto_Start_Stop))
{
LED_STATE = 1;
}
else
{
LED_STATE = 0;
}
return LED_STATE; return LED_STATE;
} }
static void LED_Auto_Start_Execution(Tellib_uint16_t led_status) static void LED_Auto_Start_Execution(Tellib_uint16_t led_status)
{ {
; if ( led_status == 1u )
} {
static Tellib_uint16_t LED_Keys_Judgement(void) LED_Driver_Channel_Set(LampChannel_0, LampCh0_28_Auto_Star_Stop, LED_ON);
{ }
Tellib_uint16_t LED_STATE = 0u; else
return LED_STATE; {
} LED_Driver_Channel_Set(LampChannel_0, LampCh0_28_Auto_Star_Stop, LED_OFF);
static void LED_Keys_Execution(Tellib_uint16_t led_status) }
{
;
} }
//static Tellib_uint16_t LED_Keys_Judgement(void)
//{
// Tellib_uint16_t LED_STATE = 0u;
// return LED_STATE;
//}
//static void LED_Keys_Execution(Tellib_uint16_t led_status)
//{
// ;
//}
static Tellib_uint16_t LED_Maintain_Judgement(void) static Tellib_uint16_t LED_Maintain_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 0u; Tellib_uint16_t LED_STATE = 0u;
...@@ -340,20 +411,75 @@ static void LED_Maintain_Execution(Tellib_uint16_t led_status) ...@@ -340,20 +411,75 @@ static void LED_Maintain_Execution(Tellib_uint16_t led_status)
static Tellib_uint16_t LED_Low_Batt_Judgement(void) static Tellib_uint16_t LED_Low_Batt_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 0u; Tellib_uint16_t LED_STATE = 0u;
Tellib_uint16_t Battery_Voltage = 0u;
Battery_Voltage = Get_CAN_CH0_ID_401_Sig_ECU_Battery_Voltage();
if((CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x401_Msg_Count) == CAN_SIG_LOST) )
{
LED_Battery_Voltage = 1;
}
else
{
if (Battery_Voltage < 118)
{
LED_Battery_Voltage = 1;
}
else if (Battery_Voltage >= 120)
{
LED_Battery_Voltage = 0;
}
else
{
;
}
}
LED_STATE = LED_Battery_Voltage;
return LED_STATE; return LED_STATE;
} }
static void LED_Low_Batt_Execution(Tellib_uint16_t led_status) static void LED_Low_Batt_Execution(Tellib_uint16_t led_status)
{ {
; if ( led_status == 1u )
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_31_Low_Voltage, LED_ON);
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_31_Low_Voltage, LED_OFF);
}
} }
static Tellib_uint16_t LED_Lateral_Strut_Judgement(void) static Tellib_uint16_t LED_Lateral_Strut_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 0u; Tellib_uint16_t LED_STATE = 0u;
Tellib_uint16_t SideStand = 0u;
Tellib_uint16_t SideStand_State = 0u;
SideStand = Get_CAN_CH0_ID_111_Sig_ISG_SideStand();
SideStand_State = Get_CAN_CH0_ID_111_Sig_ISG_SideStand_State();
if((CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x111_Msg_Count) == CAN_SIG_LOST) )
{
LED_STATE = 0;
}
else
{
if ( SideStand_State == 1)
{
LED_STATE = 0;
}
else
{
if (SideStand == 1)
{
LED_STATE = 1;
}
else
{
LED_STATE = 0;
}
}
}
return LED_STATE; return LED_STATE;
} }
static void LED_Lateral_Strut_Execution(Tellib_uint16_t led_status) static void LED_Lateral_Strut_Execution(Tellib_uint16_t led_status)
{ {
;
} }
static Tellib_uint16_t LED_Tire_Pressure_Judgement(void) static Tellib_uint16_t LED_Tire_Pressure_Judgement(void)
{ {
......
...@@ -13,7 +13,7 @@ typedef enum ...@@ -13,7 +13,7 @@ typedef enum
em_LED_Bluetooth, em_LED_Bluetooth,
em_LED_TCS, em_LED_TCS,
em_LED_Auto_Start_Stop, em_LED_Auto_Start_Stop,
em_LED_Keys, //em_LED_Keys,
em_LED_Maintain, em_LED_Maintain,
em_LED_Low_Batt_Vol, em_LED_Low_Batt_Vol,
em_LED_Lateral_Strut, em_LED_Lateral_Strut,
...@@ -32,6 +32,7 @@ extern Led_HighBeam_Count HighBeam_Timer; ...@@ -32,6 +32,7 @@ extern Led_HighBeam_Count HighBeam_Timer;
void Telltales_Init(void); void Telltales_Init(void);
void Telltales_UserInit(void);
#endif #endif
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