Commit 5f081835 authored by 李俭双's avatar 李俭双

feat:增加部分指示灯逻辑,还差蓝牙,导航,保养指示灯未完成

parent b10cd8bf
......@@ -184,7 +184,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;
}
......
......@@ -122,10 +122,12 @@ static void LED_High_Beam_Execution(Tellib_uint16_t led_status)
if ( led_status == 1u )
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_29_High_Beam, LED_ON);
SEG_SET_LED_STS(em_SEG_High_Beam, 1);
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_29_High_Beam, LED_OFF);
SEG_SET_LED_STS(em_SEG_High_Beam, 0);
}
}
static Tellib_uint16_t LED_FAULT_ELECTROSPRAY_Judgement(void)
......@@ -146,10 +148,12 @@ static void LED_FAULT_ELECTROSPRAY_Execution(Tellib_uint16_t led_status)
if (led_status == 1u)
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_32_Fault_Diagnosis, LED_ON);
SEG_SET_LED_STS(em_SEG_FAULT_ELECTROSPRAY, 1);
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_32_Fault_Diagnosis, LED_OFF);
SEG_SET_LED_STS(em_SEG_FAULT_ELECTROSPRAY, 0);
}
}
static Tellib_uint16_t LED_ABS_Judgement(void)
......@@ -170,10 +174,12 @@ static void LED_ABS_Execution(Tellib_uint16_t led_status)
if (led_status == 1u)
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_12_ABS_Alarm, LED_ON);
SEG_SET_LED_STS(em_SEG_ABS, 1);
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_12_ABS_Alarm, LED_OFF);
SEG_SET_LED_STS(em_SEG_ABS, 0);
}
}
static Tellib_uint16_t LED_Oil_Pressure_Judgement(void)
......@@ -194,10 +200,12 @@ static void LED_Oil_Pressure_Execution(Tellib_uint16_t led_status)
if (led_status == 1u)
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_22_Oil_Pressure, LED_ON);
SEG_SET_LED_STS(em_SEG_Oil_Pressure, 1);
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_22_Oil_Pressure, LED_OFF);
SEG_SET_LED_STS(em_SEG_Oil_Pressure, 0);
}
}
static Tellib_uint16_t LED_Fuel_Judgement(void)
......@@ -233,19 +241,19 @@ static void LED_Fuel_Execution(Tellib_uint16_t led_status)
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_21_Fuel_W, LED_ON);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_20_Fuel_Y, LED_OFF);
//SEG_SET_LED_STS(2,1);
SEG_SET_LED_STS(em_SEG_Fuel,1);
}
else if ( led_status == 2u )
{
if (FLASH_SYNC_1Hz)
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_20_Fuel_Y, LED_ON);
//SEG_SET_LED_STS(2,1);
SEG_SET_LED_STS(em_SEG_Fuel,1);
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_20_Fuel_Y, LED_OFF);
//SEG_SET_LED_STS(2,0);
SEG_SET_LED_STS(em_SEG_Fuel,0);
}
LED_Driver_Channel_Set(LampChannel_0, LampCh0_21_Fuel_W, LED_OFF);
......@@ -253,24 +261,74 @@ static void LED_Fuel_Execution(Tellib_uint16_t led_status)
else if ( led_status == 1u )
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_20_Fuel_Y, LED_ON);
SEG_SET_LED_STS(2,1);
SEG_SET_LED_STS(em_SEG_Fuel,1);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_21_Fuel_W, LED_OFF);
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_21_Fuel_W, LED_OFF);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_20_Fuel_Y, LED_OFF);
//SEG_SET_LED_STS(2,0);
SEG_SET_LED_STS(em_SEG_Fuel,0);
}
}
static Tellib_uint16_t LED_Coolant_Judgement(void)
{
Tellib_uint16_t LED_STATE = 0u;
if(GET_DataCollantTempWarnflg() == 2)
{
LED_STATE = 2;
}
else if (GET_DataCollantTempWarnflg() == 1)
{
LED_STATE = 3;
}
else
{
LED_STATE = 0;
}
return LED_STATE;
}
static void LED_Coolant_Execution(Tellib_uint16_t led_status)
{
;
if ( led_status == 2u )
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_13_Temp_AlarmW, LED_OFF);
if (FLASH_SYNC_1Hz)
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_11_Temp_AlarmR, LED_ON);
SEG_SET_LED_STS(em_SEG_Coolant, 1);
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_11_Temp_AlarmR, LED_OFF);
SEG_SET_LED_STS(em_SEG_Coolant, 0);
}
}
else if ( led_status == 3u )
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_11_Temp_AlarmR, LED_OFF);
if (FLASH_SYNC_1Hz)
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_13_Temp_AlarmW, LED_ON);
SEG_SET_LED_STS(em_SEG_Coolant, 1);
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_13_Temp_AlarmW, LED_OFF);
SEG_SET_LED_STS(em_SEG_Coolant, 0);
}
}
else if ( led_status == 1u )
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_11_Temp_AlarmR, LED_ON);
SEG_SET_LED_STS(em_SEG_Coolant, 1);
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_13_Temp_AlarmW, LED_OFF);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_11_Temp_AlarmR, LED_OFF);
SEG_SET_LED_STS(em_SEG_Coolant, 0);
}
}
static Tellib_uint16_t LED_Bluetooth_Judgement(void)
{
......@@ -290,10 +348,12 @@ 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);
SEG_SET_LED_STS(em_SEG_Bluetooth, 1);
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_23_Bluetooth, LED_OFF);
SEG_SET_LED_STS(em_SEG_Bluetooth, 0);
}
}
......@@ -338,16 +398,19 @@ 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);
SEG_SET_LED_STS(em_SEG_TCS, 1);
}
else if ( led_status == 2u )
{
if (FLASH_SYNC_1Hz)
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_25_TCS_Alarm, LED_ON);
SEG_SET_LED_STS(em_SEG_TCS, 1);
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_25_TCS_Alarm, LED_OFF);
SEG_SET_LED_STS(em_SEG_TCS, 0);
}
}
else if ( led_status == 3u )
......@@ -355,15 +418,18 @@ static void LED_TCS_Execution(Tellib_uint16_t led_status)
if (FLASH_SYNC_2Hz)
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_25_TCS_Alarm, LED_ON);
SEG_SET_LED_STS(em_SEG_TCS, 1);
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_25_TCS_Alarm, LED_OFF);
SEG_SET_LED_STS(em_SEG_TCS, 0);
}
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_25_TCS_Alarm, LED_OFF);
SEG_SET_LED_STS(em_SEG_TCS, 0);
}
}
static Tellib_uint16_t LED_Auto_Start_Judgement(void)
......@@ -384,10 +450,12 @@ static void LED_Auto_Start_Execution(Tellib_uint16_t led_status)
if ( led_status == 1u )
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_28_Auto_Star_Stop, LED_ON);
SEG_SET_LED_STS(em_SEG_Auto_Start_Stop, 1);
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_28_Auto_Star_Stop, LED_OFF);
SEG_SET_LED_STS(em_SEG_Auto_Start_Stop, 0);
}
}
//static Tellib_uint16_t LED_Keys_Judgement(void)
......@@ -406,7 +474,16 @@ static Tellib_uint16_t LED_Maintain_Judgement(void)
}
static void LED_Maintain_Execution(Tellib_uint16_t led_status)
{
;
if ( led_status == 1u )
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_33_Upkeep, LED_ON);
SEG_SET_LED_STS(em_SEG_Upkeep, 1);
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_33_Upkeep, LED_OFF);
SEG_SET_LED_STS(em_SEG_Upkeep, 0);
}
}
static Tellib_uint16_t LED_Low_Batt_Judgement(void)
{
......@@ -440,10 +517,12 @@ 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);
SEG_SET_LED_STS(em_SEG_Low_Batt_Vol, 1);
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_31_Low_Voltage, LED_OFF);
SEG_SET_LED_STS(em_SEG_Low_Batt_Vol, 0);
}
}
static Tellib_uint16_t LED_Lateral_Strut_Judgement(void)
......@@ -479,7 +558,16 @@ static Tellib_uint16_t LED_Lateral_Strut_Judgement(void)
}
static void LED_Lateral_Strut_Execution(Tellib_uint16_t led_status)
{
if ( led_status == 1u )
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_30_Lateral_Support, LED_ON);
SEG_SET_LED_STS(em_SEG_Lateral_Strut, 1);
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_30_Lateral_Support, LED_OFF);
SEG_SET_LED_STS(em_SEG_Lateral_Strut, 0);
}
}
static Tellib_uint16_t LED_Tire_Pressure_Judgement(void)
{
......@@ -500,11 +588,13 @@ static void LED_Tire_Pressure_Execution(Tellib_uint16_t led_status)
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_27_Tire_PressureY, LED_ON);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_26_Tire_PressureW, LED_OFF);
SEG_SET_LED_STS(em_SEG_Tire_Pressure_Alarm, 1);
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_26_Tire_PressureW, LED_ON);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_27_Tire_PressureY, LED_OFF);
SEG_SET_LED_STS(em_SEG_Tire_Pressure_Alarm, 1);
}
}
......@@ -529,29 +619,37 @@ void Turn_Left_Right_Lamp(void)
if (Line_In_Get_Status(LINE_IN_TurnLeft))
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_06_Turn_Left, LED_ON);
SEG_SET_LED_STS(em_SEG_Turn_Left, 1);
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_06_Turn_Left, LED_OFF);
SEG_SET_LED_STS(em_SEG_Turn_Left, 0);
}
if (Line_In_Get_Status(LINE_IN_TurnRight))
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_05_Turn_Right, LED_ON);
SEG_SET_LED_STS(em_SEG_Turn_Right, 1);
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_05_Turn_Right, LED_OFF);
SEG_SET_LED_STS(em_SEG_Turn_Right, 0);
}
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_06_Turn_Left, LED_ON);
SEG_SET_LED_STS(em_SEG_Turn_Left, 1);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_05_Turn_Right, LED_ON);
SEG_SET_LED_STS(em_SEG_Turn_Right, 1);
}
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_06_Turn_Left, LED_OFF);
SEG_SET_LED_STS(em_SEG_Turn_Left, 0);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_05_Turn_Right, LED_OFF);
SEG_SET_LED_STS(em_SEG_Turn_Right, 0);
}
}
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