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

Merge branch 'CHENJIALE' into 'dev'

Chenjiale

See merge request !57
parents 816950cb f8ad87c1
......@@ -28,14 +28,7 @@ void Can_Set_Buff_220(canlib_uint8_t CopyData[])
p220 -> Sig.CheckSum = (Get_Dis_Tcs_Val() == 1) ? 8 : 0;
}
if(AliveCountTimer < 7)
{
AliveCountTimer++;
}
else
{
AliveCountTimer = 0;
}
}
void Can_Set_Buff_6EE(canlib_uint8_t CopyData[])
......
......@@ -5,6 +5,7 @@
#include "Application.h"
#include "Components.h"
extern uint16_t AliveCountTimer;
typedef union
{
......
......@@ -242,7 +242,7 @@ void COM_CAN_Init(void)
memset(pTXBuff, 0, sizeof(pTXBuff));
CAN_CH0_CanMsgTxOp.CanMsg = (st_CAN_SendOperation *)pTXBuff;
Can_TX_BuffInit(&CAN_CH0_CanMsgTxOp, CAN_CH0_CANSendAttr, CAN_CH0_ID_SEND_TOTAL, COM_APP_Process);
CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Enable);
CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Disable);
}
......@@ -341,7 +341,7 @@ uint8_t COM_APP_Process(st_CAN_Msg *Msg)
break;
case 0x450:
if(Can_341_Flg == 1 || Common_GetIgnOnTime() > 2000)
//if(Can_341_Flg == 1 || Common_GetIgnOnTime() > 2000)
{
CAN_result = CAN_Transmit(CAN0MSG13, &CAN_SendMsg);
}
......@@ -349,10 +349,18 @@ uint8_t COM_APP_Process(st_CAN_Msg *Msg)
break;
case 0x220:
CAN_result = CAN_Transmit(CAN0MSG10, &CAN_SendMsg);
if(AliveCountTimer < 7)
{
AliveCountTimer++;
}
else
{
AliveCountTimer = 0;
}
break;
#if (IC_Current == TY200_080000b_ty)
case 0x580:
if(Get_Tpms_TX_Flag() == 1 || Get_Tpms_TX_Flag() == 2)
if(Get_Tpms_TX_Flag() != 0 )
{
CAN_result = CAN_Transmit(CAN0MSG14, &CAN_SendMsg);
}
......
......@@ -11,7 +11,7 @@ void Data_TPMS_KL30_Init ( void )
Data_User_EEPROM_Read(EM_MenuData_TPMS_LEARN, (uint32_t*)TPMS_L, 1u);
MenuData.TPMS_Front_Learn = TPMS_L[0];
MenuData.TPMS_Rear_Learn = TPMS_L[1];
//MenuData.TPMS_Front_FirstLearn_Flag = TPMS_L[2];
//MenuData.TPMS_Front_FirstLearn_Flag = TPMS_L[2];
//MenuData.TPMS_Rear_FirstLearn_Flag = TPMS_L[3];
TPMS.Front_Press_Value = 0;
TPMS.Rear_Press_Value = 0;
......@@ -26,8 +26,8 @@ void Data_TPMS_KL30_Init ( void )
TPMS.TPMS_Rear_FirstLearn_Flag = MenuData.TPMS_Rear_FirstLearn_Flag;
TPMS.TPMS_LOST = 0;
LearnTime_Count = 6001;
LearnTime_Count1 = 6001;
LearnTime_Count = 0;//6001;
LearnTime_Count1 = 0;//6001;
Can_341_Flg = 0;
}
......@@ -45,10 +45,10 @@ void Data_TPMS_KL15_WAKE_UP_Init ( void )
TPMS.TPMS_Rear_FirstLearn_Flag = MenuData.TPMS_Rear_FirstLearn_Flag;
TPMS.TPMS_LOST = 0;
LearnTime_Count = 6001;
LearnTime_Count1 = 6001;
LearnTime_Count = 0;//6001;
LearnTime_Count1 = 0;//6001;
Can_341_Flg = 0;
Can_341_Flg = 0;
}
void Can_341_Receive(void)
......@@ -74,6 +74,35 @@ void Data_TPMS_Processing_Service ( void )
TPMS.TPMS_Rear_Learn = MenuData.TPMS_Rear_Learn;
TPMS.TPMS_LOST = 0;
}
if(CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x373_Msg_Count) != CAN_SIG_LOST)
{
if((Get_CAN_CH0_ID_373_Sig_Rear_id() != 0) && (Get_CAN_CH0_ID_373_Sig_Rear_id() != 0xFFFFFFFF))
{
TPMS.TPMS_Rear_ID_Value = 1;
//TPMS.TPMS_Rear_Learn = LearningCompletion;
}
else
{
TPMS.TPMS_Rear_ID_Value = 0;
}
if((Get_CAN_CH0_ID_373_Sig_Front_id() != 0) && (Get_CAN_CH0_ID_373_Sig_Front_id() != 0xFFFFFFFF))
{
TPMS.TPMS_Front_ID_Value = 1;
//TPMS.TPMS_Front_Learn = LearningCompletion;
}
else
{
TPMS.TPMS_Front_ID_Value = 0;
}
}
else
{
TPMS.TPMS_Front_ID_Value = 0;
TPMS.TPMS_Rear_ID_Value = 0;
}
if(TPMS.TPMS_Front_Learn == 0x0)
......@@ -112,6 +141,16 @@ void Data_TPMS_Processing_Service ( void )
}
else if(TPMS.TPMS_Front_Learn == 0x1)
{
//if((Get_CAN_CH0_ID_373_Sig_Front_id() != 0) && (Get_CAN_CH0_ID_373_Sig_Front_id() != 0xFFFFFFFF))
//{
// TPMS.TPMS_Front_ID_Value = 1;
// //TPMS.TPMS_Front_Learn = LearningCompletion;
//}
//else
//{
// TPMS.TPMS_Front_ID_Value = 0;
//}
if(TPMS.TPMS_Front_Timeclean == 0)
{
LearnTime_Count = 0;
......@@ -144,15 +183,15 @@ void Data_TPMS_Processing_Service ( void )
else if (TPMS.TPMS_Front_Learn == 0x2)
{
LearnTime_Count = 0;
if((Get_CAN_CH0_ID_373_Sig_Front_id() != 0) && (Get_CAN_CH0_ID_373_Sig_Front_id() != 0xFFFFFFFF))
{
TPMS.TPMS_Front_ID_Value = 1;
//TPMS.TPMS_Front_Learn = LearningCompletion;
}
else
{
TPMS.TPMS_Front_ID_Value = 0;
}
//if((Get_CAN_CH0_ID_373_Sig_Front_id() != 0) && (Get_CAN_CH0_ID_373_Sig_Front_id() != 0xFFFFFFFF))
//{
// TPMS.TPMS_Front_ID_Value = 1;
// //TPMS.TPMS_Front_Learn = LearningCompletion;
//}
//else
//{
// TPMS.TPMS_Front_ID_Value = 0;
//}
}
else if (TPMS.TPMS_Front_Learn == 0x3)
......@@ -170,7 +209,7 @@ void Data_TPMS_Processing_Service ( void )
{
if(LearnTime_Count1 <= 6000)
{
LearnTime_Count1 = 0;
LearnTime_Count1++;// = 0;
TPMS.TPMS_Rear_Learn = Unstudied;
}
else
......@@ -199,6 +238,12 @@ void Data_TPMS_Processing_Service ( void )
}
else if(TPMS.TPMS_Rear_Learn == 0x1)
{
if(TPMS.TPMS_Rear_Timeclean == 0)
{
LearnTime_Count1 = 0;
}
TPMS.TPMS_Rear_Timeclean = 1;
if(LearnTime_Count1 <= 6000)
{
LearnTime_Count1++;
......@@ -206,11 +251,7 @@ void Data_TPMS_Processing_Service ( void )
}
else
{
if(TPMS.TPMS_Rear_Timeclean == 0)
{
LearnTime_Count1 = 0;
}
TPMS.TPMS_Rear_Timeclean = 1;
if ((MenuData.TPMS_Rear_Learn != 0x2) && (MenuData.TPMS_Rear_Learn != 0x3) )
{
if(CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x341_Msg_Count) != CAN_SIG_LOST)
......@@ -265,23 +306,26 @@ void Data_TPMS_Processing_Service ( void )
TPMS.TPMS_Rear_FirstLearn_Flag = 1;
}
if((TPMS.TPMS_Front_Learn == 0x2) || (TPMS.TPMS_Front_Learn == 0x3))
{
MenuData.TPMS_Front_Learn = TPMS.TPMS_Front_Learn;
}
if((TPMS.TPMS_Rear_Learn == 0x2) || (TPMS.TPMS_Rear_Learn == 0x3))
{
MenuData.TPMS_Rear_Learn = TPMS.TPMS_Rear_Learn;
}
//if((TPMS.TPMS_Front_Learn == 0x2) || (TPMS.TPMS_Front_Learn == 0x3))
//{
// MenuData.TPMS_Front_Learn = TPMS.TPMS_Front_Learn;
//}
//if((TPMS.TPMS_Rear_Learn == 0x2) || (TPMS.TPMS_Rear_Learn == 0x3))
//{
// MenuData.TPMS_Rear_Learn = TPMS.TPMS_Rear_Learn;
//}
if(((TPMS.TPMS_Front_Learn == 0x2) || (TPMS.TPMS_Front_Learn == 0x3)) && (TPMS.TPMS_Front_Learn != MenuData.TPMS_Front_Learn))
{
MenuData.TPMS_Front_Learn = TPMS.TPMS_Front_Learn;
TPMS_L[0] = MenuData.TPMS_Front_Learn;
TPMS_L[1] = MenuData.TPMS_Rear_Learn;
Data_User_EEPROM_Write(EM_MenuData_TPMS_LEARN, (uint32_t*)TPMS_L, 1u);
}
if( ((TPMS.TPMS_Rear_Learn == 0x2) || (TPMS.TPMS_Rear_Learn == 0x3)) && (TPMS.TPMS_Rear_Learn != MenuData.TPMS_Rear_Learn))
{
MenuData.TPMS_Rear_Learn = TPMS.TPMS_Rear_Learn;
TPMS_L[0] = MenuData.TPMS_Front_Learn;
TPMS_L[1] = MenuData.TPMS_Rear_Learn;
Data_User_EEPROM_Write(EM_MenuData_TPMS_LEARN, (uint32_t*)TPMS_L, 1u);
......@@ -320,7 +364,8 @@ void Data_TPMS_Processing_Service ( void )
{
TPMS.Rear_Press_Value = 9900;
}
if(((TPMS.Rear_Press_Value + 50)< 1700) || ((TPMS.Rear_Press_Value + 50) > 2500))
//if(((TPMS.Rear_Press_Value + 50)< 1700) || ((TPMS.Rear_Press_Value + 50) > 2500))
if((Get_Rear_TPMS_Sig_Value() < 17) || (Get_Rear_TPMS_Sig_Value() > 25))
{
TPMS.TPMS_Warning = 1;
}
......@@ -340,7 +385,8 @@ void Data_TPMS_Processing_Service ( void )
{
TPMS.Front_Press_Value = 9900;
}
if(((TPMS.Front_Press_Value + 50) < 1700) || ((TPMS.Front_Press_Value + 50) > 2300))
//if(((TPMS.Front_Press_Value + 50) < 1700) || ((TPMS.Front_Press_Value + 50) > 2300))
if((Get_Front_TPMS_Sig_Value() < 17) || (Get_Front_TPMS_Sig_Value() > 25))
{
TPMS.TPMS_Warning = 1;
}
......@@ -375,7 +421,8 @@ void Data_TPMS_Processing_Service ( void )
{
TPMS.Rear_Press_Value = 9900;
}
if (((TPMS.Front_Press_Value + 50) < 1700) || ((TPMS.Front_Press_Value + 50) > 2300) || ((TPMS.Rear_Press_Value + 50) < 1700) || ((TPMS.Rear_Press_Value + 50) > 2500))
//if (((TPMS.Front_Press_Value + 50) < 1700) || ((TPMS.Front_Press_Value + 50) > 2300) || ((TPMS.Rear_Press_Value + 50) < 1700) || ((TPMS.Rear_Press_Value + 50) > 2500))
if ((Get_Front_TPMS_Sig_Value() < 17) || (Get_Front_TPMS_Sig_Value() > 25) || (Get_Rear_TPMS_Sig_Value() < 17) || (Get_Rear_TPMS_Sig_Value() > 25))
{
TPMS.TPMS_Warning = 1;
}
......
......@@ -35,7 +35,7 @@ void Fuel_KL30_Init(void)
FuelInitFlag = 1u;
FuelStateInitFlag = 1u;
FuelDir = FUEL_SEG_UP;
FuelSensorState = FuelSensorNormal;
FuelSensorState = FuelSensorShortCircuit;//FuelSensorNormal;
FuelSensorNormalTime = 0u;
FuelSensorShortTime = 0u;
FuelSensorOpenTime = 0u;
......@@ -51,7 +51,7 @@ void Fuel_KL15_Init(void)
FuelInitFlag = 1u;
FuelStateInitFlag = 1u;
FuelDir = FUEL_SEG_UP;
FuelSensorState = FuelSensorNormal;
FuelSensorState = FuelSensorShortCircuit;//FuelSensorNormal;
FuelSensorNormalTime = 0u;
FuelSensorShortTime = 0u;
FuelSensorOpenTime = 0u;
......@@ -384,7 +384,7 @@ uint16_t Get_Fuel_RES(void)
uint16_t Fuel_Res = 0;
if(Get_Fuel_Sensor_State() == FuelSensorShortCircuit)
{
Fuel_Res = 3;
Fuel_Res = 0;
}
else if (Get_Fuel_Sensor_State() == FuelSensorOpenCircuit)
{
......
......@@ -2724,9 +2724,34 @@ void SEG_SET_FRONT_TPMS_NUM(uint8_t learnflag, uint16_t m_NUM1, uint8_t m_valid1
}
else if (learnflag == 3)
{
//if (FLASH_SYNC_1Hz)
//{
if (Get_Current_PageType() == Page_Front_Tpms)
{
if (FLASH_SYNC_1Hz)
{
IC2_SEG140 = IC_SEG_ON;
IC2_SEG133 = IC_SEG_ON;
}
else
{
IC2_SEG140 = IC_SEG_OFF;
IC2_SEG133 = IC_SEG_OFF;
}
IC2_SEG143 = IC_SEG_OFF;
IC2_SEG141 = IC_SEG_OFF;
IC2_SEG139 = IC_SEG_OFF;
IC2_SEG146 = IC_SEG_OFF;
IC2_SEG145 = IC_SEG_OFF;
IC2_SEG144 = IC_SEG_OFF;
IC2_SEG135 = IC_SEG_OFF;
IC2_SEG134 = IC_SEG_OFF;
IC2_SEG132 = IC_SEG_OFF;
IC2_SEG131 = IC_SEG_OFF;
IC2_SEG137 = IC_SEG_OFF;
IC2_SEG136 = IC_SEG_OFF;
}
else
{
IC2_SEG138 = IC_SEG_ON;
IC2_SEG140 = IC_SEG_ON;
......@@ -2745,6 +2770,28 @@ void SEG_SET_FRONT_TPMS_NUM(uint8_t learnflag, uint16_t m_NUM1, uint8_t m_valid1
IC2_SEG131 = IC_SEG_OFF;
IC2_SEG137 = IC_SEG_OFF;
IC2_SEG136 = IC_SEG_OFF;
}
//if (FLASH_SYNC_1Hz)
//{
// IC2_SEG138 = IC_SEG_ON;
//
// IC2_SEG140 = IC_SEG_ON;
// IC2_SEG133 = IC_SEG_ON;
//
// IC2_SEG143 = IC_SEG_OFF;
// IC2_SEG141 = IC_SEG_OFF;
// IC2_SEG139 = IC_SEG_OFF;
// IC2_SEG146 = IC_SEG_OFF;
// IC2_SEG145 = IC_SEG_OFF;
// IC2_SEG144 = IC_SEG_OFF;
//
// IC2_SEG135 = IC_SEG_OFF;
// IC2_SEG134 = IC_SEG_OFF;
// IC2_SEG132 = IC_SEG_OFF;
// IC2_SEG131 = IC_SEG_OFF;
// IC2_SEG137 = IC_SEG_OFF;
// IC2_SEG136 = IC_SEG_OFF;
//}
//else
//{
......@@ -3180,12 +3227,34 @@ void SEG_SET_Rear_TPMS_NUM(uint8_t learnflag, uint16_t m_NUM2, uint8_t m_valid2)
}
else if (learnflag == 3)
{
//IC2_SEG118 = IC_SEG_ON;
//IC2_SEG120 = IC_SEG_ON;
//IC2_SEG113 = IC_SEG_ON;
//if (FLASH_SYNC_1Hz)
//{
if (Get_Current_PageType() == Page_Rear_Tpms)
{
if (FLASH_SYNC_1Hz)
{
IC2_SEG120 = IC_SEG_ON;
IC2_SEG113 = IC_SEG_ON;
}
else
{
IC2_SEG120 = IC_SEG_OFF;
IC2_SEG113 = IC_SEG_OFF;
}
IC2_SEG123 = IC_SEG_OFF;
IC2_SEG121 = IC_SEG_OFF;
IC2_SEG119 = IC_SEG_OFF;
IC2_SEG126 = IC_SEG_OFF;
IC2_SEG125 = IC_SEG_OFF;
IC2_SEG124 = IC_SEG_OFF;
IC2_SEG115 = IC_SEG_OFF;
IC2_SEG114 = IC_SEG_OFF;
IC2_SEG112 = IC_SEG_OFF;
IC2_SEG111 = IC_SEG_OFF;
IC2_SEG117 = IC_SEG_OFF;
IC2_SEG116 = IC_SEG_OFF;
}
else
{
IC2_SEG120 = IC_SEG_ON;
IC2_SEG113 = IC_SEG_ON;
......@@ -3205,6 +3274,32 @@ void SEG_SET_Rear_TPMS_NUM(uint8_t learnflag, uint16_t m_NUM2, uint8_t m_valid2)
IC2_SEG111 = IC_SEG_OFF;
IC2_SEG117 = IC_SEG_OFF;
IC2_SEG116 = IC_SEG_OFF;
}
//IC2_SEG118 = IC_SEG_ON;
//IC2_SEG120 = IC_SEG_ON;
//IC2_SEG113 = IC_SEG_ON;
//if (FLASH_SYNC_1Hz)
//{
// IC2_SEG120 = IC_SEG_ON;
// IC2_SEG113 = IC_SEG_ON;
//
// IC2_SEG118 = IC_SEG_ON;
//
//
// IC2_SEG123 = IC_SEG_OFF;
// IC2_SEG121 = IC_SEG_OFF;
// IC2_SEG119 = IC_SEG_OFF;
// IC2_SEG126 = IC_SEG_OFF;
// IC2_SEG125 = IC_SEG_OFF;
// IC2_SEG124 = IC_SEG_OFF;
//
// IC2_SEG115 = IC_SEG_OFF;
// IC2_SEG114 = IC_SEG_OFF;
// IC2_SEG112 = IC_SEG_OFF;
// IC2_SEG111 = IC_SEG_OFF;
// IC2_SEG117 = IC_SEG_OFF;
// IC2_SEG116 = IC_SEG_OFF;
//}
//else
//{
......
......@@ -49,7 +49,7 @@ static void Power_KL30_Init(void)
Gpio_Init(Gpio_KL30_Init);
eeprom_StoreInfo_Init();
Can_Init();
CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Enable);
DFlash_init();
Data_Read_DiagPara();
Analog_Signal_Conv_Init();
......@@ -94,6 +94,7 @@ static void Power_KL30_Init(void)
FaultCode_Init();
CAN_TX_Count_Init();
CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Enable);
}
extern uint32_t PowerIgnOffTimeLine;
......
......@@ -36,15 +36,19 @@ void Sys_2ms_Tasks(void)
void Sys_5ms_Tasks(void)
{
Flash_Sync_Signal_Generation_Service();
}
}
//uint8_t ljs_buf[200] = {0};
void Sys_10ms_Tasks(void)
{
//memset(ljs_buf, 0x55, 200);
Line_In_Debounce_Service(10u);
Key_Service();
if(Common_GetIgnOnTime() >= 3000)
{
Key_Service();
}
Data_Mileage_Write_EEPROM();
Can_BusOff_Recover(10u);
Turn_Left_Right_Lamp();
......@@ -55,7 +59,7 @@ void Sys_10ms_Tasks(void)
Protocol_Send_Service();
//Uart0_IntSend(ljs_buf, 200) ;
FaultCode_Service(10u);
}
}
void Sys_20ms_Tasks(void)
{
......@@ -66,12 +70,12 @@ void Sys_20ms_Tasks(void)
Data_Coolant_Temp_Processing_Service();
//Data_Voltage_Processing_Service();
BU98R10_Update_Request();
}
void Sys_50ms_Tasks(void)
{
BU98R10_Update_Request();
// BU98R10_Update_Request();
LED_Driver_Scan_Refresh();
Telltales_Management();
Gauge_Service();
......@@ -110,6 +114,8 @@ void Sys_100ms_Tasks(void)
}
Clear_Navigation_St();
//R_test = ADC_Read_Signal(ADC_CH_FUEL1);
}
......
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