Commit e0948dd3 authored by 郑萍's avatar 郑萍

Merge branch 'zhengping' into 'dev'

Zhengping

See merge request !40
parents e4e01dc8 46017036
......@@ -275,7 +275,7 @@
</OCR_RVCT3>
<OCR_RVCT4>
<Type>1</Type>
<StartAddress>0xc400</StartAddress>
<StartAddress>0x0</StartAddress>
<Size>0x73c00</Size>
</OCR_RVCT4>
<OCR_RVCT5>
......
......@@ -2,8 +2,8 @@
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
LR_IROM1 0x0000c400 0x00073C00 { ; load region size_region
ER_IROM1 0x0000c400 0x00073C00 { ; load address = execution address
LR_IROM1 0x00000000 0x00073C00 { ; load region size_region
ER_IROM1 0x00000000 0x00073C00 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
......
......@@ -20,7 +20,7 @@ User definitions
typedef unsigned short MD_STATUS;
#define HAS_BOOTLOADER (1u) // 仅仿真App时设置为0
#define HAS_BOOTLOADER (0u) // 仅仿真App时设置为0
#define APP_BASE (0x0000C400ul)
/* Status list definition */
......
......@@ -15,7 +15,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
5000ul,
500ul,
0x101ul,
(( void * )0),
(( void * )0),
......
......@@ -288,27 +288,27 @@ void Data_Engine_Speed_Processing_Service ( void )
}
}
}
//第4步 增加回差
if (DataESpeedDisp <= 80)
{
DataESpeedDisp = DataESPeedDamping.Speed;
}
else
{
if ( DataESpeedDisp < DataESPeedDamping.Speed )
{
DataESpeedDisp = DataESPeedDamping.Speed;
}
else
{
Delta = DataESpeedDisp - DataESPeedDamping.Speed;
if ( Delta >= DATA_ESPEED_HYSTERESIS )
{
DataESpeedDisp = DataESPeedDamping.Speed;
}
}
}
DataESpeedDisp = DataESPeedDamping.Speed;
// //第4步 增加回差
// if (DataESpeedDisp <= 80)
// {
// DataESpeedDisp = DataESPeedDamping.Speed;
// }
// else
// {
// if ( DataESpeedDisp < DataESPeedDamping.Speed )
// {
// DataESpeedDisp = DataESPeedDamping.Speed;
// }
// else
// {
// Delta = DataESpeedDisp - DataESPeedDamping.Speed;
// if ( Delta >= DATA_ESPEED_HYSTERESIS )
// {
// DataESpeedDisp = DataESPeedDamping.Speed;
// }
// }
// }
}
uint8_t Get_EngineValid(void)
......
......@@ -11,7 +11,7 @@
#define DATA_ENGINE_RUNNING_THRESHOLD 400 //发动机运转阈值
#define DATA_ENGINE_STOP_THRESHOLD 300 //发动机停止阈值
#define DATA_ESPEED_DAMPING_FACTOR 4 //阻尼系数
#define DATA_ESPEED_DAMPING_FACTOR 1 //阻尼系数
#define DATA_ESPEED_INC_STEP 10 //速度增加时慢加速速度变化步长
#define DATA_ESPEED_DEC_STEP 20 //方向改变时急减速速度变化步长
#define DATA_ESPEED_APPR_SPEED_MIN 10 //最小逼近速度
......
......@@ -339,10 +339,10 @@ void Data_Vehicle_Speed_Processing_Service(void)
{
VSpeedCal *= 105;
VSpeedCal /= 100;
if((VSpeedCal % 10) >= 5)
{
VSpeedCal += 5; /* 四舍五入 */
}
// if((VSpeedCal % 10) >= 5)
// {
// VSpeedCal += 5; /* 四舍五入 */
// }
DataVSpeedDisp = ( uint16_t )VSpeedCal;
}
else
......
......@@ -7,7 +7,7 @@
#define DATA_VEHICLE_RUNNING_THRESHOLD 25 //汽车行进阈值
#define DATA_VEHICLE_STOP_THRESHOLD 20 //汽车停止阈值
#define DATA_VSPEED_DAMPING_FACTOR 3 //阻尼系数
#define DATA_VSPEED_DAMPING_FACTOR 1 //阻尼系数
#define DATA_VSPEED_INC_STEP 2 //速度增加时慢加速速度变化步长
#define DATA_VSPEED_DEC_STEP 6 //方向改变时急减速速度变化步长
#define DATA_VSPEED_APPR_SPEED_MIN 2 //最小逼近速度
......
......@@ -18,7 +18,7 @@ typedef struct
uint8_t Result;
}s_AMT630H_FlashCheck_t;
#define AMT630H_REFRESH_TIME 25U
#define AMT630H_REFRESH_TIME 50U
#define AMT630H_ANIMATION_TIME 3000U //ms
#define AMT630H_ANIMATION_PIC_NUM 110U
......
......@@ -2837,7 +2837,10 @@ static void AMT630H_GUI_TIME(uint16_t Hour, uint16_t Minute)
else if (g_u8Display_Mode == ModeNIGHT)
{
/*外部接收小时和分钟*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0634_916_503);
if (FLASH_SYNC_1Hz)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0634_916_503);
}
DISPLAY_NUM_ST DisplayNumPara;
uint16_t HourNumber;
uint16_t MinuteNumber;
......@@ -2909,11 +2912,11 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel)
else if (FuelLevel == 1)
{
s_FuelLowTime++;
if (s_FuelLowTime < 15)
if (s_FuelLowTime <= 15)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0552_503_529); /*黄色燃油灯*/
}
if (s_FuelLowTime == 20)
if (s_FuelLowTime > 20)
{
s_FuelLowTime = 0;
}
......@@ -2937,14 +2940,14 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel)
}
s_FuelLowTime = 0;
}
else if(FuelLevel == 1)
else if (FuelLevel == 1)
{
s_FuelLowTime++;
if (s_FuelLowTime < 15)
if (s_FuelLowTime <= 15)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0552_503_529); /*黄色燃油灯*/
}
if (s_FuelLowTime == 20)
if (s_FuelLowTime > 20)
{
s_FuelLowTime = 0;
}
......@@ -2952,7 +2955,9 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel)
else
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0661_503_529); /*白色燃油灯*/
s_FuelLowTime = 0;
}
}
/*燃油格数走格*/
......@@ -3142,16 +3147,27 @@ static void AMT630H_GUI_Voltage(uint16_t Voltage)
DISPLAY_NUM_ST DisplayNumPara;
uint16_t VoltageNumber;
VoltageNumber = Voltage / 10;
if (Voltage % 10 > 5)
{
VoltageNumber++;
}
uint16_t Voltage_Hundred;
uint16_t Voltage_Ten;
uint16_t Voltage_Unit;
uint16_t Front;
if ((VoltageNumber <= 120) || (VoltageNumber > 150))
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0563_923_407); /*电压图标*/
}
else
{
;
}
/*数据处理*/
Voltage_Hundred = VoltageNumber / 100;
Voltage_Ten = (VoltageNumber % 100) / 10;
Voltage_Unit = VoltageNumber % 10;
Front = Voltage_Ten * 10 + Voltage_Unit;
Front = Voltage_Hundred * 10 + Voltage_Ten;
DisplayNumPara.NumList = NumbeList_Voltage_NIGHT;
if ((VoltageNumber >= 100) && (VoltageNumber < 1000))
......@@ -3726,6 +3742,10 @@ static void AMT630H_GUI_ESpeed(uint16_t ESpeed)
* @brief 主界面显示
*
*/
uint8_t VechileSpeed_time = 0;
uint8_t KL30_VOLTAGE_time = 0;
uint8_t VechileSpeed = 0;
uint16_t KL30_VOLTAGE_Value = 0;
void AMT630H_GUI_BACKGRAND()
{
/*背景图*/
......@@ -3759,7 +3779,6 @@ void AMT630H_GUI_BACKGRAND()
/*主界面函数*/
AMT630H_GUI_Light();
AMT630H_GUI_TIME(Get_Dis_Hour_Time(), Get_Dis_Minute_Time());
AMT630H_GUI_Voltage((ADC_Read_Signal(ADC_CH_KL30_VOLTAGE)) / 10);
// AMT630H_GUI_Telephone(Telephone);
/*燃油*/
if (Get_Fuel_Sensor_State() == FuelSensorNormal)
......@@ -3770,19 +3789,31 @@ void AMT630H_GUI_BACKGRAND()
{
AMT630H_GUI_Fuel(0);
}
/*里程*/
if(Get_Dis_OdoAndTrip() == 0)
if(KL30_VOLTAGE_time < 10)
{
AMT630H_GUI_ODO(Get_ODO_Value() / 10, Get_Dis_Unit());
KL30_VOLTAGE_time++;
}
else
else
{
AMT630H_GUI_Trip(Get_Trip_Value(), Get_Dis_Unit());
KL30_VOLTAGE_time = 0;
KL30_VOLTAGE_Value = (ADC_Read_Signal(ADC_CH_KL30_VOLTAGE)) / 10;
}
AMT630H_GUI_Voltage(KL30_VOLTAGE_Value);
AMT630H_GUI_ODO(Get_ODO_Value() / 10, 0);
if(VechileSpeed_time < 4)
{
VechileSpeed_time++;
}
else
{
VechileSpeed_time = 0;
VechileSpeed = Get_DispVechileSpeed() / 10;
}
/*车速*/
if (Get_VechileSpeedValid() == 1)
{
AMT630H_GUI_VSpeed(Get_DispVechileSpeed() / 10);
AMT630H_GUI_VSpeed(VechileSpeed);
}
else
{
......
......@@ -332,7 +332,7 @@ void Get_DisTime_Service(void)
{
RTE_RTC_Get_CounterValue(&counter_val);
counter_val.time.RTC_Hours = RTC_Bcd2ToByte(counter_val.time.RTC_Hours);
counter_val.time.RTC_Minutes = RTC_Bcd2ToByte(counter_val.time.RTC_Minutes);
counter_val.time.RTC_Minutes = RTC_Bcd2ToByte(counter_val.time.RTC_Minutes);
}
}
......
......@@ -395,7 +395,7 @@ void Menu_Logic_Operation_Clock_Hour_Tenb_Set(Menu_Key_en_t enKeyType)
if(MENU_KEY_CONFIRM_SHORT == enKeyType)
{
counter_val.time.RTC_Hours = (MenuData.Dis_Hour_Tenb*10 + MenuData.Dis_Hour_Bit);
counter_val.time.RTC_Minutes = (MenuData.Dis_Minute_Tenb*10 + MenuData.Dis_Minute_Bit);
counter_val.time.RTC_Minutes = (MenuData.Dis_Minute_Tenb*10 + MenuData.Dis_Minute_Bit);
RTC_SetTime(&counter_val.time);
}
}
......@@ -457,7 +457,7 @@ void Menu_Logic_Operation_Clock_Min_Bit_Set(Menu_Key_en_t enKeyType)
if(MENU_KEY_CONFIRM_SHORT == enKeyType)
{
counter_val.time.RTC_Hours = (MenuData.Dis_Hour_Tenb*10 + MenuData.Dis_Hour_Bit);
counter_val.time.RTC_Minutes = (MenuData.Dis_Minute_Tenb*10 + MenuData.Dis_Minute_Bit);
counter_val.time.RTC_Minutes = (MenuData.Dis_Minute_Tenb*10 + MenuData.Dis_Minute_Bit);
RTC_SetTime(&counter_val.time);
}
}
......
......@@ -60,7 +60,7 @@ static void Power_KL30_Init(void)
TimerM_PWM_CH_Output_init(TIMERM_COUNTER1, TIMERM_CHB, ActiveLevel_High);
g_stRTCInformation.u8RTCSecond = 0;
g_stRTCInformation.u8RTCMinute = 0;
g_stRTCInformation.u8RTCHour = 8;
g_stRTCInformation.u8RTCHour = 0;
g_stRTCInformation.u8RTCDayOfMonth = 1;
g_stRTCInformation.u8RTCMonth = 1;
g_stRTCInformation.u8RTCYear = 20;
......
......@@ -75,14 +75,12 @@ uint32_t aaa = 0;
void Sys_100ms_Tasks(void)
{
ODOtest = Data_ODO_Read();
Triptest = Data_Read_Trip(0);
S3_ServerCNTT();
Get_DisTime_Service();
Fuel_Cal_Sevice(100u);
Coolant_Cal_Sevice(100u);
Services_Mileage_Callback();
//Data_Mileage_Clear();
// Data_Mileage_Clear();
RTE_GPIO_Config(RTE_GPIO_PORT05_PIN04, GpioOut_High);
//BackLight_Process();
......
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