Commit bed48f07 authored by 高士达's avatar 高士达

Merge branch 'lijianshuang' into 'dev'

Lijianshuang

See merge request !73
parents 8183f030 82902743
......@@ -48,9 +48,16 @@ void BackLight_Process(void)
// }
//}
//if ( LED_Turnon == 5 )
if (Line_In_Get_Status(LINE_IN_Little_Lamp))
if (Common_GetIgnOnTime() >= 3000)
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_NIGHT);
if (Line_In_Get_Status(LINE_IN_Little_Lamp))
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_NIGHT);
}
else
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_DAY);
}
}
else
{
......
......@@ -50,28 +50,29 @@ typedef struct
} HYS_Seg_Table_st_t;
const HYS_Seg_Table_st_t stHYSSegTableTemp[7] =
{
{0U, 470U}, // 0
{500U, 590U}, // 1
{620U, 770U}, // 2
{800U, 950U}, // 3
{980U, 1120U}, // 4
{1150U, 1990U}, // 5
{1990U, 2000U}, // 6
{0U, 4700U}, // 0
{5000U, 5900U}, // 1
{6200U, 7700U}, // 2
{8000U, 9500U}, // 3
{9800U, 11200U}, // 4
{11500U, 19900U}, // 5
{19900U, 20000U}, // 6
};
uint32_t u32CoolantDataTimeCount = 0UL;
uint32_t u32ColCurNum = 0UL; /*阻尼数显*/
uint32_t u32CoolantNum = 0UL;/*当前实际数据,与显示数值不完全一致*/
/*
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 u32CoolantNum = u32CoolantCurNum;
uint32_t u32CoolantNumMax = 0UL;
uint32_t u32CoolantNumMin = 0UL;
uint32_t u32CoolantSegDesNum = 0UL;
uint32_t u32CoolantCalBuf = 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,
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
{
u32CoolantNum = u32CoolantSegDesNum;
u32CoolantCalResult = u32CoolantNum;
}
}
/*根据目标数值计算每个变化周期内数值变化的大小,*/
/*根据目标数值以及剩余时间,修改当前显示值*/
return u32CoolantNum;
// return u32CoolantNum;
return u32CoolantCalResult;
}
void Data_Coolant_Temp_Processing_Service(void)
......@@ -278,7 +314,7 @@ void Data_Coolant_Temp_Display ( void )
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_Holdtimer = 0;
DataCoolantTemp_Dis.u8_DownFlashtimer++;
......@@ -290,7 +326,7 @@ void Data_Coolant_Temp_Display ( void )
}
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_Holdtimer = 0;
DataCoolantTemp_Dis.u8_UpFlashtimer++;
......@@ -311,7 +347,7 @@ void Data_Coolant_Temp_Display ( void )
}
/*目标格和当前格一致时,数显如何处理*/
/*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
......@@ -462,7 +498,7 @@ uint16_t GET_DataCoolantTempValueDisp(void)
}
uint16_t GET_DataCoolantSegValue(void)
{
return u32ColCurNum/10;
return (u32ColCurNum)/100;
}
uint8_t GET_DataCollantTempValueValid(void)
{
......
......@@ -208,7 +208,11 @@ static void Power_Sleep_Init(void)
LED_Driver_Service();
Analog_Signal_Conv_Stop();
UART_DeInit(UART0);
RTE_DEEPSLEEP_Enable();
//if(RTE_GPIO_Get_Level(WAKEUP_KL15_In) == 0)
{
RTE_DEEPSLEEP_Enable();
}
}
static Power_Status_em Power_Stay_ON(void)
......
......@@ -297,9 +297,9 @@ void CGC_HSEConfig(OSC_Pin_Mode_t main, OSC_Speed_Mode_t amph)
/* Clock switching needs to be executed in SRAM */
#if defined (__CC_ARM)
#pragma arm section code = "sram_code" // Arm Compiler 5
#pragma arm section code = "RW_FUNC_PLL" // Arm Compiler 5
#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION > 6010050)
#pragma clang section text = "sram_code" // Arm Compiler 6
#pragma clang section text = "RW_FUNC_PLL" // Arm Compiler 6
#endif
#if defined(__ICCARM__)
......
......@@ -311,13 +311,13 @@
#define CheckSumErr 7 // Checksum Error
#define UnknownPartID 8 // Unknown Part ID
#define SWV 0x114 // 0x100 = 1.00 software version 软件版本号
#define SWV 0x115 // 0x100 = 1.00 software version 软件版本号
#define HWV 0x103 // 0x100 = 1.00 hardware version 硬件版本号
#define BTV 0x100 // 0x100 = 1.00 bootloader version boot程序版本号
#define INTLV 0x114 // 0x100 = 1.00 internal version 内部版本号
#define INTLV 0x115 // 0x100 = 1.00 internal version 内部版本号
#define PROG_Y 0x24 // 0x24 = 2024年, program year
#define PROG_M 0x08 // 0x03 = 3月, program month
#define PROG_D 0x16 // 0x19 = 19日, program day
#define PROG_D 0x17 // 0x19 = 19日, program day
/******************************************************************************
Bootloader Variable
......
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