Commit d86ced18 authored by 张明扬's avatar 张明扬 🇨🇳
parents 89324ceb bed48f07
...@@ -48,6 +48,8 @@ void BackLight_Process(void) ...@@ -48,6 +48,8 @@ void BackLight_Process(void)
// } // }
//} //}
//if ( LED_Turnon == 5 ) //if ( LED_Turnon == 5 )
if (Common_GetIgnOnTime() >= 3000)
{
if (Line_In_Get_Status(LINE_IN_Little_Lamp)) if (Line_In_Get_Status(LINE_IN_Little_Lamp))
{ {
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_NIGHT); TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_NIGHT);
...@@ -56,6 +58,11 @@ void BackLight_Process(void) ...@@ -56,6 +58,11 @@ void BackLight_Process(void)
{ {
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_DAY); TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_DAY);
} }
}
else
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_DAY);
}
} }
else else
......
...@@ -50,28 +50,29 @@ typedef struct ...@@ -50,28 +50,29 @@ typedef struct
} HYS_Seg_Table_st_t; } HYS_Seg_Table_st_t;
const HYS_Seg_Table_st_t stHYSSegTableTemp[7] = const HYS_Seg_Table_st_t stHYSSegTableTemp[7] =
{ {
{0U, 470U}, // 0 {0U, 4700U}, // 0
{500U, 590U}, // 1 {5000U, 5900U}, // 1
{620U, 770U}, // 2 {6200U, 7700U}, // 2
{800U, 950U}, // 3 {8000U, 9500U}, // 3
{980U, 1120U}, // 4 {9800U, 11200U}, // 4
{1150U, 1990U}, // 5 {11500U, 19900U}, // 5
{1990U, 2000U}, // 6 {19900U, 20000U}, // 6
}; };
uint32_t u32CoolantDataTimeCount = 0UL; uint32_t u32CoolantDataTimeCount = 0UL;
uint32_t u32ColCurNum = 0UL; /*阻尼数显*/ uint32_t u32ColCurNum = 0UL; /*阻尼数显*/
uint32_t u32CoolantNum = 0UL;/*当前实际数据,与显示数值不完全一致*/
/* /*
u32CoolantDir:0:下行,1:上行 2:无变化 u32CoolantDir:0:下行,1:上行 2:无变化
*/ */
uint32_t Data_Coolant_Cal_Num(uint32_t u32CoolantCurSeg, uint32_t u32CoolantDir, uint32_t u32CoolantRemTime, uint32_t u32CoolantCurNum, uint32_t u32CoolantDesNum) uint32_t Data_Coolant_Cal_Num(uint32_t u32CoolantCurSeg, uint32_t u32CoolantDir, uint32_t u32CoolantRemTime, uint32_t u32CoolantCurNum, uint32_t u32CoolantDesNum)
{ {
uint32_t u32CoolantNum = u32CoolantCurNum;
uint32_t u32CoolantNumMax = 0UL; uint32_t u32CoolantNumMax = 0UL;
uint32_t u32CoolantNumMin = 0UL; uint32_t u32CoolantNumMin = 0UL;
uint32_t u32CoolantSegDesNum = 0UL; uint32_t u32CoolantSegDesNum = 0UL;
uint32_t u32CoolantCalBuf = 0UL; uint32_t u32CoolantCalBuf = 0UL;
uint32_t u32CoolantCalBuf1 = 0UL; uint32_t u32CoolantCalBuf1 = 0UL;
uint32_t u32CoolantCalResult = u32CoolantCurNum;
/*计算当前格对应的目标数值*/ /*计算当前格对应的目标数值*/
/*当前格数对应的数值范围,目标数值是否在这个范围内,如果在就直接用目标值。如果不在就根据上下行选择该范围内的极大和极小值。*/ /*当前格数对应的数值范围,目标数值是否在这个范围内,如果在就直接用目标值。如果不在就根据上下行选择该范围内的极大和极小值。*/
...@@ -138,17 +139,52 @@ uint32_t Data_Coolant_Cal_Num(uint32_t u32CoolantCurSeg, uint32_t u32CoolantDir, ...@@ -138,17 +139,52 @@ uint32_t Data_Coolant_Cal_Num(uint32_t u32CoolantCurSeg, uint32_t u32CoolantDir,
u32CoolantNum = u32CoolantSegDesNum; u32CoolantNum = u32CoolantSegDesNum;
} }
} }
u32CoolantCalResult = u32CoolantNum;
if (u32CoolantDir == 0) // down
{
// uint32_t u32CoolantCalBuf2 = 0UL;
// if (u32CoolantNum>u32CoolantCurNum)
// {
// u32CoolantCalBuf2 = u32CoolantNum-u32CoolantCurNum;
// }
// else
// {
// u32CoolantCalBuf2 = u32CoolantCurNum-u32CoolantNum;
// }
// if (u32CoolantCalBuf2>=100)
// {
// u32CoolantNum+=99UL;
// }
if ((u32CoolantNum+99)>=u32CoolantCurNum)
{
u32CoolantCalResult= u32CoolantCurNum;
}
else
{
u32CoolantCalResult= ((u32CoolantNum+99)/100*100);
}
}
} }
else // 0 else // 0
{ {
u32CoolantNum = u32CoolantSegDesNum; u32CoolantNum = u32CoolantSegDesNum;
u32CoolantCalResult = u32CoolantNum;
} }
} }
/*根据目标数值计算每个变化周期内数值变化的大小,*/ /*根据目标数值计算每个变化周期内数值变化的大小,*/
/*根据目标数值以及剩余时间,修改当前显示值*/ /*根据目标数值以及剩余时间,修改当前显示值*/
return u32CoolantNum; // return u32CoolantNum;
return u32CoolantCalResult;
} }
void Data_Coolant_Temp_Processing_Service(void) void Data_Coolant_Temp_Processing_Service(void)
...@@ -278,7 +314,7 @@ void Data_Coolant_Temp_Display ( void ) ...@@ -278,7 +314,7 @@ void Data_Coolant_Temp_Display ( void )
if(DataCoolantTemp_Dis.u8_CurSeg > DataCoolantTemp_Dis.u8_DestSeg ) if(DataCoolantTemp_Dis.u8_CurSeg > DataCoolantTemp_Dis.u8_DestSeg )
{ {
u32ColCurNum = Data_Coolant_Cal_Num(DataCoolantTemp_Dis.u8_CurSeg, 0, (DataCoolantTemp_Dis.u8_Downtimer - DataCoolantTemp_Dis.u8_DownFlashtimer), u32ColCurNum, DataCoolantTemp.Value*10); u32ColCurNum = Data_Coolant_Cal_Num(DataCoolantTemp_Dis.u8_CurSeg, 0, (DataCoolantTemp_Dis.u8_Downtimer - DataCoolantTemp_Dis.u8_DownFlashtimer), u32ColCurNum, DataCoolantTemp.Value*100);
DataCoolantTemp_Dis.u8_UpFlashtimer = 0; DataCoolantTemp_Dis.u8_UpFlashtimer = 0;
DataCoolantTemp_Dis.u8_Holdtimer = 0; DataCoolantTemp_Dis.u8_Holdtimer = 0;
DataCoolantTemp_Dis.u8_DownFlashtimer++; DataCoolantTemp_Dis.u8_DownFlashtimer++;
...@@ -290,7 +326,7 @@ void Data_Coolant_Temp_Display ( void ) ...@@ -290,7 +326,7 @@ void Data_Coolant_Temp_Display ( void )
} }
else if (DataCoolantTemp_Dis.u8_CurSeg < DataCoolantTemp_Dis.u8_DestSeg) else if (DataCoolantTemp_Dis.u8_CurSeg < DataCoolantTemp_Dis.u8_DestSeg)
{ {
u32ColCurNum = Data_Coolant_Cal_Num(DataCoolantTemp_Dis.u8_CurSeg, 1, (DataCoolantTemp_Dis.u8_Uptimer - DataCoolantTemp_Dis.u8_UpFlashtimer), u32ColCurNum, DataCoolantTemp.Value*10); u32ColCurNum = Data_Coolant_Cal_Num(DataCoolantTemp_Dis.u8_CurSeg, 1, (DataCoolantTemp_Dis.u8_Uptimer - DataCoolantTemp_Dis.u8_UpFlashtimer), u32ColCurNum, DataCoolantTemp.Value*100);
DataCoolantTemp_Dis.u8_DownFlashtimer = 0; DataCoolantTemp_Dis.u8_DownFlashtimer = 0;
DataCoolantTemp_Dis.u8_Holdtimer = 0; DataCoolantTemp_Dis.u8_Holdtimer = 0;
DataCoolantTemp_Dis.u8_UpFlashtimer++; DataCoolantTemp_Dis.u8_UpFlashtimer++;
...@@ -311,7 +347,7 @@ void Data_Coolant_Temp_Display ( void ) ...@@ -311,7 +347,7 @@ void Data_Coolant_Temp_Display ( void )
} }
/*目标格和当前格一致时,数显如何处理*/ /*目标格和当前格一致时,数显如何处理*/
/*5S后更新为目标数值*/ /*5S后更新为目标数值*/
u32ColCurNum = Data_Coolant_Cal_Num(DataCoolantTemp_Dis.u8_CurSeg, 2, (CoolantFlashtimer-DataCoolantTemp_Dis.u8_Holdtimer ), u32ColCurNum, DataCoolantTemp.Value*10); u32ColCurNum = Data_Coolant_Cal_Num(DataCoolantTemp_Dis.u8_CurSeg, 2, (CoolantFlashtimer-DataCoolantTemp_Dis.u8_Holdtimer ), u32ColCurNum, DataCoolantTemp.Value*100);
} }
// warning // warning
...@@ -322,11 +358,11 @@ void Data_Coolant_Temp_Display ( void ) ...@@ -322,11 +358,11 @@ void Data_Coolant_Temp_Display ( void )
} }
else else
{ {
if (DataCoolantTemp.Value >= 115) if (GET_DataCoolantSegValue() >= 115)
{ {
DataCoolantTemp_Dis.u8_Warnflg = 2; DataCoolantTemp_Dis.u8_Warnflg = 2;
} }
else if (DataCoolantTemp.Value <= 112) else if (GET_DataCoolantSegValue() <= 112)
{ {
DataCoolantTemp_Dis.u8_Warnflg = 0; DataCoolantTemp_Dis.u8_Warnflg = 0;
} }
...@@ -462,7 +498,7 @@ uint16_t GET_DataCoolantTempValueDisp(void) ...@@ -462,7 +498,7 @@ uint16_t GET_DataCoolantTempValueDisp(void)
} }
uint16_t GET_DataCoolantSegValue(void) uint16_t GET_DataCoolantSegValue(void)
{ {
return u32ColCurNum/10; return (u32ColCurNum)/100;
} }
uint8_t GET_DataCollantTempValueValid(void) uint8_t GET_DataCollantTempValueValid(void)
{ {
......
...@@ -50,9 +50,10 @@ static void Power_KL30_Init(void) ...@@ -50,9 +50,10 @@ static void Power_KL30_Init(void)
eeprom_StoreInfo_Init(); eeprom_StoreInfo_Init();
Can_Init(); Can_Init();
Data_TPMS_KL30_Init ();
CAN_TX_Count_Init(); CAN_TX_Count_Init();
CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Enable); CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Enable);
Data_TPMS_KL30_Init ();
DFlash_init(); DFlash_init();
Data_Read_DiagPara(); Data_Read_DiagPara();
...@@ -75,7 +76,7 @@ static void Power_KL30_Init(void) ...@@ -75,7 +76,7 @@ static void Power_KL30_Init(void)
Fuel_KL30_Init(); Fuel_KL30_Init();
Data_Voltage_Init(); Data_Voltage_Init();
// TimerM_PWM_counter_Output_Init(TIMERM_COUNTER0, 400, 64000000); // TimerM_PWM_counter_Output_Init(TIMERM_COUNTER0, 400, 64000000);
TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 400, 64000000); TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 1260, 64000000);
// TimerM_PWM_counter_Output_Init(TIMERM_COUNTER0, 400); // TimerM_PWM_counter_Output_Init(TIMERM_COUNTER0, 400);
// TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 400); // TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 400);
// TimerM_PWM_CH_Output_init(TIMERM_COUNTER0, TIMERM_CHB, ActiveLevel_High); // TimerM_PWM_CH_Output_init(TIMERM_COUNTER0, TIMERM_CHB, ActiveLevel_High);
...@@ -132,7 +133,7 @@ static void Power_Wakeup_Init(void) ...@@ -132,7 +133,7 @@ static void Power_Wakeup_Init(void)
Fuel_KL30_Init(); Fuel_KL30_Init();
Data_Voltage_Init(); Data_Voltage_Init();
// TimerM_PWM_counter_Output_Init(TIMERM_COUNTER0, 400, 64000000); // TimerM_PWM_counter_Output_Init(TIMERM_COUNTER0, 400, 64000000);
TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 400, 64000000); TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 1260, 64000000);
// TimerM_PWM_counter_Output_Init(TIMERM_COUNTER0, 400); // TimerM_PWM_counter_Output_Init(TIMERM_COUNTER0, 400);
// TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 400); // TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 400);
// TimerM_PWM_CH_Output_init(TIMERM_COUNTER0, TIMERM_CHB, ActiveLevel_High); // TimerM_PWM_CH_Output_init(TIMERM_COUNTER0, TIMERM_CHB, ActiveLevel_High);
...@@ -207,7 +208,11 @@ static void Power_Sleep_Init(void) ...@@ -207,7 +208,11 @@ static void Power_Sleep_Init(void)
LED_Driver_Service(); LED_Driver_Service();
Analog_Signal_Conv_Stop(); Analog_Signal_Conv_Stop();
UART_DeInit(UART0); UART_DeInit(UART0);
//if(RTE_GPIO_Get_Level(WAKEUP_KL15_In) == 0)
{
RTE_DEEPSLEEP_Enable(); RTE_DEEPSLEEP_Enable();
}
} }
static Power_Status_em Power_Stay_ON(void) static Power_Status_em Power_Stay_ON(void)
......
...@@ -311,13 +311,13 @@ ...@@ -311,13 +311,13 @@
#define CheckSumErr 7 // Checksum Error #define CheckSumErr 7 // Checksum Error
#define UnknownPartID 8 // Unknown Part ID #define UnknownPartID 8 // Unknown Part ID
#define SWV 0x100 // 0x100 = 1.00 software version 软件版本号 #define SWV 0x115 // 0x100 = 1.00 software version 软件版本号
#define HWV 0x103 // 0x100 = 1.00 hardware version 硬件版本号 #define HWV 0x103 // 0x100 = 1.00 hardware version 硬件版本号
#define BTV 0x100 // 0x100 = 1.00 bootloader version boot程序版本号 #define BTV 0x100 // 0x100 = 1.00 bootloader version boot程序版本号
#define INTLV 0x112 // 0x100 = 1.00 internal version 内部版本号 #define INTLV 0x115 // 0x100 = 1.00 internal version 内部版本号
#define PROG_Y 0x24 // 0x24 = 2024年, program year #define PROG_Y 0x24 // 0x24 = 2024年, program year
#define PROG_M 0x08 // 0x03 = 3月, program month #define PROG_M 0x08 // 0x03 = 3月, program month
#define PROG_D 0x14 // 0x19 = 19日, program day #define PROG_D 0x17 // 0x19 = 19日, program day
/****************************************************************************** /******************************************************************************
Bootloader Variable Bootloader Variable
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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