Commit 82c58e4f authored by 李俭双's avatar 李俭双

Merge branch 'lijianshuang' into 'dev'

Lijianshuang

See merge request !11
parents 87a4d6ec b9116cd3
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_VENDOR=Cmsemicon
SET UV2_TARGET=TianYing200
......
......@@ -22,9 +22,10 @@ void Can_Set_Buff_6EE(canlib_uint8_t CopyData[])
{
CANMsg6EEUnion *p6EE;
uint8_t i = 0;
uint16_t Vspeed_tx = 0;
uint16_t Vspeed_tx = 0;
Vspeed_tx = Get_DispVechileSpeed_TX()/10;
p6EE = (CANMsg6EEUnion *)CopyData;
if ( p6EE != ( void * )0 )
{
for ( i = 0u; i < 8u; i++ )
......@@ -34,6 +35,7 @@ void Can_Set_Buff_6EE(canlib_uint8_t CopyData[])
}
p6EE -> Sig.Vsppe_H3_TX = (Vspeed_tx >> 8) & 0x7u ;
p6EE -> Sig.Vsppe_L8_TX = Vspeed_tx & 0xFF ;
p6EE -> Sig.ODO_TX = Data_ODO_Read();
p6EE -> Sig.Uint_TX = Get_Dis_KM_Unit() ;
p6EE -> Sig.Coolant_Seg_TX = GET_DataCoolantTempSegDisp() ;
if (GET_DataCollantTempWarnflg() == 2)
......@@ -71,6 +73,7 @@ void Can_Set_Buff_6EF(canlib_uint8_t CopyData[])
}
}
p6EF -> Sig.Espeed_TX = Espeed_tx;
p6EF -> Sig.TripA = Data_Read_Trip(EM_TRIP_A);
p6EF -> Sig.Coolant_TX = GET_DataCoolantTempValueDisp() + 40;
}
void Can_Set_Buff_450(canlib_uint8_t CopyData[])
......@@ -86,5 +89,7 @@ void Can_Set_Buff_450(canlib_uint8_t CopyData[])
p450->Msg [ i ] = 0xFFu;
}
}
p450 -> Sig.Front_Pressure_TX = Get_Front_TPMS_TX();
p450 -> Sig.Rear_Pressure_TX = Get_Rear_TPMS_TX();
}
#include "Application.h"
#include "Data_TPMS\Data_TPMS.h"
\ No newline at end of file
#include "Data_TPMS\Data_TPMS.h"
_TPMS_Display TPMS;
void Data_TPMS_KL30_Init ( void )
{
TPMS.Front_Press_Value = 0;
TPMS.Rear_Press_Value = 0;
TPMS.Front_TPMS_Valid = 0;
TPMS.Rear_TPMS_Valid = 0;
TPMS.TPMS_Warning = 0;
TPMS.TPMS_Unit = Get_Dis_Tpms_Unit();
}
void Data_TPMS_Processing_Service ( void )
{
uint16_t Front_TPMS = 0;
uint16_t Rear_TPMS = 0;
TPMS.TPMS_Unit = Get_Dis_Tpms_Unit();
Front_TPMS = Get_CAN_CH0_ID_341_Sig_Front_Pressure();
Rear_TPMS = Get_CAN_CH0_ID_341_Sig_Rear_Pressure();
if ( Common_Get_IG_Sts() == COMMON_POWER_ON )
{
if(CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x341_Msg_Count) == CAN_SIG_LOST)
{
TPMS.Front_TPMS_Valid = 0; //信号掉线,显示--
TPMS.Rear_TPMS_Valid = 0; //信号掉线,显示--
TPMS.Front_Press_Value = 0;
TPMS.Rear_Press_Value = 0;
TPMS.TPMS_Warning = 0; //白灯
}
else
{
if((Front_TPMS == 0xFF) || (Rear_TPMS == 0xFF))
{
if((Front_TPMS == 0xFF) && (Rear_TPMS != 0xFF))
{
TPMS.Front_TPMS_Valid = 0;
TPMS.Rear_TPMS_Valid = 1;
TPMS.Front_Press_Value = 99;
TPMS.Rear_Press_Value *= Rear_TPMS ;
TPMS.Rear_Press_Value /= 10 ;
if(TPMS.Rear_Press_Value > 99)
{
TPMS.Rear_Press_Value = 99;
}
if((TPMS.Rear_Press_Value < 17) || (TPMS.Rear_Press_Value > 25))
{
TPMS.TPMS_Warning = 1;
}
else
{
TPMS.TPMS_Warning = 0;
}
}
else if ((Front_TPMS != 0xFF) || (Rear_TPMS == 0xFF))
{
TPMS.Front_TPMS_Valid = 1;
TPMS.Rear_TPMS_Valid = 0;
TPMS.Rear_Press_Value = 99;
TPMS.Front_Press_Value *= Front_TPMS ;
TPMS.Front_Press_Value /= 10 ;
if(TPMS.Front_Press_Value > 99)
{
TPMS.Front_Press_Value = 99;
}
if((TPMS.Front_Press_Value < 17) || (TPMS.Front_Press_Value > 23))
{
TPMS.TPMS_Warning = 1;
}
else
{
TPMS.TPMS_Warning = 0;
}
}
else
{
TPMS.Front_Press_Value = 99;
TPMS.Rear_Press_Value = 99;
TPMS.TPMS_Warning = 0;
TPMS.Front_TPMS_Valid = 0;
TPMS.Rear_TPMS_Valid = 0;
}
}
else
{
TPMS.Front_TPMS_Valid = 1;
TPMS.Rear_TPMS_Valid = 1;
TPMS.Front_Press_Value *= Front_TPMS ;
TPMS.Front_Press_Value /= 10 ;
if(TPMS.Front_Press_Value > 99)
{
TPMS.Front_Press_Value = 99;
}
TPMS.Rear_Press_Value *= Rear_TPMS ;
TPMS.Rear_Press_Value /= 10 ;
if(TPMS.Rear_Press_Value > 99)
{
TPMS.Rear_Press_Value = 99;
}
if ((TPMS.Front_Press_Value < 17) || (TPMS.Front_Press_Value > 23) || (TPMS.Rear_Press_Value < 17) || (TPMS.Rear_Press_Value > 25))
{
TPMS.TPMS_Warning = 1;
}
else
{
TPMS.TPMS_Warning = 0;
}
}
}
}
else
{
TPMS.Front_TPMS_Valid = 0;
TPMS.Rear_TPMS_Valid = 0;
TPMS.Front_Press_Value = 0;
TPMS.Rear_Press_Value = 0;
TPMS.TPMS_Warning = 0;
}
}
uint16_t Data_Bar_To_Psi (uint16_t bar)
{
bar *= 145;
bar /= 10;
if((bar % 5) >= 5)
{
bar += 5;
}
return bar;
}
uint8_t Get_Led_TPMS_Waring (void)
{
return TPMS.TPMS_Warning;
}
uint8_t Get_Front_TPMS_Sig_Vaild (void)
{
return TPMS.Front_TPMS_Valid;
}
uint8_t Get_Rear_TPMS_Sig_Vaild (void)
{
return TPMS.Rear_TPMS_Valid;
}
uint16_t Get_Front_TPMS_Sig_Value (void)
{
uint16_t value = 0;
if (TPMS.TPMS_Unit == 1)
{
value = Data_Bar_To_Psi(TPMS.Front_Press_Value);
if(value > 99)
{
value = 99;
}
}
else
{
value = TPMS.Front_Press_Value;
}
return value;
}
uint16_t Get_Rear_TPMS_Sig_Value (void)
{
uint16_t value = 0;
if (TPMS.TPMS_Unit == 1)
{
if(value > 99)
{
value = 99;
}
value = Data_Bar_To_Psi(TPMS.Rear_Press_Value);
}
else
{
value = TPMS.Rear_Press_Value;
}
return value;
}
uint16_t Get_Rear_TPMS_TX (void)
{
return TPMS.Rear_Press_Value;
}
uint16_t Get_Front_TPMS_TX (void)
{
return TPMS.Front_Press_Value;
}
\ No newline at end of file
......@@ -2,4 +2,24 @@
#define _DATA_TPMS_H_
#include "common.h"
typedef struct
{
uint16_t Front_Press_Value;
uint16_t Rear_Press_Value;
uint8_t Front_TPMS_Valid;
uint8_t Rear_TPMS_Valid;
uint8_t TPMS_Warning;
uint8_t TPMS_Unit;
}_TPMS_Display;
void Data_TPMS_KL30_Init ( void );
void Data_TPMS_Processing_Service ( void );
uint16_t Data_Bar_To_Psi (uint16_t bar);
uint8_t Get_Led_TPMS_Waring (void);
uint8_t Get_Front_TPMS_Sig_Vaild (void);
uint8_t Get_Rear_TPMS_Sig_Vaild (void);
uint16_t Get_Front_TPMS_Sig_Value (void);
uint16_t Get_Rear_TPMS_Sig_Value (void);
uint16_t Get_Rear_TPMS_TX (void);
uint16_t Get_Front_TPMS_TX (void);
#endif
#include "Application.h"
#include "Data_Voltage\Data_Voltage.h"
\ No newline at end of file
#include "Data_Voltage\Data_Voltage.h"
uint8_t voltage_value = 0;
uint8_t voltage_valid = 0;
void Data_Voltage_Init ( void )
{
voltage_value = 0;
voltage_valid = 0;
}
void Data_Voltage_Processing_Service ( void )
{
if ( Common_Get_IG_Sts() == COMMON_POWER_ON )
{
if(CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x401_Msg_Count) == CAN_SIG_LOST)
{
voltage_value = 0;
voltage_valid = 0;
}
else
{
voltage_value = Get_CAN_CH0_ID_401_Sig_ECU_Battery_Voltage();
voltage_valid = 1;
}
}
else
{
voltage_value = 0;
voltage_valid = 0;
}
}
//10倍
uint8_t Get_Battery_Voltage(void)
{
return voltage_value;
}
uint8_t Get_Battery_Voltage_Valid(void)
{
return voltage_valid;
}
\ No newline at end of file
......@@ -2,4 +2,9 @@
#define _DATA_VOLTAGE_H_
#include "common.h"
void Data_Voltage_Init ( void );
void Data_Voltage_Processing_Service ( void );
uint8_t Get_Battery_Voltage(void);
uint8_t Get_Battery_Voltage_Valid(void);
#endif
......@@ -407,7 +407,7 @@ uint8_t Get_Dis_KM_Unit(void)
uint8_t Get_Dis_Tpms_Unit(void)
{
return MenuData.Tpms_Unit; //0km,1mile
return MenuData.Tpms_Unit; //0bar,1psi
}
uint8_t Get_Dis_Tcs_Val(void)
......
......@@ -73,7 +73,7 @@ void Data_User_Mileage_KL30Init(void)
{
ODOInit.Offset = TempBuf[2];
}
ODOInit.MaxValue = 16103058;
ODOInit.MaxValue = 1999990;
Data_ODO_KL30_Init(DataODOBuf, &ODOInit, Func.EEPromWrite_Cbk);
(void)Data_User_EEPROM_Read(EM_TRIP_BLOCK, TempBuf + 3, 8);
......@@ -86,7 +86,7 @@ void Data_User_Mileage_KL30Init(void)
TripInit[EM_TRIP_A].Stamp = TempBuf[3];
}
TripInit[EM_TRIP_A].Offset = TempBuf[4];
TripInit[EM_TRIP_A].MaxValue = 16092; /* 最大999.9Mile 进行复位 */
TripInit[EM_TRIP_A].MaxValue = 9999; /* 最大999.9km 进行复位 */
TripInit[EM_TRIP_A].IsRestart = 1u;
TripInit[EM_TRIP_B].Stamp = 0xFFFFFFFFu;
......@@ -191,7 +191,7 @@ void Services_Mileage_Callback(void)
Data_Mileage_ISR();
Data_ODO_Processing();
Data_Trip_Processing();
Trip_Clear_Km_Service();
//Trip_Clear_Km_Service();
}
/**
......
......@@ -58,10 +58,11 @@ static void Power_KL30_Init(void)
Data_Coolant_Temp_KL30_Init();
LINE_IN_Init();
Key_KL30_Init_EXample();
Light_Sensor_Init_Example();//注意顺序1
//Light_Sensor_Init_Example();//注意顺序1
LED_Driver_Init_Example();//注意顺序2
Data_User_Mileage_KL30Init();
Fuel_KL30_Init();
Data_Voltage_Init();
TimerM_PWM_counter_Output_Init(TIMERM_COUNTER0, 400, 64000000);
TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 400, 64000000);
// TimerM_PWM_counter_Output_Init(TIMERM_COUNTER0, 400);
......@@ -74,6 +75,7 @@ static void Power_KL30_Init(void)
Telltales_Init();
Telltales_UserInit();
MenuData_Unit_Init();
Data_TPMS_KL30_Init ();
g_stRTCInformation.u8RTCSecond = 0;
g_stRTCInformation.u8RTCMinute = 0;
g_stRTCInformation.u8RTCHour = 0;
......@@ -102,9 +104,10 @@ static void Power_Wakeup_Init(void)
LINE_IN_Init();
Key_KL30_Init_EXample();
Line_In_KL15_ON_Init();
Light_Sensor_Init_Example();//注意顺序1
//Light_Sensor_Init_Example();//注意顺序1
LED_Driver_Init_Example();//注意顺序2
Fuel_KL30_Init();
Data_Voltage_Init();
TimerM_PWM_counter_Output_Init(TIMERM_COUNTER0, 400, 64000000);
TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 400, 64000000);
// TimerM_PWM_counter_Output_Init(TIMERM_COUNTER0, 400);
......@@ -141,6 +144,7 @@ static void Power_IG_ON_Init(void)
Telltales_KL15_Init();
Telltales_UserInit();
Fuel_KL15_Init();
Data_Voltage_Init();
Data_Coolant_Temp_KL15_Init();
}
......
......@@ -484,11 +484,29 @@ static void LED_Lateral_Strut_Execution(Tellib_uint16_t led_status)
static Tellib_uint16_t LED_Tire_Pressure_Judgement(void)
{
Tellib_uint16_t LED_STATE = 0u;
if(Get_Led_TPMS_Waring() == 1)
{
LED_STATE = 1;
}
else
{
LED_STATE = 0;
}
return LED_STATE;
}
static void LED_Tire_Pressure_Execution(Tellib_uint16_t led_status)
{
;
if ( led_status == 1u )
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_27_Tire_PressureY, LED_ON);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_26_Tire_PressureW, LED_OFF);
}
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);
}
}
static Tellib_uint16_t LED_Navigato_Judgement(void)
{
......@@ -504,36 +522,36 @@ static void LED_Navigato_Execution(Tellib_uint16_t led_status)
void Turn_Left_Right_Lamp(void)
{
//if ( SYS_OPR_STAT_IGN_ON )
//{
// if (Common_GetIgnOnTime() >= 3000)
// {
// if (Line_In_Get_Status(LINE_IN_TurnLeft))
// {
// RTE_GPIO_Set_Level(LeftTurn_MUC_OUT, LED_LINEOUT_High);
// }
// else
// {
// RTE_GPIO_Set_Level(LeftTurn_MUC_OUT, LED_LINEOUT_Low);
// }
// if (Line_In_Get_Status(LINE_IN_TurnRight))
// {
// RTE_GPIO_Set_Level(RightTurn_MUC_OUT, LED_LINEOUT_High);
// }
// else
// {
// RTE_GPIO_Set_Level(RightTurn_MUC_OUT, LED_LINEOUT_Low);
// }
// }
// else
// {
// RTE_GPIO_Set_Level(RightTurn_MUC_OUT, LED_LINEOUT_High);
// RTE_GPIO_Set_Level(LeftTurn_MUC_OUT, LED_LINEOUT_High);
// }
//}
//else
//{
// RTE_GPIO_Set_Level(RightTurn_MUC_OUT, LED_LINEOUT_Low);
// RTE_GPIO_Set_Level(LeftTurn_MUC_OUT, LED_LINEOUT_Low);
//}
if ( SYS_OPR_STAT_IGN_ON )
{
if (Common_GetIgnOnTime() >= 3000)
{
if (Line_In_Get_Status(LINE_IN_TurnLeft))
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_06_Turn_Left, LED_ON);
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_06_Turn_Left, LED_OFF);
}
if (Line_In_Get_Status(LINE_IN_TurnRight))
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_05_Turn_Right, LED_ON);
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_05_Turn_Right, LED_OFF);
}
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_06_Turn_Left, LED_ON);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_05_Turn_Right, LED_ON);
}
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_06_Turn_Left, LED_OFF);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_05_Turn_Right, LED_OFF);
}
}
......@@ -33,6 +33,6 @@ extern Led_HighBeam_Count HighBeam_Timer;
void Telltales_Init(void);
void Telltales_UserInit(void);
void Turn_Left_Right_Lamp(void);
#endif
......@@ -56,6 +56,7 @@ void Sys_20ms_Tasks(void)
Data_Vehicle_Speed_Processing_Service();
Data_Engine_Speed_Processing_Service();
Data_Coolant_Temp_Processing_Service();
Data_TPMS_Processing_Service();
}
void Sys_50ms_Tasks(void)
......@@ -79,6 +80,7 @@ void Sys_100ms_Tasks(void)
Fuel_Cal_Sevice(100u);
BackLight_Process();
Services_Mileage_Callback();
Data_Voltage_Processing_Service();
S3_ServerCNTT();
if (u8LEDDriverCheckCount >= 10U)
......@@ -86,7 +88,7 @@ void Sys_100ms_Tasks(void)
u8LEDDriverCheckCount = 0U;
LED_Driver_Work_Check();
LED_Driver_Service_Immediate();//注意顺序1
ALS_Service();//注意顺序2
//ALS_Service();//注意顺序2
}
else
{
......
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