Commit 89e57de4 authored by 张金硕's avatar 张金硕

feat:新增佳伟的水温部分逻辑和水温表走格贴图

parent b0870e31
......@@ -738,6 +738,16 @@
<FileType>5</FileType>
<FilePath>..\..\..\..\Source\Application\BlueTooth.h</FilePath>
</File>
<File>
<FileName>Hysteresis.h</FileName>
<FileType>5</FileType>
<FilePath>..\..\..\..\Source\Application\Hysteresis.h</FilePath>
</File>
<File>
<FileName>Hysteresis_V10_239.lib</FileName>
<FileType>4</FileType>
<FilePath>..\..\..\..\Source\Application\Hysteresis_V10_239.lib</FilePath>
</File>
</Files>
</Group>
<Group>
......
This diff is collapsed.
#ifndef DATA_COOLANT_H
#define DATA_COOLANT_H
#include "stdint.h"
typedef enum{
CoolantSensorNormal = 0,
CoolantSensorShortCircuit,
CoolantSensorOpenCircuit,
}CoolantSensorSts_t;
extern void Coolant_KL15_Init(void);
extern void Coolant_KL30_Init(void);
extern void Coolant_Cal_Sevice(uint8_t deltaTime);
extern uint8_t Get_CurCoolantSetp(void);
extern CoolantSensorSts_t Get_Coolant_Sensor_State(void);
void Coolant_R_Cal(uint8_t deltaTime);
#include "Components.h"
#define Coolant_LEN 17
typedef unsigned int INT16U;
/*** 控制结构 ***/
typedef struct
{
uint8_t u8_DestSeg;
uint8_t u8_CurSeg;
}DataCoolantTempDisStruct;
extern DataCoolantTempDisStruct DataCoolantTemp_Dis;
typedef struct
{
uint16_t Temp_Value;
uint8_t Symbol;
uint16_t u16Can_Actual;
uint8_t u8Can_Valid;
uint16_t u16Res_Actual;
uint16_t u16Res_ADValue;
uint8_t u8Res_Valid;
uint8_t u8Res_ADValid;
uint8_t u8Res_Flashtimer ;
uint8_t TEMPSetp;
uint8_t TEMPMode;
uint16_t TEMP_Fastime ;
}DataCoolantTempStruct; //水温数据结构
typedef struct
{
uint32_t Buffer[5];
uint8_t Cnt;
uint8_t time;
uint16_t ResOpen_ActTimer;
uint16_t ResOpen_InActTimer;
}DataCoolantTempSamplerStruct;
void Common_SelfCheckTime_Init(void);
void Common_SelfCheckTime(void);
void Data_Coolant_Temp_Processing_Service(void);
uint16_t Get_Coolant_Res_To_Temp(uint16_t Temp_Res);
void Get_Coolant_Temp_Seg(uint16_t Temp_Value);
void Data_Coolant_Temp_Display ( void );
extern uint16_t GET_DataCollantTempSegValid(void);
extern void TEMP_KL30_Init ( void );
extern void TEMP_KL15_Init ( void );
extern uint8_t GET_DataCoolantTempSegDisp(void);
void TEMP_Gauges_Cal(void);
uint16_t Get_Res_To_Temp(uint16_t *ResBoard, uint16_t *TempBoard, uint8_t Len, uint16_t input);
extern DataCoolantTempStruct DataCoolantTemp ;
#endif
#ifndef HYSTERESIS_H__
#define HYSTERESIS_H__
// #define HYS_PLATFORM_16BIT
#ifdef HYS_PLATFORM_16BIT
typedef unsigned char Hys_uint8_t;
typedef unsigned int Hys_uint16_t;
typedef unsigned long Hys_uint32_t;
#else
typedef unsigned char Hys_uint8_t;
typedef unsigned short Hys_uint16_t;
typedef unsigned int Hys_uint32_t;
typedef unsigned long long Hys_uint64_t;
#endif
/*所有需要处理的物理量枚举*/
typedef enum
{
HYS_TEMP = 0U, /*水温*/
HYS_PWM, /*..*/
HYS_NUM_MAX,
} HYS_Num_en_t;
/***************************Do not modify the following*********************************/
/***************************Do not modify the following*********************************/
/***************************Do not modify the following*********************************/
/*当前文件版本号*/
#define HYS_VERSION_NUM 0X10U
#define HYS_RAM_DATA_LEN (HYS_NUM_MAX * 2U)
/*操作函数返回状态*/
typedef enum
{
HYS_OPERATE_SUCCESS = 0UL, /*函数操作成功*/
HYS_OPERATE_FAIL, /*函数操作失败*/
} HYS_Operate_Type_en_t;
typedef struct
{
/*该段的下限值*/
Hys_uint16_t u16HYSSegLow;
/*该段的上限值*/
Hys_uint16_t u16HYSSegHigh;
} HYS_Seg_Table_st_t;
typedef struct
{
/*参数分段属性表*/
const HYS_Seg_Table_st_t *pstHYSSegTable;
/*默认填0U即可*/
Hys_uint16_t u16HYSReserved;
/*分段属性表长度*/
Hys_uint8_t u8HYSSegTableLen;
/*1U:正序 0U:降序*/
Hys_uint8_t u8HYSSortBy;
} HYS_Attribute_st_t;
typedef struct
{
/*物理量数量,也就是 HYS_NUM_MAX */
Hys_uint8_t u8HYSNum;
} HYS_Init_st_t;
/************************************************************************/
/*30初始化,所有状态重新开始计算*/
void HYS_KL30_Init(Hys_uint8_t *pu8HYSRamData, const HYS_Attribute_st_t *pstHYSAttribute, HYS_Init_st_t *pstHYSInit);
/*唤醒初始化,会保持休眠唤醒前的状态*/
void HYS_Wakeup_Init(Hys_uint8_t *pu8HYSRamData, const HYS_Attribute_st_t *pstHYSAttribute, HYS_Init_st_t *pstHYSInit);
/*输入对应索引的物理量参数*/
HYS_Operate_Type_en_t HYS_Physical_Quantity_Input(HYS_Num_en_t enHYSIndex, Hys_uint16_t u16HYSPhysValue);
/*获取分段结果,返回0xFF表示无效*/
Hys_uint8_t HYS_Get_Seg(HYS_Num_en_t enHYSIndex);
/*复位某个物理量,重新判断计算*/
HYS_Operate_Type_en_t HYS_Reset_Physical_Quantity(HYS_Num_en_t enHYSIndex);
/*读取版本号*/
Hys_uint8_t HYS_Version_Read(void);
#endif
\ No newline at end of file
......@@ -3554,11 +3554,20 @@ static void AMT630H_GUI_PhoneConnect_Fuel(uint8_t Fuel)
*PARAMETER : uint8_t Coolant-水温等级 0 - 红区一格 1 - 正常一格
*RETURN : NULL
*/
void AMT630H_GUI_PhoneConnect_Coolant(void)
void AMT630H_GUI_PhoneConnect_Coolant(uint8_t Coolant)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0947_709_533);
SetPagePic(GRAPHICS_PAGE_0, Pic_0948_967_533);
SetPagePic(GRAPHICS_PAGE_0, Pic_0413_727_533);
if(Coolant>0)
{
for(uint8_t i=0;i<Coolant;i++)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0427_729_536+i);
}
}
}
/*电压显示函数*/
static void AMT630H_GUI_Voltage(uint16_t Voltage)
......@@ -4802,7 +4811,7 @@ void AMT630H_GUI_PhoneConnect_Second_LowHalf(void)
AMT630H_GUI_PhoneConnect_VSpeed(VechileSpeed);
AMT630H_GUI_PhoneConnect_ESpeed(Get_DispEngineSpeed());
AMT630H_GUI_PhoneConnect_Fuel(Get_CurFuelSetp());
AMT630H_GUI_PhoneConnect_Coolant();
AMT630H_GUI_PhoneConnect_Coolant(GET_DataCoolantTempSegDisp());
AMT630H_GUI_PhoneConnect_Telephone();
if(KL30_VOLTAGE_time < 10)
{
......
......@@ -28,6 +28,7 @@
#include "Data_VSpeed.h"
#include "Data_Coolant.h"
#include "Data_Fuel.h"
#include "Hysteresis.h"
#include "Mileage\Services_Mileage_User.h"
#include "BackLight.h"
#include "RTC\RTE_RTC.h"
......
......@@ -72,6 +72,7 @@ static void Power_KL30_Init(void)
RTE_DEEPSLEEP_GPIO_Interrupt_Enable(KL15_AD_IN, Trigger_Rising);
FaultCode_Init();
TEMP_KL30_Init();
}
static void Power_Wakeup_Init(void)
......@@ -106,6 +107,7 @@ static void Power_Wakeup_Init(void)
Protocol_KL30_Wakeup_Init();
RTE_DEEPSLEEP_GPIO_Interrupt_Enable(KL15_AD_IN, Trigger_Rising);
FaultCode_Init();
TEMP_KL30_Init();
}
static void Power_LVP_Init(void)
......@@ -129,6 +131,7 @@ static void Power_IG_ON_Init(void)
Line_In_KL15_ON_Init();
Telltales_KL15_Init();
Fuel_KL15_Init();
TEMP_KL15_Init();
//RTE_GPIO_Set_Level(Blacklight_PWM, 1);
FaultCode_Init();
mwAmt630hUartSendDatainit();
......
......@@ -41,7 +41,6 @@ void Sys_10ms_Tasks(void)
Key_Clear_Time();
Key_TimeOut_Service();
Fuel_R_Cal(10u);
Coolant_R_Cal(10u);
Data_Light_Res_service(10);
BackLight_Process();
}
......@@ -50,6 +49,7 @@ void Sys_20ms_Tasks(void)
{
Data_Vehicle_Speed_Processing_Service();
Data_Engine_Speed_Processing_Service();
Data_Coolant_Temp_Processing_Service();
}
void Sys_50ms_Tasks(void)
......@@ -83,7 +83,6 @@ void Sys_100ms_Tasks(void)
S3_ServerCNTT();
Get_DisTime_Service();
Fuel_Cal_Sevice(100u);
Coolant_Cal_Sevice(100u);
Services_Mileage_Callback();
// Data_Mileage_Clear();
RTE_GPIO_Config(RTE_GPIO_PORT05_PIN04, GpioOut_High);
......
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