Commit 4788817e authored by hu's avatar hu

调整车速显示

parent 490dac50
No preview for this file type
This diff is collapsed.
project .intvect 1536 project .intvect 1536
project .text 299324 project .text 299212
project .rodata 412383 project .rodata 412367
project .secinfo 120 project .secinfo 120
project .syscall 6 project .syscall 6
project .romdata 7853 project .romdata 7853
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
//------------------------------------------- //-------------------------------------------
//断码显示 //断码显示
//------------------------------------------- //-------------------------------------------
//344 - 3.1.1. 水温计显示 //344 - 3.1.1. 水温计显示
//------------------------------------------- //-------------------------------------------
static struct static struct
{ {
...@@ -84,16 +84,10 @@ void Coolant_Processing_Service(void) ...@@ -84,16 +84,10 @@ void Coolant_Processing_Service(void)
{ {
Msg_CoolTemp = Get_ID_18FEEE00_Sig_Engine_Coolant_Temperature(); Msg_CoolTemp = Get_ID_18FEEE00_Sig_Engine_Coolant_Temperature();
if (Msg_CoolTemp > 0xFA) if (Msg_CoolTemp > 0xFAu)
{ {
//if(Timer2s < 100) CoolantVariable.Valid = 0u ;
//{ TargetSeg = 0u;
// Timer2s ++ ;
//}
//else
{
CoolantVariable.Valid = 0 ;
}
} }
else else
{ {
......
...@@ -11,8 +11,8 @@ static struct ...@@ -11,8 +11,8 @@ static struct
uint16_t Data[VEH_FILTER_LEN]; uint16_t Data[VEH_FILTER_LEN];
} VehcleFilter; } VehcleFilter;
static uint32_t SPEED_PPK = 15925ul; static uint32_t SPEED_PPK = 15925u;
static uint32_t SPEED_RADIO = 637; static uint32_t SPEED_RADIO = 637u;
uint16_t Vehicle_ACT_Speed; uint16_t Vehicle_ACT_Speed;
uint16_t Vehicle_DISP_Speed; uint16_t Vehicle_DISP_Speed;
...@@ -92,6 +92,7 @@ void Speed_Sleep_Init(void) ...@@ -92,6 +92,7 @@ void Speed_Sleep_Init(void)
void Speed_Processing_Service(void) void Speed_Processing_Service(void)
{ {
uint32_t VehValTmp = 0u; uint32_t VehValTmp = 0u;
uint32_t VehValDisp = 0u;
uint32_t PPK = 0u; uint32_t PPK = 0u;
PPK = Get_Speed_PPK(); PPK = Get_Speed_PPK();
...@@ -102,22 +103,35 @@ void Speed_Processing_Service(void) ...@@ -102,22 +103,35 @@ void Speed_Processing_Service(void)
if (VehValTmp > 2250) if (VehValTmp > 2250)
{ {
VehValTmp = 0;
VehicleSpeedValid = 0; VehicleSpeedValid = 0;
Vehicle_ACT_Speed = 0;
} }
else else
{ {
VehicleSpeedValid = 1; VehicleSpeedValid = 1;
if (VehValTmp >= 1400u)
{
Vehicle_ACT_Speed = 1400u;
}
else if (VehValTmp <= 40u)
{
Vehicle_ACT_Speed = 0u;
}
else
{
Vehicle_ACT_Speed = VehValTmp;
}
} }
Vehicle_ACT_Speed = VehValTmp;
//传入表头 //传入表头 计算放大系数
VehValTmp = VehSpeedAmplification((uint16_t)VehValTmp); VehValDisp = VehSpeedAmplification((uint16_t)Vehicle_ACT_Speed);
SetGaugesPara(VehGauges, (uint16_t)VehValTmp); SetGaugesPara(VehGauges, (uint16_t)VehValDisp);
//获得显示格和显示车速 //获得显示格和显示车速
Vehicle_CurSeg = GetGaugesCurrentPos(VehGauges); Vehicle_CurSeg = GetGaugesCurrentPos(VehGauges);
Vehicle_DISP_Speed = GetVehDisVal(Vehicle_CurSeg, &GaugesInfo_Init_Table[VehGauges]); Vehicle_DISP_Speed = VehValDisp;//GetVehDisVal(Vehicle_CurSeg, &GaugesInfo_Init_Table[VehGauges]);
} }
static uint16_t Cal_VehSpeed(uint16_t Fre, uint8_t Len) static uint16_t Cal_VehSpeed(uint16_t Fre, uint8_t Len)
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
//#include "CAN_Signal_Tx.h" //#include "CAN_Signal_Tx.h"
#define VEH_SPEED_CURVE_NUM 12u #define VEH_SPEED_CURVE_NUM 8u
uint16_t RevDispSpeed = 0u; uint16_t RevDispSpeed = 0u;
uint16_t RevTargetSpeed = 0u; uint16_t RevTargetSpeed = 0u;
uint16_t RevCurrentSpeed = 0u; uint16_t RevCurrentSpeed = 0u;
...@@ -47,9 +47,6 @@ typedef struct ...@@ -47,9 +47,6 @@ typedef struct
volatile Frequency_t VehFre; volatile Frequency_t VehFre;
uint32_t VehFreLimit; uint32_t VehFreLimit;
uint16_t PPK;
/* /*
...@@ -60,18 +57,13 @@ uint16_t PPK; ...@@ -60,18 +57,13 @@ uint16_t PPK;
const VehSpeedCurve_t VehSpeedCurve[ VEH_SPEED_CURVE_NUM ] = const VehSpeedCurve_t VehSpeedCurve[ VEH_SPEED_CURVE_NUM ] =
{ {
{0u , 0u}, {0u , 0u},
{200u , 210u}, {200u , 200u},
{400u , 420u}, {400u , 400u},
{600u , 620u}, {600u , 600u},
{800u , 830u}, {800u , 800u},
{1000u, 1030u}, {1000u, 1000u},
{1200u, 1250u}, {1200u, 1200u},
{1400u, 1450u}, {1400u, 1400u},
{1600u, 1650u},
{1800u, 1850u},
{2000u, 2050u},
{2250u, 2250u},
}; };
/*-------------------------------------------------------------------------- /*--------------------------------------------------------------------------
* Function Name : VehSpeedFindSector * Function Name : VehSpeedFindSector
...@@ -334,8 +326,7 @@ void Veh_Fre_Init(uint32_t PPK) ...@@ -334,8 +326,7 @@ void Veh_Fre_Init(uint32_t PPK)
VehFre.Cycle = 0u; VehFre.Cycle = 0u;
VehFre.Frequency = 0u; VehFre.Frequency = 0u;
VehFre.PulseCnt = 0u; VehFre.PulseCnt = 0u;
VehFreLimit = (3600000000u / (220u * PPK)) / 4u / 50u; VehFreLimit = (3600000000u / (225u * PPK)) / 4u / 50u;
//VehFreLimit = (3600000000u / (250u * PPK)) / 4u / 50u;
} }
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
...@@ -477,7 +468,12 @@ uint16_t Cal_Veh_Frequency(void) ...@@ -477,7 +468,12 @@ uint16_t Cal_Veh_Frequency(void)
//uint16_t Cal_Veh_Val(void) //uint16_t Cal_Veh_Val(void)
//{ //{
// uint32_t VehValTmp;
// //
// VehValTmp = Cal_Veh_Frequency();
// VehValTmp = (VehValTmp * 36000u) / PPK;
//
// return (uint16_t)VehValTmp;
//} //}
uint8_t FuelDropTimes = 0; uint8_t FuelDropTimes = 0;
...@@ -498,57 +494,4 @@ void Data_ESpeed_LED_Processing_Service(void) ...@@ -498,57 +494,4 @@ void Data_ESpeed_LED_Processing_Service(void)
} }
/*************************************** /***************************************
数据处理服务函数 数据处理服务函数
***************************************/ ***************************************/
void Data_Group_Processing_Service(void) \ No newline at end of file
{
}
void Data_VehicleSpeed_Fre_CaptureSimulata(void)
{
}
void TRIP_FuelConsump(void)
{
uint32_t trip = 0u;
trip = Data_Read_Trip(EM_TRIP_A);
if (trip > 99999u)
{
Data_Clear_Trip(EM_TRIP_A);
}
else
{
;
}
trip = Data_Read_Trip(EM_TRIP_B);
if (trip > 99999u)
{
Rest_FuelCounsumpTrip_Data();
}
else
{
;
}
trip = Data_Read_Trip(EM_TRIP_C);
if (trip > 99999u)
{
Rest_FuelCounsumpThisTime_Data();
}
else
{
;
}
}
uint8_t Common_Get_TempHigh_Type(void)
{
return LED_TEMP_HIGH_FLAG ;
}
uint8_t Common_Get_FuelLow_Type(void)
{
return LED_FUEL_LOW_FLAG ;
}
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
#define TACHO_SEG_NUM_MAX 27U #define TACHO_SEG_NUM_MAX 27U
#define VEH_SEG_NUM_MAX 30U #define VEH_SEG_NUM_MAX 30U
static uint8_t GaugesTimer;
static void Seg_General_Digit_Display(uint32_t Digit, uint8_t Len, uint8_t Blank, uint8_t *DigitBuf, uint8_t *Reg); static void Seg_General_Digit_Display(uint32_t Digit, uint8_t Len, uint8_t Blank, uint8_t *DigitBuf, uint8_t *Reg);
static void Seg_Digit_1_Disp(uint8_t Digit); static void Seg_Digit_1_Disp(uint8_t Digit);
static void Seg_Digit_2_Disp(uint8_t Digit); static void Seg_Digit_2_Disp(uint8_t Digit);
...@@ -563,6 +565,7 @@ static void SEG_PRI_Display(uint8_t Value, uint8_t Valid, uint8_t seg_status) ...@@ -563,6 +565,7 @@ static void SEG_PRI_Display(uint8_t Value, uint8_t Valid, uint8_t seg_status)
SEG_BUFF_Set(BU98_CHIP1, SEG_REDEFINE_115, seg_status); // A83 SEG_BUFF_Set(BU98_CHIP1, SEG_REDEFINE_115, seg_status); // A83
SEG_BUFF_Set(BU98_CHIP1, SEG_REDEFINE_116, seg_status); // A84 SEG_BUFF_Set(BU98_CHIP1, SEG_REDEFINE_116, seg_status); // A84
SEG_BUFF_Set(BU98_CHIP1, SEG_REDEFINE_117, seg_status); // A85 SEG_BUFF_Set(BU98_CHIP1, SEG_REDEFINE_117, seg_status); // A85
if (Valid == GUI_DISP_MODE_BLANK) if (Valid == GUI_DISP_MODE_BLANK)
{ {
for (i = 0; i < PRI_SEG_NUM_MAX; i++) for (i = 0; i < PRI_SEG_NUM_MAX; i++)
...@@ -577,6 +580,7 @@ static void SEG_PRI_Display(uint8_t Value, uint8_t Valid, uint8_t seg_status) ...@@ -577,6 +580,7 @@ static void SEG_PRI_Display(uint8_t Value, uint8_t Valid, uint8_t seg_status)
SEG_BUFF_Set(BU98_CHIP1, SEG_REDEFINE_115, 0); // A83 SEG_BUFF_Set(BU98_CHIP1, SEG_REDEFINE_115, 0); // A83
SEG_BUFF_Set(BU98_CHIP1, SEG_REDEFINE_116, 0); // A84 SEG_BUFF_Set(BU98_CHIP1, SEG_REDEFINE_116, 0); // A84
SEG_BUFF_Set(BU98_CHIP1, SEG_REDEFINE_117, 0); // A85 SEG_BUFF_Set(BU98_CHIP1, SEG_REDEFINE_117, 0); // A85
for (i = 0; i < PRI_SEG_NUM_MAX; i++) for (i = 0; i < PRI_SEG_NUM_MAX; i++)
{ {
mSEG[i] = 0; mSEG[i] = 0;
...@@ -1015,14 +1019,19 @@ static void Seg_General_Digit_Display(uint32_t Digit, uint8_t Len, uint8_t Blank ...@@ -1015,14 +1019,19 @@ static void Seg_General_Digit_Display(uint32_t Digit, uint8_t Len, uint8_t Blank
static uint8_t wbyTestSeg = 0; static uint8_t wbyTestSeg = 0;
static uint16_t wbyTestNum; static uint16_t wbyTestNum;
static uint8_t WBY_SET = 0; static uint8_t WBY_SET = 0;
/******************************************************************************
Seg_Display_Service 在 20MS任务中
信号接口:
信号定义:
输出信号:
******************************************************************************/
void Seg_Display_Service(void) void Seg_Display_Service(void)
{ {
uint32_t Ign_Time; uint32_t Ign_Time;
Ign_Time = Common_GetIgnOnTime(); Ign_Time = Common_GetIgnOnTime();
if (Common_Get_IG_Sts() == COMMON_POWER_ON) if (Common_Get_IG_Sts() == COMMON_POWER_ON)
{ {
if (WBY_SET == 1) if (WBY_SET == 1)/*测试用点亮全部断码*/
{ {
Seg_Display_ON(); Seg_Display_ON();
} }
...@@ -1030,6 +1039,7 @@ void Seg_Display_Service(void) ...@@ -1030,6 +1039,7 @@ void Seg_Display_Service(void)
{ {
SEG_A25_Disp(7u); //左侧弧线 SEG_A25_Disp(7u); //左侧弧线
SEG_C25_Disp(7u); //右侧弧线 SEG_C25_Disp(7u); //右侧弧线
if (Ign_Time < 3100) if (Ign_Time < 3100)
{ {
SEG_PRI_Display(GetGaugesCurrentPos(PRIGasGauges), GUI_DISP_MODE_NORMAL, 7u); // PRI气压格 SEG_PRI_Display(GetGaugesCurrentPos(PRIGasGauges), GUI_DISP_MODE_NORMAL, 7u); // PRI气压格
...@@ -1038,53 +1048,65 @@ void Seg_Display_Service(void) ...@@ -1038,53 +1048,65 @@ void Seg_Display_Service(void)
SEG_Fuel_Display(GetGaugesCurrentPos(TempGauges), GUI_DISP_MODE_NORMAL, 7u); //燃油格 SEG_Fuel_Display(GetGaugesCurrentPos(TempGauges), GUI_DISP_MODE_NORMAL, 7u); //燃油格
SEG_Tacho_Display(GetGaugesCurrentPos(RevGauges), GUI_DISP_MODE_NORMAL, 7u); //转速格 SEG_Tacho_Display(GetGaugesCurrentPos(RevGauges), GUI_DISP_MODE_NORMAL, 7u); //转速格
SEG_VehicleSpeed_Display(GetGaugesCurrentPos(VehGauges), GUI_DISP_MODE_NORMAL, 7u); //车速格 SEG_VehicleSpeed_Display(GetGaugesCurrentPos(VehGauges), GUI_DISP_MODE_NORMAL, 7u); //车速格
/*车速数字 暂时没有变化,只是全部点亮*/
Seg_Digit_1_Disp(12); Seg_Digit_1_Disp(12);
Seg_Digit_2_Disp(12); Seg_Digit_2_Disp(12);
Seg_Digit_3_Disp(12); Seg_Digit_3_Disp(12);
return; GaugesTimer = 15u;
}
if (AirPressure_Get_Valid(0))
{
SEG_PRI_Display(AirPressure_Get_CurSeg(0), GUI_DISP_MODE_NORMAL, 7u); // PRI气压格
} }
else else if (GaugesTimer == 0u)
{
SEG_PRI_Display(AirPressure_Get_CurSeg(0), GUI_DISP_MODE_INVALID, 7u); // PRI气压格
}
if (AirPressure_Get_Valid(1))
{
SEG_SEC_Display(AirPressure_Get_CurSeg(1), GUI_DISP_MODE_NORMAL, 7u); // SEC气压格
}
else
{ {
SEG_SEC_Display(AirPressure_Get_CurSeg(1), GUI_DISP_MODE_INVALID, 7u); // SEC气压格 GaugesTimer = 15u;
}
if (Coolant_Get_Valid()) if (AirPressure_Get_Valid(0))
{ {
SEG_Coolant_Display(Coolant_Get_CurSeg(), GUI_DISP_MODE_NORMAL, 7u); //水温格 SEG_PRI_Display(AirPressure_Get_CurSeg(0), GUI_DISP_MODE_NORMAL, 7u); // PRI气压格
}
else
{
SEG_PRI_Display(AirPressure_Get_CurSeg(0), GUI_DISP_MODE_INVALID, 7u); // PRI气压格
}
if (AirPressure_Get_Valid(1))
{
SEG_SEC_Display(AirPressure_Get_CurSeg(1), GUI_DISP_MODE_NORMAL, 7u); // SEC气压格
}
else
{
SEG_SEC_Display(AirPressure_Get_CurSeg(1), GUI_DISP_MODE_INVALID, 7u); // SEC气压格
}
if (Coolant_Get_Valid())
{
SEG_Coolant_Display(Coolant_Get_CurSeg(), GUI_DISP_MODE_NORMAL, 7u); //水温格
}
else
{
SEG_Coolant_Display(Coolant_Get_CurSeg(), GUI_DISP_MODE_INVALID, 7u); //水温格
}
SEG_Fuel_Display(Fuel_Get_CurSeg(), GUI_DISP_MODE_NORMAL, 7u); //燃油格
SEG_Tacho_Display(Tacho_Get_CurSeg(), GUI_DISP_MODE_NORMAL, 7u); //转速格
SEG_VehicleSpeed_Display(Speed_Get_CurSeg(), GUI_DISP_MODE_NORMAL, 7u); //车速格
wbyTestNum = Common_Get_Disp_V_Speed();
// Speed_Get_Display_Value()
SEG_VehicleSpeed_Num(wbyTestNum, GUI_DISP_MODE_NORMAL); //车速值
// SEG_PRI_Display(wbyTestSeg,GUI_DISP_MODE_NORMAL,7u) ;//PRI气压格
// SEG_SEC_Display(wbyTestSeg,GUI_DISP_MODE_NORMAL,7u) ;//SEC气压格
// SEG_Coolant_Display(wbyTestSeg,GUI_DISP_MODE_NORMAL,7u) ;//水温格
// SEG_Fuel_Display(wbyTestSeg, GUI_DISP_MODE_NORMAL,7u);//燃油格
// SEG_Tacho_Display(wbyTestSeg,GUI_DISP_MODE_NORMAL,7u);//转速格
// SEG_VehicleSpeed_Display(wbyTestSeg,GUI_DISP_MODE_NORMAL,7u);//车速格
// SEG_VehicleSpeed_Num(wbyTestNum,GUI_DISP_MODE_NORMAL);//车速值
} }
else else
{ {
SEG_Coolant_Display(Coolant_Get_CurSeg(), GUI_DISP_MODE_INVALID, 7u); //水温格 GaugesTimer--;
} }
SEG_Fuel_Display(Fuel_Get_CurSeg(), GUI_DISP_MODE_NORMAL, 7u); //燃油格
SEG_Tacho_Display(Tacho_Get_CurSeg(), GUI_DISP_MODE_NORMAL, 7u); //转速格
SEG_VehicleSpeed_Display(Speed_Get_CurSeg(), GUI_DISP_MODE_NORMAL, 7u); //车速格
wbyTestNum = Common_Get_Disp_V_Speed();
// Speed_Get_Display_Value()
SEG_VehicleSpeed_Num(wbyTestNum, GUI_DISP_MODE_NORMAL); //车速值
// SEG_PRI_Display(wbyTestSeg,GUI_DISP_MODE_NORMAL,7u) ;//PRI气压格
// SEG_SEC_Display(wbyTestSeg,GUI_DISP_MODE_NORMAL,7u) ;//SEC气压格
// SEG_Coolant_Display(wbyTestSeg,GUI_DISP_MODE_NORMAL,7u) ;//水温格
// SEG_Fuel_Display(wbyTestSeg, GUI_DISP_MODE_NORMAL,7u);//燃油格
// SEG_Tacho_Display(wbyTestSeg,GUI_DISP_MODE_NORMAL,7u);//转速格
// SEG_VehicleSpeed_Display(wbyTestSeg,GUI_DISP_MODE_NORMAL,7u);//车速格
// SEG_VehicleSpeed_Num(wbyTestNum,GUI_DISP_MODE_NORMAL);//车速值
} }
} }
else 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