Commit c25b3e33 authored by hu's avatar hu

删除无用函数

parent 7443c284
......@@ -55,8 +55,6 @@
.\APP\Data_Voltmeter\Data_Voltmeter.h
.\APP\Data_WET\Data_WET.c
.\APP\Data_WET\Data_WET.h
.\APP\Individual_ECU_Comm\Individual_ECU_Comm.c
.\APP\Individual_ECU_Comm\Individual_ECU_Comm.h
.\APP\Data_FuelConsump\Data_FuelConsump.c
.\APP\Data_FuelConsump\Data_FuelConsump.h
.\APP\Data_Interval\Services_Interval.c
......
No preview for this file type
This source diff could not be displayed because it is too large. You can view the blob instead.
project .intvect 1536
project .text 310124
project .rodata 410879
project .text 309372
project .rodata 410815
project .secinfo 120
project .syscall 6
project .romdata 9045
......
......@@ -3,7 +3,7 @@
#include "GaugesInterface.h"
#include "GPIO.h"
//-------------------------------------------
//水温数据处理 wangboyu
//水温数据处理
//-------------------------------------------
//断码显示
//-------------------------------------------
......
......@@ -5,7 +5,7 @@
#include "GPIO.h"
#include "Services_ODO_User.h"
//-------------------------------------------
//燃油 数据处理 wangboyu 2021-8-31 15:19:14
//燃油 数据处理
//-------------------------------------------
// 342 - 4.2.燃油表
//-------------------------------------------
......
......@@ -2,28 +2,28 @@
#include "RTE_ADC.h"
#include "GaugesInterface.h"
//-------------------------------------------
//电压计数据处理 wangboyu
//电压计数据处理
//-------------------------------------------
//区域5显示逻辑
//-------------------------------------------
//344 - 3.4.2.2电压计显示画面
//344 - 3.4.2.2电压计显示画面
//-------------------------------------------
static struct
{
uint8_t SumCnt ;
uint32_t ActVoltage ;
uint8_t Timer ;
uint8_t Gui_Voltmeter ;
uint8_t Valid ;
uint16_t AvrVoltage ;
}VoltmeterVariable ;
uint8_t SumCnt ;
uint32_t ActVoltage ;
uint8_t Timer ;
uint8_t Gui_Voltmeter ;
uint8_t Valid ;
uint16_t AvrVoltage ;
} VoltmeterVariable ;
static void Data_Voltmeter_2_Gui(void);
static uint16_t Get_VoltFilter(void);
static
static
/*-------------------------------------------------------------------------
* Function Name : Voltmeter_KL30_Init
* Description :
* Description :
* Input : None
* Output : None
* Return : None
......@@ -31,12 +31,12 @@ static
--------------------------------------------------------------------------*/
void Voltmeter_KL30_Init(void)
{
VoltmeterVariable.SumCnt = 0 ;
VoltmeterVariable.ActVoltage = 0 ;
VoltmeterVariable.AvrVoltage = 0 ;
VoltmeterVariable.Timer = 0 ;
VoltmeterVariable.Gui_Voltmeter = 0 ;
VoltmeterVariable.Valid = 0 ;
VoltmeterVariable.SumCnt = 0 ;
VoltmeterVariable.ActVoltage = 0 ;
VoltmeterVariable.AvrVoltage = 0 ;
VoltmeterVariable.Timer = 0 ;
VoltmeterVariable.Gui_Voltmeter = 0 ;
VoltmeterVariable.Valid = 0 ;
}
void Voltmeter_KL15_ON_Init(void)
{
......@@ -56,7 +56,7 @@ void Voltmeter_Sleep_Init(void)
}
/*-------------------------------------------------------------------------
* Function Name : Voltmeter_Processing_Service
* Description :
* Description :
* Input : None
* Output : None
* Return : None
......@@ -64,7 +64,7 @@ void Voltmeter_Sleep_Init(void)
--------------------------------------------------------------------------*/
void Voltmeter_Processing_Service(void)
{
Data_Voltmeter_2_Gui();
Data_Voltmeter_2_Gui();
}
/*-------------------------------------------------------------------------
* Function Name : Get_VoltFilter
......@@ -76,29 +76,29 @@ void Voltmeter_Processing_Service(void)
--------------------------------------------------------------------------*/
static uint16_t Get_VoltFilter(void)
{
uint8_t Valid = 0 ;
uint16_t Voltage = 0 ;
Valid = RTE_Read_KL30_Valid() ;
if(Valid)
{
Voltage = (uint16_t)RTE_Read_KL30_Voltage();
if (VoltmeterVariable.SumCnt < 10u)
{
VoltmeterVariable.ActVoltage += Voltage;
VoltmeterVariable.SumCnt += 1u;
Voltage = (uint16_t)(VoltmeterVariable.ActVoltage / VoltmeterVariable.SumCnt);
}
else
{
VoltmeterVariable.SumCnt = 0u;
VoltmeterVariable.ActVoltage = 0u;
VoltmeterVariable.ActVoltage += Voltage;
VoltmeterVariable.SumCnt += 1u;
Voltage = (uint16_t) (VoltmeterVariable.ActVoltage / VoltmeterVariable.SumCnt);
}
}
return Voltage ;
uint8_t Valid = 0 ;
uint16_t Voltage = 0 ;
Valid = RTE_Read_KL30_Valid() ;
if (Valid)
{
Voltage = (uint16_t)RTE_Read_KL30_Voltage();
if (VoltmeterVariable.SumCnt < 10u)
{
VoltmeterVariable.ActVoltage += Voltage;
VoltmeterVariable.SumCnt += 1u;
Voltage = (uint16_t)(VoltmeterVariable.ActVoltage / VoltmeterVariable.SumCnt);
}
else
{
VoltmeterVariable.SumCnt = 0u;
VoltmeterVariable.ActVoltage = 0u;
VoltmeterVariable.ActVoltage += Voltage;
VoltmeterVariable.SumCnt += 1u;
Voltage = (uint16_t) (VoltmeterVariable.ActVoltage / VoltmeterVariable.SumCnt);
}
}
return Voltage ;
}
/*-------------------------------------------------------------------------
* Function Name : Data_Voltmeter_2_Gui
......@@ -110,40 +110,40 @@ static uint16_t Get_VoltFilter(void)
--------------------------------------------------------------------------*/
static void Data_Voltmeter_2_Gui(void)
{
static uint8_t u8GuiMode = 0 ;
VoltmeterVariable.AvrVoltage = Get_VoltFilter();
if((VoltmeterVariable.AvrVoltage >= 17000)&&(VoltmeterVariable.AvrVoltage <= 30500))
{
VoltmeterVariable.Valid = 1 ;
VoltmeterVariable.Timer = 0 ;
}
else
{//检测出范围以外数据时的处理
if(VoltmeterVariable.Timer < (2000 / 20))
{//未到2sec前保持原图像
VoltmeterVariable.Timer ++ ;
}
else
{
VoltmeterVariable.Valid = 0 ;
}
}
if(VoltmeterVariable.Valid)
{
SetGaugesPara(VoltGauges, VoltmeterVariable.AvrVoltage);
u8GuiMode = GetGaugesCurrentPos(VoltGauges);
}
else
{
}
VoltmeterVariable.Gui_Voltmeter = u8GuiMode ;
static uint8_t u8GuiMode = 0 ;
VoltmeterVariable.AvrVoltage = Get_VoltFilter();
if ((VoltmeterVariable.AvrVoltage >= 17000) && (VoltmeterVariable.AvrVoltage <= 30500))
{
VoltmeterVariable.Valid = 1 ;
VoltmeterVariable.Timer = 0 ;
}
else
{
//检测出范围以外数据时的处理
if (VoltmeterVariable.Timer < (2000 / 20))
{
//未到2sec前保持原图像
VoltmeterVariable.Timer ++ ;
}
else
{
VoltmeterVariable.Valid = 0 ;
}
}
if (VoltmeterVariable.Valid)
{
SetGaugesPara(VoltGauges, VoltmeterVariable.AvrVoltage);
u8GuiMode = GetGaugesCurrentPos(VoltGauges);
}
else
{
}
VoltmeterVariable.Gui_Voltmeter = u8GuiMode ;
}
/*-------------------------------------------------------------------------
* Function Name : Get_Voltmeter_AvrVoltage
......@@ -155,9 +155,9 @@ static void Data_Voltmeter_2_Gui(void)
--------------------------------------------------------------------------*/
uint16_t Get_Voltmeter_AvrVoltage(void)
{
uint16_t u16Result = 0 ;
u16Result = VoltmeterVariable.AvrVoltage ;
return u16Result ;
uint16_t u16Result = 0 ;
u16Result = VoltmeterVariable.AvrVoltage ;
return u16Result ;
}
/*-------------------------------------------------------------------------
* Function Name : Gui_Get_Voltmeter_DisplayMode
......@@ -169,9 +169,9 @@ uint16_t Get_Voltmeter_AvrVoltage(void)
--------------------------------------------------------------------------*/
uint8_t Gui_Get_Voltmeter_DisplayMode(void)
{
uint8_t u8Result = 0 ;
u8Result = VoltmeterVariable.Gui_Voltmeter ;
return u8Result ;
uint8_t u8Result = 0 ;
u8Result = VoltmeterVariable.Gui_Voltmeter ;
return u8Result ;
}
/*-------------------------------------------------------------------------
* Function Name : Get_Voltmeter_Valid
......@@ -183,9 +183,9 @@ uint8_t Gui_Get_Voltmeter_DisplayMode(void)
--------------------------------------------------------------------------*/
uint8_t Get_Voltmeter_Valid(void)
{
uint8_t u8Result = 0 ;
u8Result = VoltmeterVariable.Valid ;
return u8Result ;
uint8_t u8Result = 0 ;
u8Result = VoltmeterVariable.Valid ;
return u8Result ;
}
......
......@@ -4,23 +4,23 @@
#include "CAN_Communication_Matrix.h"
//-------------------------------------------
//WET空气计 数据处理 wangboyu
//WET空气计 数据处理
//-------------------------------------------
//区域1显示逻辑
//-------------------------------------------
//344 - 3.4.2.2电压计显示画面
//344 - 3.4.2.2电压计显示画面
//-------------------------------------------
static struct
{
uint8_t SumCnt ;
uint32_t Voltage ;
uint16_t Result ;
}WET_Filter ;
uint8_t SumCnt ;
uint32_t Voltage ;
uint16_t Result ;
} WET_Filter ;
/*-------------------------------------------------------------------------
* Function Name : WET_KL30_Init
* Description :
* Description :
* Input : None
* Output : None
* Return : None
......@@ -67,39 +67,39 @@ void WET_Processing_Service(void)
--------------------------------------------------------------------------*/
void WET_AdcData_Filter(void)
{
uint8_t u8WETValid = 0 ;
uint16_t WETVoltage = 0 ;
//u8WETValid = RTE_Read_WET_Valid();
if(u8WETValid)
{
if(WET_Filter.SumCnt < 50)
{
WET_Filter.SumCnt ++ ;
//WETVoltage = RTE_Read_WET_Voltage() ;
WET_Filter.Voltage += WETVoltage ;
WETVoltage = (uint16_t)(WET_Filter.Voltage/WET_Filter.SumCnt) ;
}
else
{
WET_Filter.SumCnt = 0 ;
WET_Filter.Voltage = 0 ;
//WETVoltage = RTE_Read_WET_Voltage() ;
WET_Filter.SumCnt ++ ;
WET_Filter.Voltage += WETVoltage ;
WETVoltage = (uint16_t)(WET_Filter.Voltage/WET_Filter.SumCnt) ;
}
}
else
{
WET_Filter.SumCnt = 0 ;
WET_Filter.Voltage = 0 ;
WETVoltage = 0 ;
}
WET_Filter.Result = WETVoltage ;
uint8_t u8WETValid = 0 ;
uint16_t WETVoltage = 0 ;
//u8WETValid = RTE_Read_WET_Valid();
if (u8WETValid)
{
if (WET_Filter.SumCnt < 50)
{
WET_Filter.SumCnt ++ ;
//WETVoltage = RTE_Read_WET_Voltage() ;
WET_Filter.Voltage += WETVoltage ;
WETVoltage = (uint16_t)(WET_Filter.Voltage / WET_Filter.SumCnt) ;
}
else
{
WET_Filter.SumCnt = 0 ;
WET_Filter.Voltage = 0 ;
//WETVoltage = RTE_Read_WET_Voltage() ;
WET_Filter.SumCnt ++ ;
WET_Filter.Voltage += WETVoltage ;
WETVoltage = (uint16_t)(WET_Filter.Voltage / WET_Filter.SumCnt) ;
}
}
else
{
WET_Filter.SumCnt = 0 ;
WET_Filter.Voltage = 0 ;
WETVoltage = 0 ;
}
WET_Filter.Result = WETVoltage ;
}
/*-------------------------------------------------------------------------
* Function Name : Gui_Get_Voltmeter_Valid
......@@ -111,9 +111,9 @@ void WET_AdcData_Filter(void)
--------------------------------------------------------------------------*/
static uint16_t Get_WET_Adc_Filter(void)
{
uint16_t u16Result ;
u16Result = WET_Filter.Result ;
return u16Result ;
uint16_t u16Result ;
u16Result = WET_Filter.Result ;
return u16Result ;
}
/*-------------------------------------------------------------------------
* Function Name : Gui_Get_Voltmeter_Valid
......
#include "Individual_ECU_Comm.h"
#include "CAN_Communication_Matrix.h"
//---------------------------------------------------------
//仪表→“守护神”ECU的通信式样 wangboyu 2021年8月3日09:48:26
//---------------------------------------------------------
//344 - 7
//---------------------------------------------------------
static const DefaultCommCode[COMM_CODE_MAX_NUM] = {0x01,0x40,0x41,0x81,0x40,0xD1,0x7F};
//typedef struct
//{
// ID18FEAE17_TYPE Data_Type[ ID18FEAE17_TYPE_MAX ] ;
// uint32_t Data[ ID18FEAE17_TYPE_MAX ] ;
//}ReqDataStruct;
static struct
{
en_CommSta CacheReqCode ;
en_CommSta ReqCode ;
en_CommSta OldReqCode ;
en_CommSta RespCode ;
uint8_t ErrCount ;
uint8_t ErrSta ;
uint8_t RevEvent ;
//------------------
ID18FEAE17_TYPE Type ;
uint32_t Data[ID18FEAE17_TYPE_MAX] ;
uint32_t ReqData[ID18FEAE17_TYPE_MAX] ;
}CommVariable ;
static void Set_ECU_ResponseCode(en_CommSta Code);
static void Set_ECU_Data(ID18FEAE17_TYPE Type,uint32_t Data);
/*-------------------------------------------------------------------------
* Function Name : Individual_ECU_Comm_KL30_Init
* Description :
* Input : None
* Output : None
* Return : None
* onther : None
--------------------------------------------------------------------------*/
void Individual_ECU_Comm_KL30_Init(void)
{
Set_Meter_RequestCode(METER_CODE_DATA_T_REQ,ID_TripA_AvrFuelCost,0) ;
CommVariable.ErrCount = 1 ;
CommVariable.ErrSta = 0 ;
CommVariable.RevEvent = 0 ;
}
void Individual_ECU_Comm_KL15_ON_Init(void)
{
}
void Individual_ECU_Comm_KL15_OFF_Init(void)
{
}
void Individual_ECU_Comm_Wakeup_Init(void)
{
}
void Individual_ECU_Comm_Sleep_Init(void)
{
}
/*-------------------------------------------------------------------------
* Function Name : Individual_ECU_Comm_Processing_Service
* Description :
* Input : None
* Output : None
* Return : None
* onther : None
--------------------------------------------------------------------------*/
void Individual_ECU_Comm_Processing_Service(void)
{
if(CAN_MSG_Status(ID_CanMsg18EF1718_Msg_Count) == CAN_SIG_LOST)
{
CommVariable.RevEvent = 0 ;
CommVariable.ErrCount = 0 ;
CommVariable.ErrSta = 1 ;
}
else
{
if(CommVariable.RevEvent)
{
CommVariable.RevEvent = 0 ;
if(CommVariable.OldReqCode != CommVariable.ReqCode)
{
CommVariable.OldReqCode = CommVariable.ReqCode ;
CommVariable.ErrCount = 0 ;
}
switch(CommVariable.ReqCode)
{
case METER_CODE_DATA_T_REQ :
if(CommVariable.RespCode == ECU_CODE_DATA_T_Y_RESPONSE)
{
CommVariable.ErrCount = 0 ;
CommVariable.ErrSta = 0 ;
}
else
{
if(CommVariable.ErrCount < 10)
{
CommVariable.ErrCount ++ ;
CommVariable.ErrSta = 1 ;
}
else
{
CommVariable.ErrSta = 2 ;
}
}
break ;
case METER_CODE_DATA_CLR_REQ :
if(CommVariable.RespCode == ECU_CODE_DATA_CLR_Y_RESPONSE)
{
CommVariable.ErrCount = 0 ;
CommVariable.ErrSta = 0 ;
}
else
{
if(CommVariable.ErrCount < 10)
{
CommVariable.ErrCount ++ ;
CommVariable.ErrSta = 1 ;
}
else
{
CommVariable.ErrSta = 2 ;
}
}
break ;
case METER_CODE_DATA_W_REQ :
if(CommVariable.RespCode == ECU_CODE_DATA_W_Y_RESPONSE)
{
CommVariable.ErrCount = 0 ;
CommVariable.ErrSta = 0 ;
}
else
{
if(CommVariable.ErrCount < 10)
{
CommVariable.ErrCount ++ ;
CommVariable.ErrSta = 1 ;
}
else
{
CommVariable.ErrSta = 2 ;
}
}
break ;
default :
break ;
}
}
}
}
/*-------------------------------------------------------------------------
* Function Name : RevMsg_ID18EF1718_Cbk
* Description : 放在CAN接收中断中
* Input : None
* Output : None
* Return : None
* onther : None
--------------------------------------------------------------------------*/
void RevMsg_ID18EF1718_Cbk(void)
{
uint8_t i = 0 ;
uint32_t Data = 0 ;
ID18FEAE17_TYPE Type = 0 ;
CommVariable.RevEvent = 1 ;
if(Get_ID_18EF1718_Sig_Response_Code() == DefaultCommCode[ECU_CODE_DATA_T_Y_RESPONSE])
{
Set_ECU_ResponseCode(ECU_CODE_DATA_T_Y_RESPONSE) ;
}
else if(Get_ID_18EF1718_Sig_Response_Code() == DefaultCommCode[ECU_CODE_DATA_CLR_Y_RESPONSE])
{
Set_ECU_ResponseCode(ECU_CODE_DATA_CLR_Y_RESPONSE) ;
}
else if(Get_ID_18EF1718_Sig_Response_Code() == DefaultCommCode[ECU_CODE_DATA_W_Y_RESPONSE])
{
Set_ECU_ResponseCode(ECU_CODE_DATA_W_Y_RESPONSE) ;
}
else
{
Set_ECU_ResponseCode(ECU_CODE_DATA_N_RESPONSE) ;
}
Type = Get_ID_18EF1718_Sig_Data_Type();
Data = Get_ID_18EF1718_Sig_Date();
for(i = 0 ;i < ID18FEAE17_TYPE_MAX;i ++)
{
if(Type == IDAE17_TYTE_DATA[i])
{
break ;
}
}
Set_ECU_Data(i,Data);
}
/*-------------------------------------------------------------------------
* Function Name : Set_Meter_RequestCode
* Description : 应用发起- 清零或复位等事件
* Input : None
* Output : None
* Return : None
* onther : None
--------------------------------------------------------------------------*/
void Set_Meter_RequestCode(en_CommSta Code,ID18FEAE17_TYPE Type,uint32_t Data)
{
CommVariable.CacheReqCode = Code ;
if(Code != METER_CODE_DATA_T_REQ)
{
CommVariable.Type = Type ;
CommVariable.ReqData[ Type ] = Data ;
}
}
/*-------------------------------------------------------------------------
* Function Name : Meter_RequestCode_Update
* Description : 放在CAN发送中断的首行
* Input : None
* Output : None
* Return : None
* onther : None
--------------------------------------------------------------------------*/
void Meter_RequestCode_Update(void)
{
if(CommVariable.CacheReqCode != CommVariable.ReqCode)
{
CommVariable.ReqCode = CommVariable.CacheReqCode ;
}
}
/*-------------------------------------------------------------------------
* Function Name : Get_Meter_RequestID
* Description :
* Input : None
* Output : None
* Return : None
* onther : None
--------------------------------------------------------------------------*/
en_CommSta Get_Meter_RequestID(void)
{
return CommVariable.ReqCode ;
}
/*-------------------------------------------------------------------------
* Function Name : Get_Meter_RequestCode
* Description :
* Input : None
* Output : None
* Return : None
* onther : None
--------------------------------------------------------------------------*/
uint8_t Get_Meter_RequestCode(void)
{
return DefaultCommCode[ CommVariable.ReqCode ] ;
}
/*-------------------------------------------------------------------------
* Function Name : Get_Meter_RequestType
* Description :
* Input : None
* Output : None
* Return : None
* onther : None
--------------------------------------------------------------------------*/
ID18FEAE17_TYPE Get_Meter_RequestType(void)
{
return CommVariable.Type ;
}
/*-------------------------------------------------------------------------
* Function Name : Get_Meter_RequestData
* Description :
* Input : None
* Output : None
* Return : None
* onther : None
--------------------------------------------------------------------------*/
uint32_t Get_Meter_RequestData(ID18FEAE17_TYPE Type)
{
return CommVariable.ReqData[ Type ] ;
}
/*-------------------------------------------------------------------------
* Function Name : Set_ECU_ResponseCode
* Description :
* Input : None
* Output : None
* Return : None
* onther : None
--------------------------------------------------------------------------*/
static void Set_ECU_ResponseCode(en_CommSta Code)
{
CommVariable.RespCode = Code ;
}
/*-------------------------------------------------------------------------
* Function Name : Get_ECU_ResponseCode
* Description :
* Input : None
* Output : None
* Return : None
* onther : None
--------------------------------------------------------------------------*/
static uint8_t Get_ECU_ResponseCode(void)
{
return DefaultCommCode[ CommVariable.RespCode ] ;
}
/*-------------------------------------------------------------------------
* Function Name : Set_ECU_Data
* Description :
* Input : None
* Output : None
* Return : None
* onther : None
--------------------------------------------------------------------------*/
static void Set_ECU_Data(ID18FEAE17_TYPE Type,uint32_t Data)
{
if(Type < ID18FEAE17_TYPE_MAX)
{
CommVariable.Data[Type] = Data ;
}
}
/*-------------------------------------------------------------------------
* Function Name : Get_ECU_Data
* Description :
* Input : None
* Output : None
* Return : None
* onther : None
--------------------------------------------------------------------------*/
uint32_t Get_ECU_Data(ID18FEAE17_TYPE Type)
{
return CommVariable.Data[Type] ;
}
/*-------------------------------------------------------------------------
* Function Name : Get_ECU_RespErr
* Description : 错误计数器状态
* Input : None
* Output : None
* Return : None
* onther : None
--------------------------------------------------------------------------*/
uint8_t Get_ECU_RespErr(void)
{
return CommVariable.ErrSta ;
}
/*-------------------------------------------------------------------------
* Function Name : Get_ECU_RespSure
* Description : 得到肯定应答
* Input : None
* Output : None
* Return : None
* onther : None
--------------------------------------------------------------------------*/
uint8_t Get_ECU_RespSure(void)
{
uint8_t u8Result = 0 ;
if(CommVariable.ErrSta == 0)
{
u8Result = 1 ;
}
return u8Result ;
}
#ifndef INDIVIDUAL_ECU_COMM_H
#define INDIVIDUAL_ECU_COMM_H
#include "TYW_stdint.h"
typedef enum
{
ID_TripA_AvrFuelCost = 0 ,//Trip A平均油耗
ID_TripA_AvrSpeed ,//Trip A平均车速
ID_TripA_ConsDyeingFee ,//Trip A燃費消耗量
ID_TripA_IdleSpeedTime ,//Trip A怠速时间
ID_TripA_RunTime ,//Trip A运行时间
ID_TripB_AvrFuelCost ,//Trip B平均油耗
ID_TripB_AvrSpeed ,//Trip B平均车速
ID_TripB_ConsDyeingFee ,//Trip B燃费消耗量
ID_TripB_IdleSpeedTime ,//Trip B怠速时间
ID_TripB_RunTime ,//Trip B运行时间
ID_ResidualDistance ,//发动机油&滤清器残留距离 (m)
ID_HowMany ,//起动机剩余次数(回)
ID_AlarmThreshold ,//发动机油&滤清器警报阈值 (m)
ID18FEAE17_TYPE_MAX ,
}ID18FEAE17_TYPE ;
extern const uint8_t IDAE17_TYTE_DATA[ID18FEAE17_TYPE_MAX];
typedef enum
{
METER_CODE_DATA_T_REQ = 0 , //普通数据传输请求
METER_CODE_DATA_CLR_REQ , //清除数据要求
METER_CODE_DATA_W_REQ , //数据改写要求
ECU_CODE_DATA_T_Y_RESPONSE , //常用数据发送肯定应答
ECU_CODE_DATA_CLR_Y_RESPONSE , //清除数据的肯定应答
ECU_CODE_DATA_W_Y_RESPONSE , //改写数据肯定应答
ECU_CODE_DATA_N_RESPONSE , //否定应答
COMM_CODE_MAX_NUM ,
}en_CommSta ;
extern void Individual_ECU_Comm_KL30_Init(void);
extern void Individual_ECU_Comm_KL15_ON_Init(void);
extern void Individual_ECU_Comm_KL15_OFF_Init(void);
extern void Individual_ECU_Comm_Wakeup_Init(void);
extern void Individual_ECU_Comm_Sleep_Init(void);
extern void Individual_ECU_Comm_Processing_Service(void);
extern void RevMsg_ID18EF1718_Cbk(void);
extern void Individual_ECU_Comm_Processing_Service(void);
extern void Set_Meter_RequestCode(en_CommSta Code,ID18FEAE17_TYPE Type,uint32_t Data) ;//应用发起
extern void Meter_RequestCode_Update(void);
extern en_CommSta Get_Meter_RequestID(void) ;
extern uint8_t Get_Meter_RequestCode(void);
extern ID18FEAE17_TYPE Get_Meter_RequestType(void);
extern uint32_t Get_Meter_RequestData(ID18FEAE17_TYPE Type);
extern uint8_t Get_ECU_RespErr(void);
extern uint8_t Get_ECU_RespSure(void);
extern uint32_t Get_ECU_Data(ID18FEAE17_TYPE Type);
#endif
......@@ -40,7 +40,6 @@
#include "IS31FL3236.h"
#include "GUI.h"
#include "Individual_ECU_Comm.h"
#include "Data_Fuel_User.h"
#define POWER_NM_SLEEP 0U
......@@ -106,7 +105,6 @@ Power_Status_t Power_KL30_Init ( void )
/*按键部分 杨真东维护结束*/
AirPressure_KL30_Init();
Individual_ECU_Comm_KL30_Init();
/*报警调度初始化*/
Popup_Scheduler_Init();
/*报警调度初始化*/
......
#include "CAN_Communication_Matrix.h"
#include "CAN_FUNC.h"
#include "Individual_ECU_Comm.h"
/* 2021/09/22 11:03:12 */
const st_CAN_SendAttribute st_CANSendAttr[ID_SEND_TOTAL] =
......@@ -1090,4 +1089,4 @@ uint8_t Co_Can_ConvertSubID(uint32_t MsgID)
break;
}
return u8Result;
}
\ No newline at end of file
}
......@@ -11,7 +11,6 @@
#include "Data_CoolantTemperature.h"
#include "Data_Voltmeter.h"
#include "Data_AirPressure.h"
#include "Individual_ECU_Comm.h"
#include "RTE_TIME.h"
#include "Services_Mileage.h"
#include "RTE_ADC.h"
......@@ -258,88 +257,10 @@ void Can_Set_Buff_18FEE617(uint8_t CopyData [])
* onther : None
--------------------------------------------------------------------------*/
const uint8_t IDAE17_TYTE_DATA[ID18FEAE17_TYPE_MAX] = {0x50, 0x51, 0x52, 0x53, 0x54, 0x60, 0x61, 0x62, 0x63, 0x64, 0x20, 0x22, 0x30};
static const uint8_t IDAE17_SendOrder[ID18FEAE17_TYPE_MAX][2U] =
{
// A B
{ID_AlarmThreshold , ID_TripA_AvrFuelCost },
{ID_TripA_AvrFuelCost , ID_TripA_AvrSpeed },
{ID_TripA_AvrSpeed , ID_TripA_ConsDyeingFee },
{ID_TripA_ConsDyeingFee , ID_TripA_IdleSpeedTime },
{ID_TripA_IdleSpeedTime , ID_TripA_RunTime },
{ID_TripA_RunTime , ID_TripB_AvrFuelCost },
{ID_TripB_AvrFuelCost , ID_TripB_AvrSpeed },
{ID_TripB_AvrSpeed , ID_TripB_ConsDyeingFee },
{ID_TripB_ConsDyeingFee , ID_TripB_IdleSpeedTime },
{ID_TripB_IdleSpeedTime , ID_TripB_RunTime },
{ID_TripB_RunTime , ID_ResidualDistance },
{ID_ResidualDistance , ID_HowMany },
{ID_HowMany , ID_AlarmThreshold },
};
//Byte:6为最高级别Byte,Byte:3为最低级别Byte
void Can_Set_Buff_18EF1817(uint8_t CopyData [])
{
static uint8_t Count = 0 ;
uint8_t Type ;
uint8_t i = 0 ;
for (i = 0 ; i < 8 ; i ++)
{
CopyData[ i ] = 0xff ;
}
Meter_RequestCode_Update();
CopyData[ 0 ] = Get_Meter_RequestCode();
if (Get_Meter_RequestID() == METER_CODE_DATA_T_REQ)
{
//A
Type = IDAE17_SendOrder[Count][0];
//B
//Type = IDAE17_SendOrder[Count][1];
CopyData[ 1 ] = IDAE17_TYTE_DATA[Type] ;
if (Get_ECU_RespSure())
{
CopyData[ 2 ] = (uint8_t)Get_ECU_Data(Type);
CopyData[ 3 ] = (uint8_t)(Get_ECU_Data(Type) >> 8);
CopyData[ 4 ] = (uint8_t)(Get_ECU_Data(Type) >> 16);
CopyData[ 5 ] = (uint8_t)(Get_ECU_Data(Type) >> 24);
}
else
{
CopyData[ 2 ] = 0xff ;
CopyData[ 3 ] = 0xff ;
CopyData[ 4 ] = 0xff ;
CopyData[ 5 ] = 0xff ;
}
Count ++ ;
if (Count >= ID18FEAE17_TYPE_MAX)
{
Count = 0 ;
}
}
else
{
CopyData[ 1 ] = IDAE17_TYTE_DATA[Get_Meter_RequestType()] ;
if (Get_ECU_RespSure())
{
Set_Meter_RequestCode(METER_CODE_DATA_T_REQ, ID_TripA_AvrFuelCost, 0);
}
else
{
CopyData[ 2 ] = (uint8_t)Get_Meter_RequestData(Type);
CopyData[ 3 ] = (uint8_t)(Get_Meter_RequestData(Type) >> 8);
CopyData[ 4 ] = (uint8_t)(Get_Meter_RequestData(Type) >> 16);
CopyData[ 5 ] = (uint8_t)(Get_Meter_RequestData(Type) >> 24);
}
}
//0xFF固定送信
CopyData[ 6 ] = 0xff ;
CopyData[ 7 ] = 0xff ;
}
......
......@@ -78,7 +78,6 @@
#include "Data_FuelConsump.h"
#include "IS31FL3236.h"
#include "Individual_ECU_Comm.h"
#include "TimerB.h"
#include "BU98R10.h"
......@@ -160,7 +159,6 @@ void Sys_Run_Mode_10ms_Tasks(void)
------------------------------------------------------------------------------*/
void Sys_Run_Mode_20ms_Tasks(void)
{
Individual_ECU_Comm_Processing_Service();
Coolant_Processing_Service();
Tacho_Processing_Service();
Speed_Processing_Service();
......
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