Commit 64510179 authored by hu's avatar hu

Merge branch 'development' into withBoot

parents 10a6da7e 50993e08
......@@ -5,6 +5,7 @@
#include "DisplaySch_user.h"
#include "DispSch.h"
#include "Gauges.h"
//-------------------------------------------
//水温数据处理
......@@ -74,14 +75,17 @@ void Coolant_Processing_Service(void)
uint8_t TargetSeg = 0 ;
uint8_t Msg_CoolTemp = 0u ;
uint8_t CanStatus = 0u;
static uint16_t TempCurSeg = 0;
static uint16_t TempCurSegTime = 0;
static uint16_t DestPostionOld = 0;
CanStatus = CAN_MSG_Status(ID_CanMsg18FEEE00_Msg_Count);
if (CanStatus == CAN_SIG_LOST)
{
CoolantVariable.Valid = 0 ;
CoolantVariable.Valid = 0u;
CoolantVariable.Value = 0u;
Timer2s = 0 ;
Timer2s = 0u;
}
else
{
......@@ -90,6 +94,7 @@ void Coolant_Processing_Service(void)
if (Msg_CoolTemp > 0xFAu)
{
CoolantVariable.Valid = 0u ;
CoolantVariable.Value = 0u;
TargetSeg = 0u;
}
else
......@@ -108,7 +113,33 @@ void Coolant_Processing_Service(void)
}
}
CoolantVariable.CurSeg = CalCoolant_CurSeg(CoolantVariable.Valid, CoolantVariable.Value);
TempCurSeg = CalCoolant_CurSeg(CoolantVariable.Valid, CoolantVariable.Value);
if (
(GetGaugesDirec(TempGauges) == 1u) &&
(TempCurSeg == DestPostion[TempGauges] / 10u)
)
{
if (DestPostionOld != DestPostion[TempGauges] / 10u)
{
DestPostionOld = DestPostion[TempGauges] / 10u;
TempCurSegTime = 0u;
}
if (TempCurSegTime < 200u)
{
TempCurSegTime ++;
}
else
{
CoolantVariable.CurSeg = TempCurSeg;
}
}
else
{
TempCurSegTime = 0u;
CoolantVariable.CurSeg = TempCurSeg;
}
}
/*-------------------------------------------------------------------------
* Function Name : CalCoolant_CurSeg
......@@ -122,15 +153,14 @@ static uint8_t CalCoolant_CurSeg(uint8_t Valid, uint8_t Temp)
{
uint8_t u8Result = 0u;
SetGaugesPara(TempGauges, Temp);
if (Valid)
{
SetGaugesPara(TempGauges, Temp);
u8Result = GetGaugesCurrentPos(TempGauges) ;
}
else
{
//范围外/CAN中断
SetGaugesPara(TempGauges, Temp);
u8Result = 0 ;
}
......
......@@ -12,8 +12,6 @@
*/
#include "Gauges.h"
#include "GaugesInterface.h"
#define GAUGES_TOTAL_NUM 9u
#define GAUGES_INIT_TIME_MAX 3500u
uint16_t GaugesCurrentPos[GAUGES_TOTAL_NUM] ;
uint16_t BackupDestPostion[GAUGES_TOTAL_NUM];
uint16_t GaugesDisPos[GAUGES_TOTAL_NUM];
......@@ -422,18 +420,10 @@ void GaugeMoveing(uint8_t GaugesNum)
GaugesMoveTimesTmp = GaugesFreeSetTimes;
}
else
{
/*水温表上升最后一格需要调整时间*/
if ((GaugesNum == TempGauges) && (DirecSign[TempGauges] == 1u) && (GaugesCurrentPos[TempGauges] == (DestPostion[TempGauges] - 10u)))
{
GaugesMoveTimesTmp = 4000u;
}
else
{
GaugesMoveTimesTmp = GaugesDisDelayMax[DisplayModeTmp[GaugesNum]][GaugesModuleType [GaugesNum]];
}
}
}
if (GaugesNum == VoltGauges)
{
......
......@@ -22,6 +22,10 @@
/*#define uint32_t unsigned long*/
/*??Struct*/
#define GAUGES_TOTAL_NUM 9u
#define GAUGES_INIT_TIME_MAX 3500u
typedef enum
{
StepperMotor = 0u,
......@@ -54,6 +58,7 @@ typedef struct
} _GaugesInfoInit;
extern uint16_t DestPostion[GAUGES_TOTAL_NUM];
extern uint8_t QuerySector(_GaugesInfoInit *GParam, uint8_t DirecSignPara, uint8_t SubAscf, uint16_t FunGaugesDataIn);
extern uint16_t GetGaugestargetPosSub( _GaugesInfoInit *GParam, uint8_t SubAscf, uint8_t SectorID, uint8_t DirecSignPara, uint16_t FunGaugesDataIn );
extern uint16_t GetGaugestargetPos( _GaugesInfoInit *GParam, uint8_t DirecSignPara);
......
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