Commit 09ca5326 authored by 王雅楠's avatar 王雅楠

Merge branch 'wangyanan' into 'dev'

 feat:灯和硬线部分完成代码编写

See merge request !17
parents 3fc243f0 1f224ef3
......@@ -8,14 +8,13 @@ const Line_In_Attribute_st g_stLineInAttribute[LINE_IN_MAX] =
{LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_Turn_Left, },
{LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_Turn_Right, },
{LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 60U, 20U, Get_LINE_IN_High_Beam, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 100U, 20U, Get_LINE_IN_Efi_Fault, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 100U, 20U, Get_LINE_IN_Efi_Fault, },
{LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_ABS, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_Auto_Start_Stop, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_Oil_Pressure_Alert, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_Oil_Pressure_Alert, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_Voltage, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_Fuel_Level_Low, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_E, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_S, },
{LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_Coolant_Temperature },
};
Linelib_uint8_t Get_LINE_IN_Turn_Left(void)
{
......@@ -46,7 +45,7 @@ Linelib_uint8_t Get_LINE_IN_Turn_Right(void)
Linelib_uint8_t Get_LINE_IN_High_Beam(void)
{
Linelib_uint8_t ret = 0U;
if (RTE_GPIO_Get_Level(HighBeam_P_In))
if (RTE_GPIO_Get_Level(HighBeam_MCU))
{
ret = 1u;
}
......@@ -85,7 +84,7 @@ Linelib_uint8_t Get_LINE_IN_ABS(void)
Linelib_uint8_t Get_LINE_IN_Auto_Start_Stop(void)
{
Linelib_uint8_t ret = 0U;
if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))
if (RTE_GPIO_Get_Level(Start_stop_MCU))
{
ret = 1u;
}
......@@ -98,7 +97,7 @@ Linelib_uint8_t Get_LINE_IN_Auto_Start_Stop(void)
Linelib_uint8_t Get_LINE_IN_Oil_Pressure_Alert(void)
{
Linelib_uint8_t ret = 0U;
if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))
if (RTE_GPIO_Get_Level(Gears_N_MCU))
{
ret = 1u;
}
......@@ -110,47 +109,34 @@ Linelib_uint8_t Get_LINE_IN_Oil_Pressure_Alert(void)
}
Linelib_uint8_t Get_LINE_IN_Voltage(void)
{
Linelib_uint8_t ret = 0U;
if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))
{
ret = 1u;
}
else
{
ret = 0UL;
}
return ret;
// Linelib_uint8_t ret = 0U;
// if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))/*没找到电压指示灯*/
// {
// ret = 1u;
// }
// else
// {
// ret = 0UL;
// }
// return ret;
}
Linelib_uint8_t Get_LINE_IN_Fuel_Level_Low(void)
{
Linelib_uint8_t ret = 0U;
if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))
{
ret = 1u;
}
else
{
ret = 0UL;
}
return ret;
}
Linelib_uint8_t Get_LINE_IN_E(void)
{
Linelib_uint8_t ret = 0U;
if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))
{
ret = 1u;
}
else
{
ret = 0UL;
}
return ret;
// Linelib_uint8_t ret = 0U;
// if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))/*修改指示灯*/
// {
// ret = 1u;
// }
// else
// {
// ret = 0UL;
// }
// return ret;
}
Linelib_uint8_t Get_LINE_IN_S(void)
Linelib_uint8_t Get_LINE_IN_Coolant_Temperature(void)
{
Linelib_uint8_t ret = 0U;
if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))
if (RTE_GPIO_Get_Level(A_WaterTemp_IN))
{
ret = 1u;
}
......@@ -161,6 +147,8 @@ Linelib_uint8_t Get_LINE_IN_S(void)
return ret;
}
__align(4)
Linelib_uint8_t LINE_IN_Men[LINE_IN_MAX * LINE_IN_BLOCK_SIZE];
......
......@@ -14,8 +14,8 @@ typedef enum
LINE_IN_Oil_Pressure_Alert,
LINE_IN_Voltage,
LINE_IN_Fuel_Level_Low,
LINE_IN_E,
LINE_IN_S,
LINE_IN_Coolant_Temperature,
LINE_IN_MAX,
} LINE_IN_Enum_t;
......@@ -30,6 +30,5 @@ Linelib_uint8_t Get_LINE_IN_Auto_Start_Stop(void);
Linelib_uint8_t Get_LINE_IN_Oil_Pressure_Alert(void);
Linelib_uint8_t Get_LINE_IN_Voltage(void);
Linelib_uint8_t Get_LINE_IN_Fuel_Level_Low(void);
Linelib_uint8_t Get_LINE_IN_E(void);
Linelib_uint8_t Get_LINE_IN_S(void);
Linelib_uint8_t Get_LINE_IN_Coolant_Temperature(void);
#endif
......@@ -73,8 +73,11 @@ void Can_ID_401(uint8_t CopyData [])
{
u8CanId401Flag = 1;
}
/******************************************************************************************************************************************************************************************************************* */
static Tellib_uint16_t LED_Turn_Left_Judgement(void)//硬线-P10 高电平
/*硬线-P10 高电平点亮*/
static Tellib_uint16_t LED_Turn_Left_Judgement(void)
{
Tellib_uint16_t LED_STATE = 0u;
if (Line_In_Get_Status(LINE_IN_Turn_Left))
......@@ -89,17 +92,11 @@ static Tellib_uint16_t LED_Turn_Left_Judgement(void)//硬线-P10 高电平
}
static void LED_Turn_Left_Execution(Tellib_uint16_t led_status)
{
// if (led_status == 1u)
// {
// RTE_GPIO_Set_Level(TurnLeft_MUC_OUT, LED_LINEOUT_High);
// }
// else
// {
// RTE_GPIO_Set_Level(TurnLeft_MUC_OUT, LED_LINEOUT_Low);
// }
}
/*硬线-P9 高电平*/
/*硬线-P9 高电平点亮*/
static Tellib_uint16_t LED_Turn_Right_Judgement(void)
{
Tellib_uint16_t LED_STATE = 0u;
......@@ -115,16 +112,11 @@ static Tellib_uint16_t LED_Turn_Right_Judgement(void)
}
static void LED_Turn_Right_Execution(Tellib_uint16_t led_status)
{
// if (led_status == 1u)
// {
// RTE_GPIO_Set_Level(TurnRight_MUC_OUT, LED_LINEOUT_High);
// }
// else
// {
// RTE_GPIO_Set_Level(TurnRight_MUC_OUT, LED_LINEOUT_Low);
// }
}
/*硬线-P18 高电平*/
/*硬线-P18 高电平点亮*/
static Tellib_uint16_t LED_High_Beam_Judgement(void)
{
Tellib_uint16_t LED_STATE = 0u;
......@@ -140,16 +132,10 @@ static Tellib_uint16_t LED_High_Beam_Judgement(void)
}
static void LED_High_Beam_Execution(Tellib_uint16_t led_status)
{
// if (led_status == 1u)
// {
// RTE_GPIO_Set_Level(HighBeam_MUC_OUT, LED_LINEOUT_High);
// }
// else
// {
// RTE_GPIO_Set_Level(HighBeam_MUC_OUT, LED_LINEOUT_Low);
// }
}
/*硬线-P15 低电平*/
/*硬线-P15 低电平点亮*/
static Tellib_uint16_t LED_Efi_Fault_Judgement(void)
{
Tellib_uint16_t LED_STATE = 0u;
......@@ -165,15 +151,10 @@ static Tellib_uint16_t LED_Efi_Fault_Judgement(void)
}
static void LED_Efi_Fault_Execution(Tellib_uint16_t led_status)
{
// if (led_status == 1u)
// {
// RTE_GPIO_Set_Level(EfiFault_MUC_OUT, LED_LINEOUT_High);
// }
// else
// {
// RTE_GPIO_Set_Level(EfiFault_MUC_OUT, LED_LINEOUT_Low);
// }
}
/*硬线-P7 悬空/高点亮 接地灭*/
static Tellib_uint16_t LED_ABS_Judgement(void)
{
......@@ -190,15 +171,9 @@ static Tellib_uint16_t LED_ABS_Judgement(void)
}
static void LED_ABS_Execution(Tellib_uint16_t led_status)
{
// if (led_status == 1u)
// {
// RTE_GPIO_Set_Level(OilPressureAlert_MUC_OUT, LED_LINEOUT_High);
// }
// else
// {
// RTE_GPIO_Set_Level(ABS_MUC_OUT, LED_LINEOUT_Low);
// }
}
/*硬线-P12 低电平*/
static Tellib_uint16_t LED_Auto_Start_Stop_Judgement(void)
{
......@@ -215,16 +190,11 @@ static Tellib_uint16_t LED_Auto_Start_Stop_Judgement(void)
}
static void LED_Auto_Start_Stop_Execution(Tellib_uint16_t led_status)
{
// if (led_status == 1u)
// {
// RTE_GPIO_Set_Level(AutoStartStop_MUC_OUT, LED_LINEOUT_High);
// }
// else
// {
// RTE_GPIO_Set_Level(AutoStartStop_MUC_OUT, LED_LINEOUT_Low);
// }
}
/*硬线-P21 低电平*/
/*硬线-P21 低电平点亮*/
static Tellib_uint16_t LED_Oil_Pressure_Alert_Judgement(void)
{
Tellib_uint16_t LED_STATE = 0u;
......@@ -240,81 +210,64 @@ static Tellib_uint16_t LED_Oil_Pressure_Alert_Judgement(void)
}
static void LED_Oil_Pressure_Alert_Execution(Tellib_uint16_t led_status)
{
// if (led_status == 1u)
// {
// RTE_GPIO_Set_Level(OilPressureAlert_MUC_OUT, LED_LINEOUT_High);
// }
// else
// {
// RTE_GPIO_Set_Level(OilPressureAlert_MUC_OUT, LED_LINEOUT_Low);
// }
}
/*CAN信号来源:TCS_37B*/
static Tellib_uint16_t LED_TCS_Judgement(void)
{
//Tellib_uint16_t LED_STATE = 0u;
//if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CH0_37B_Msg_Count) == CAN_SIG_LOST)
//{
// LED_STATE = 0u;
//}
//else
//{
// if(Get_CAN_CH0_ID_37B_Sig_TCS_Work_Mode() == 1)
// {
// LED_STATE = 1u;
// }
// else
// {
// LED_STATE = 0u;
// }
//}
//return LED_STATE;
Tellib_uint16_t LED_STATE = 0u;
if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CH0_37B_Msg_Count) == CAN_SIG_LOST)
{
LED_STATE = 0u;
}
else
{
if(Get_CAN_CH0_ID_37B_Sig_TCS_Warning_Lamp() == 1)
{
LED_STATE = 1u;
}
else
{
LED_STATE = 0u;
}
}
return LED_STATE;
}
static void LED_TCS_Execution(Tellib_uint16_t led_status)
{
// if (led_status == 1u)
// {
// RTE_GPIO_Set_Level(TCS_MUC_OUT, LED_LINEOUT_High);
// }
// else
// {
// RTE_GPIO_Set_Level(TCS_MUC_OUT, LED_LINEOUT_Low);
// }
}
/*信号来源:ISG_111*/
static Tellib_uint16_t LED_HEV_Judgement(void)
{
Tellib_uint16_t LED_STATE = 0u;
if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CH0_111_Msg_Count) == CAN_SIG_LOST)
{
LED_STATE = 0u;
}
else
{
if(Get_CAN_CH0_ID_111_Sig_ISG_Ready() == 0x01UL)
{
LED_STATE = 1u;
}
else
{
LED_STATE = 0u;
}
}
return LED_STATE;
Tellib_uint16_t LED_STATE = 0u;
if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CH0_111_Msg_Count) == CAN_SIG_LOST)
{
LED_STATE = 0u;
}
else
{
if(Get_CAN_CH0_ID_111_Sig_ISG_Ready() == 0x01UL)
{
LED_STATE = 1u;
}
else
{
LED_STATE = 0u;
}
}
return LED_STATE;
}
static void LED_HEV_Execution(Tellib_uint16_t led_status)
{
// if (led_status == 1u)
// {
// RTE_GPIO_Set_Level(HEV_MUC_OUT, LED_LINEOUT_High);
// }
// else
// {
// RTE_GPIO_Set_Level(HEV_MUC_OUT, LED_LINEOUT_Low);
// }
}
/*硬线-P19 电压值*/
static Tellib_uint16_t LED_Voltage_Judgement(void)
{
......@@ -331,15 +284,10 @@ static Tellib_uint16_t LED_Voltage_Judgement(void)
}
static void LED_Voltage_Execution(Tellib_uint16_t led_status)
{
// if (led_status == 1u)
// {
// RTE_GPIO_Set_Level(Voltage_MUC_OUT, LED_LINEOUT_High);
// }
// else
// {
// RTE_GPIO_Set_Level(Voltage_MUC_OUT, LED_LINEOUT_Low);
// }
}
/*硬线P14-阻值*/
static Tellib_uint16_t LED_Fuel_Level_Low_Judgement(void)
{
......@@ -356,110 +304,128 @@ static Tellib_uint16_t LED_Fuel_Level_Low_Judgement(void)
}
static void LED_Fuel_Level_Low_Execution(Tellib_uint16_t led_status)
{
// if (led_status == 1u)
// {
// RTE_GPIO_Set_Level(FuelLevelLow_MUC_OUT, LED_LINEOUT_High);
// }
// else
// {
// RTE_GPIO_Set_Level(FuelLevelLow_MUC_OUT, LED_LINEOUT_Low);
// }
}//
}
/*信号来源:ECU_101 +硬线-P11 阻值 CAN>硬线*/
static Tellib_uint16_t LED_Coolant_Temperature_Judgement(void)
{
Tellib_uint16_t LED_STATE = 0u;
if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CH0_101_Msg_Count) == CAN_SIG_LOST)
{
LED_STATE = 0u;
}
else
{
if(Get_CAN_CH0_ID_101_Sig_ECU_Engine_Temperature_State() == 0x01UL)
{
LED_STATE = 1u;
}
else
{
if(Line_In_Get_Status(LINE_IN_Voltage))
{
LED_STATE = 1u;
}
else
{
LED_STATE = 0u;
}
}
}
return LED_STATE;
}
static void LED_Coolant_Temperature_Execution(Tellib_uint16_t led_status)
{
// if (led_status == 1u)
// {
// RTE_GPIO_Set_Level(CoolantTemperature_MUC_OUT, LED_LINEOUT_High);
// }
// else
// {
// RTE_GPIO_Set_Level(CoolantTemperature_MUC_OUT, LED_LINEOUT_Low);
// }
}
/*无*/
static Tellib_uint16_t LED_WIFI_Judgement(void)
{
Tellib_uint16_t LED_STATE = 0u;
// if (Line_In_Get_Status(LINE_IN_WIFI))
// {
// LED_STATE = 1;
// }
// else
// {
// LED_STATE = 0;
// }
Tellib_uint16_t LED_STATE = 0u;/*设置为常灭*/
return LED_STATE;
}
static void LED_WIFI_Execution(Tellib_uint16_t led_status)
{
// if (led_status == 1u)
// {
// RTE_GPIO_Set_Level(WIFI_MUC_OUT, LED_LINEOUT_High);
// }
// else
// {
// RTE_GPIO_Set_Level(WIFI_MUC_OUT, LED_LINEOUT_Low);
// }
}
/*信号来源:蓝牙模块*/
static Tellib_uint16_t LED_Bluetooth_Judgement(void)
{
// Tellib_uint16_t LED_STATE = 0u;
// if (Line_In_Get_Status(LINE_IN_Bluetooth))
// {
// LED_STATE = 1;
// }
// else
// {
// LED_STATE = 0;
// }
// return LED_STATE;
Tellib_uint16_t LED_STATE = 0u;
return LED_STATE;
}
static void LED_Bluetooth_Execution(Tellib_uint16_t led_status)
{
// if (led_status == 1u)
// {
// RTE_GPIO_Set_Level(Bluetooth_MUC_OUT, LED_LINEOUT_High);
// }
// else
// {
// RTE_GPIO_Set_Level(Bluetooth_MUC_OUT, LED_LINEOUT_Low);
// }
}
/*信号来源:0x111*/
static Tellib_uint16_t LED_E_Judgement(void)
{
Tellib_uint16_t LED_STATE = 0u;
if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CH0_111_Msg_Count) == CAN_SIG_LOST)
{
LED_STATE = 0u;
}
else
{
if(Get_CAN_CH0_ID_111_Sig_ISG_Power() == 0x01UL)
{
if(Get_CAN_CH0_ID_111_Sig_ISG_Power_Enable() == 1)
{
LED_STATE = 1u;
}
else
{
LED_STATE = 0u;
}
}
else
{
LED_STATE = 0u;
}
}
return LED_STATE;
}
static void LED_E_Execution(Tellib_uint16_t led_status)
{
// if (led_status == 1u)
// {
// RTE_GPIO_Set_Level(E_MUC_OUT, LED_LINEOUT_High);
// }
// else
// {
// RTE_GPIO_Set_Level(E_MUC_OUT, LED_LINEOUT_Low);
// }
}
/*信号来源:0x111*/
static Tellib_uint16_t LED_S_Judgement(void)
{
Tellib_uint16_t LED_STATE = 0u;
if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CH0_111_Msg_Count) == CAN_SIG_LOST)
{
LED_STATE = 0u;
}
else
{
if(Get_CAN_CH0_ID_111_Sig_ISG_Power() == 0x01UL)
{
if(Get_CAN_CH0_ID_111_Sig_ISG_Power_Enable() == 0x2UL)
{
LED_STATE = 1u;
}
else
{
LED_STATE = 0u;
}
}
else
{
LED_STATE = 0u;
}
}
return LED_STATE;
}
static void LED_S_Execution(Tellib_uint16_t led_status)
{
// if (led_status == 1u)
// {
// RTE_GPIO_Set_Level(S_MUC_OUT, LED_LINEOUT_High);
// }
// else
// {
// RTE_GPIO_Set_Level(S_MUC_OUT, LED_LINEOUT_Low);
// }
}
\ No newline at end of file
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