Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
haoJin750TFT
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
时昊
haoJin750TFT
Commits
3b42f2ea
Commit
3b42f2ea
authored
Nov 26, 2024
by
张金硕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix:根据天鹰历史问题优化代码,里程服务函数放在100ms中断中调用,大计小计公英制都能显示到最大值
parent
eb9f3b99
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
110 additions
and
47 deletions
+110
-47
Can_User.c
Firmware/Source/Application/Can_User.c
+21
-0
GpioUser.c
Firmware/Source/Application/GpioUser.c
+1
-1
AMT630H_Datas.c
Firmware/Source/Component/AMT630H/AMT630H_Datas.c
+31
-3
Key_user.c
Firmware/Source/Component/Key/Key_user.c
+16
-11
Key_user.h
Firmware/Source/Component/Key/Key_user.h
+1
-1
Line_In_user.c
Firmware/Source/Component/Line_In/Line_In_user.c
+1
-0
Services_Mileage.h
Firmware/Source/Component/Mileage/Services_Mileage.h
+3
-3
Services_Mileage_User.c
Firmware/Source/Component/Mileage/Services_Mileage_User.c
+27
-19
PowerManag_user.c
Firmware/Source/Component/PowerManagement/PowerManag_user.c
+2
-0
RTE_RTC.c
Firmware/Source/Device/Cmsemicon/BAT32A279/RTE/RTC/RTE_RTC.c
+1
-1
Sys_Task_List.c
Firmware/Source/System/Sys_Task_List.c
+4
-4
main.c
Firmware/Source/System/main.c
+2
-4
No files found.
Firmware/Source/Application/Can_User.c
View file @
3b42f2ea
...
...
@@ -36,6 +36,17 @@ void Can_Init(void)
*/
void
Can_RX_Apply_Buff
(
void
)
{
CAN_RecvMsg
.
DLC
=
8
;
CAN_RecvMsg
.
Data
[
0
]
=
0
;
CAN_RecvMsg
.
Data
[
1
]
=
0
;
CAN_RecvMsg
.
Data
[
2
]
=
0
;
CAN_RecvMsg
.
Data
[
3
]
=
0
;
CAN_RecvMsg
.
Data
[
4
]
=
0
;
CAN_RecvMsg
.
Data
[
5
]
=
0
;
CAN_RecvMsg
.
Data
[
6
]
=
0
;
CAN_RecvMsg
.
Data
[
7
]
=
0
;
CAN_RecvMsg
.
OverWriteConfig
=
0
;
CAN_RecvMsg
.
Id
=
0x101
;
CAN_RecvMsg
.
IDE
=
CAN_Id_Standard
;
CAN_RecvMsg
.
CacheType
=
CAN_CacheType_Rx_NoMask
;
...
...
@@ -141,6 +152,16 @@ void Can_Tx_Apply_Buff(void)
// CAN_MessageCache_DeInit(CAN0MSG08);
// CAN_MessageCache_Init(CAN0MSG08, &CAN_SendMsg);
CAN_SendMsg_Diag_Tx
.
Data
[
0
]
=
0
;
CAN_SendMsg_Diag_Tx
.
Data
[
1
]
=
0
;
CAN_SendMsg_Diag_Tx
.
Data
[
2
]
=
0
;
CAN_SendMsg_Diag_Tx
.
Data
[
3
]
=
0
;
CAN_SendMsg_Diag_Tx
.
Data
[
4
]
=
0
;
CAN_SendMsg_Diag_Tx
.
Data
[
5
]
=
0
;
CAN_SendMsg_Diag_Tx
.
Data
[
6
]
=
0
;
CAN_SendMsg_Diag_Tx
.
Data
[
7
]
=
0
;
CAN_SendMsg_Diag_Tx
.
OverWriteConfig
=
0
;
CAN_SendMsg_Diag_Tx
.
Id
=
DIAG_ID_Tx
;
CAN_SendMsg_Diag_Tx
.
IDE
=
CAN_Id_Standard
;
CAN_SendMsg_Diag_Tx
.
CacheType
=
CAN_CacheType_Tx
;
...
...
Firmware/Source/Application/GpioUser.c
View file @
3b42f2ea
...
...
@@ -20,7 +20,7 @@ void Gpio_Init(_GpioUser_Enum InitMode)
RTE_GPIO_Config
(
RTE_GPIO_PORT00_PIN05
,
GpioOut_Low
);
//L_BiasBitSW 里程百位---
RTE_GPIO_Config
(
RTE_GPIO_PORT00_PIN06
,
GpioOut_Low
);
//L_BiasBitSW 里程千位---
RTE_GPIO_Config
(
RTE_GPIO_PORT01_PIN00
,
GpioOut_Low
);
//表盘背光-PWM
RTE_GPIO_Config
(
RTE_GPIO_PORT01_PIN00
,
RTE_GPIO_DIR_IN
);
//表盘背光-PWM
RTE_GPIO_Config
(
RTE_GPIO_PORT01_PIN01
,
GpioOut_Low
);
//RXD-ESP-IN-MCU
RTE_GPIO_Config
(
RTE_GPIO_PORT01_PIN02
,
GpioOut_Low
);
//TXD-ESP-IN-MCU
RTE_GPIO_Config
(
RTE_GPIO_PORT01_PIN03
,
RTE_GPIO_DIR_IN
);
...
...
Firmware/Source/Component/AMT630H/AMT630H_Datas.c
View file @
3b42f2ea
...
...
@@ -4246,7 +4246,21 @@ static void AMT630H_GUI_ODO(uint32_t ODO, uint8_t Uint)
DisplayNumPara
.
NumInterval
=
GROUP_PIC_DIR_LEFT
|
24
;
DisplayNumPara
.
y
=
GROUP_PIC_USE_PSD_Y_POS
;
DisplayNumPara
.
DecimalNum
=
0
;
if
((
ODONumber
<
1000000
)
&&
(
ODONumber
>=
100000
))
if
(
ODONumber
>=
1000000
)
{
ODONumber
=
999999
;
DisplayNumPara
.
x
=
173
;
DisplayNumPara
.
MinDigits
=
6
;
if
(
Uint
==
0
)
{
SetPagePic
(
GRAPHICS_PAGE_0
,
Pic_0580_211_324
);
/*KM*/
}
else
{
SetPagePic
(
GRAPHICS_PAGE_0
,
Pic_0861_211_324
);
/*mile*/
}
}
else
if
((
ODONumber
<
1000000
)
&&
(
ODONumber
>=
100000
))
{
DisplayNumPara
.
x
=
173
;
DisplayNumPara
.
MinDigits
=
6
;
...
...
@@ -4336,13 +4350,27 @@ static void AMT630H_GUI_ODO(uint32_t ODO, uint8_t Uint)
SetPagePic
(
GRAPHICS_PAGE_0
,
Pic_0686_55_296
);
/*ODO图标不动*/
DISPLAY_NUM_ST
DisplayNumPara
;
uint
16
_t
ODONumber
;
uint
32
_t
ODONumber
;
ODONumber
=
ODO
;
DisplayNumPara
.
NumList
=
NumbeList_ODO_NIGHT
;
DisplayNumPara
.
NumInterval
=
GROUP_PIC_DIR_LEFT
|
24
;
DisplayNumPara
.
y
=
GROUP_PIC_USE_PSD_Y_POS
;
DisplayNumPara
.
DecimalNum
=
0
;
if
((
ODONumber
<
1000000
)
&&
(
ODONumber
>=
100000
))
if
(
ODONumber
>=
1000000
)
{
ODONumber
=
999999
;
DisplayNumPara
.
x
=
173
;
DisplayNumPara
.
MinDigits
=
6
;
if
(
Uint
==
0
)
{
SetPagePic
(
GRAPHICS_PAGE_0
,
Pic_0688_211_324
);
/*KM*/
}
else
{
SetPagePic
(
GRAPHICS_PAGE_0
,
Pic_0863_211_324
);
/*mile*/
}
}
else
if
((
ODONumber
<
1000000
)
&&
(
ODONumber
>=
100000
))
{
DisplayNumPara
.
x
=
173
;
DisplayNumPara
.
MinDigits
=
6
;
...
...
Firmware/Source/Component/Key/Key_user.c
View file @
3b42f2ea
...
...
@@ -17,14 +17,16 @@ void Key_Operation_Left(Key_Event_en_t enKeyEvent)//选择
{
case
KEY_EVENT_SHORT_PRESS_1
:
Key_Event_Short_Press_Left
();
Key_Clear_Time
();
break
;
case
KEY_EVENT_SHORT_PRESS_2
:
break
;
case
KEY_EVENT_LONG_PRESS_1
:
//2
if
((
Get_Dis_OdoAndTrip
()
==
1
)
&&
(
Get_ActualVechileSpeed
()
==
0
))
{
Data_Clear_Trip
(
1
);
Data_Clear_Trip
(
0
);
}
Key_Clear_Time
();
break
;
case
KEY_EVENT_LONG_PRESS_2
:
//3
break
;
...
...
@@ -63,11 +65,13 @@ void Key_Operation_Right(Key_Event_en_t enKeyEvent)//确认
RTC_SetTime
(
&
counter_val
.
time
);
}
Key_Event_Short_Press_Right
();
Key_Clear_Time
();
break
;
case
KEY_EVENT_SHORT_PRESS_2
:
break
;
case
KEY_EVENT_LONG_PRESS_1
:
//2s
Key_Event_SHORT_PRESS_2_Right
();
Key_Event_LONG_PRESS_1_Right
();
Key_Clear_Time
();
break
;
case
KEY_EVENT_LONG_PRESS_2
:
//3s
break
;
...
...
@@ -76,6 +80,7 @@ void Key_Operation_Right(Key_Event_en_t enKeyEvent)//确认
case
KEY_EVENT_LONG_PRESS_4
:
//10s
TYW_RESET_ODO
();
Get_Into_OTA_Update_Mode
();
Key_Clear_Time
();
break
;
case
KEY_EVENT_OFF_TO_ON
:
break
;
...
...
@@ -340,7 +345,7 @@ void Key_Event_Short_Press_Right(void)//确认
}
}
void
Key_Event_
SHORT_PRESS_2
_Right
(
void
)
void
Key_Event_
LONG_PRESS_1
_Right
(
void
)
{
if
((
Get_DispVechileSpeed
()
>=
1990
)
&&
(
Get_DispEngineSpeed
()
>=
12000
))
{
...
...
@@ -448,18 +453,18 @@ void KEY_RIGHT_EVENT_NONE_Service(void)
void
Key_Clear_Time
(
void
)
{
if
(
Key_Status_Read_Left
()
==
KEY_REALTIME_PRESS
)
{
//
if(Key_Status_Read_Left() == KEY_REALTIME_PRESS)
//
{
MenuData
.
Back_Time_Left
=
0
;
MenuData
.
Back_Time_Left_Flag
=
0
;
MenuData
.
Back_Time_Right_Flag
=
0
;
}
if
(
Key_Status_Read_Right
()
==
KEY_REALTIME_PRESS
)
{
//
MenuData.Back_Time_Left_Flag = 0;
//
MenuData.Back_Time_Right_Flag = 0;
//
}
//
if(Key_Status_Read_Right() == KEY_REALTIME_PRESS)
//
{
MenuData
.
Back_Time_Right
=
0
;
MenuData
.
Back_Time_Left_Flag
=
0
;
MenuData
.
Back_Time_Right_Flag
=
0
;
}
//
}
}
uint8_t
ClearODO_Flag
=
0
;
...
...
Firmware/Source/Component/Key/Key_user.h
View file @
3b42f2ea
...
...
@@ -62,7 +62,7 @@ Key_Status_en_t Key_Status_Read_Left(void);
Key_Status_en_t
Key_Status_Read_Right
(
void
);
void
Key_Event_Short_Press_Left
(
void
);
void
Key_Event_Short_Press_Right
(
void
);
void
Key_Event_
SHORT_PRESS_2
_Right
(
void
);
void
Key_Event_
LONG_PRESS_1
_Right
(
void
);
void
Key_Event_BackLight_Press_Left
(
void
);
void
Get_Into_OTA_Update_Mode
(
void
);
void
KEY_RIGHT_EVENT_NONE_Service
(
void
);
...
...
Firmware/Source/Component/Line_In/Line_In_user.c
View file @
3b42f2ea
...
...
@@ -133,5 +133,6 @@ static Linelib_uint16_t LINE_GET_PWR(void)
void
LINE_IN_Init
(
void
)
{
memset
(
LINE_IN_Men
,
0
,
sizeof
(
LINE_IN_Men
));
Line_In_KL30_WakeUp_Init
(
LINE_IN_Men
,
g_stLineInAttribute
,
LINE_IN_MAX
,
LINE_GET_PWR
);
}
Firmware/Source/Component/Mileage/Services_Mileage.h
View file @
3b42f2ea
...
...
@@ -37,9 +37,9 @@ Platform_16Bit
typedef
enum
{
EM_TRIP_A
,
EM_TRIP_B
,
EM_TRIP_C
,
EM_TRIP_D
,
//
EM_TRIP_B,
//
EM_TRIP_C,
//
EM_TRIP_D,
EM_TRIP_MAX
,
}
DataTripEnum_t
;
...
...
Firmware/Source/Component/Mileage/Services_Mileage_User.c
View file @
3b42f2ea
...
...
@@ -67,7 +67,7 @@ void Data_User_Mileage_KL30Init(void)
{
ODOInit
.
Stamp
=
TempBuf
[
1
];
}
if
(
TempBuf
[
1
]
==
0xFFFFFFFF
)
if
(
TempBuf
[
2
]
==
0xFFFFFFFF
)
{
ODOInit
.
Offset
=
0
;
}
...
...
@@ -75,10 +75,10 @@ void Data_User_Mileage_KL30Init(void)
{
ODOInit
.
Offset
=
TempBuf
[
2
];
}
ODOInit
.
MaxValue
=
99
99999
;
ODOInit
.
MaxValue
=
160
99999
;
Data_ODO_KL30_Init
(
DataODOBuf
,
&
ODOInit
,
Func
.
EEPromWrite_Cbk
);
(
void
)
Data_User_EEPROM_Read
(
EM_TRIP_BLOCK
,
TempBuf
+
3
,
8
);
(
void
)
Data_User_EEPROM_Read
(
EM_TRIP_BLOCK
,
TempBuf
+
3
,
2
);
if
(
TempBuf
[
3
]
==
0XFFFFFFFF
)
{
TripInit
[
EM_TRIP_A
].
Stamp
=
0
;
...
...
@@ -87,21 +87,29 @@ void Data_User_Mileage_KL30Init(void)
{
TripInit
[
EM_TRIP_A
].
Stamp
=
TempBuf
[
3
];
}
TripInit
[
EM_TRIP_A
].
Offset
=
TempBuf
[
4
];
TripInit
[
EM_TRIP_A
].
MaxValue
=
99999
;
/* 最大999.9Mile 进行复位 */
if
(
TempBuf
[
4
]
==
0XFFFFFFFF
)
{
TripInit
[
EM_TRIP_A
].
Offset
=
0
;
}
else
{
TripInit
[
EM_TRIP_A
].
Offset
=
TempBuf
[
4
];
}
// TripInit[EM_TRIP_A].Offset = TempBuf[4];
TripInit
[
EM_TRIP_A
].
MaxValue
=
16100
;
/* 最大999.9Mile 进行复位 */
TripInit
[
EM_TRIP_A
].
IsRestart
=
1u
;
TripInit
[
EM_TRIP_B
].
Stamp
=
0xFFFFFFFFu
;
TripInit
[
EM_TRIP_B
].
MaxValue
=
99999
;
TripInit
[
EM_TRIP_B
].
IsRestart
=
1u
;
//
TripInit[EM_TRIP_B].Stamp = 0xFFFFFFFFu;
//
TripInit[EM_TRIP_B].MaxValue = 99999;
//
TripInit[EM_TRIP_B].IsRestart = 1u;
TripInit
[
EM_TRIP_C
].
Stamp
=
0xFFFFFFFFu
;
TripInit
[
EM_TRIP_C
].
MaxValue
=
99999
;
TripInit
[
EM_TRIP_C
].
IsRestart
=
1u
;
//
TripInit[EM_TRIP_C].Stamp = 0xFFFFFFFFu;
//
TripInit[EM_TRIP_C].MaxValue = 99999;
//
TripInit[EM_TRIP_C].IsRestart = 1u;
TripInit
[
EM_TRIP_D
].
Stamp
=
0xFFFFFFFFu
;
TripInit
[
EM_TRIP_D
].
MaxValue
=
99999
;
TripInit
[
EM_TRIP_D
].
IsRestart
=
1u
;
//
TripInit[EM_TRIP_D].Stamp = 0xFFFFFFFFu;
//
TripInit[EM_TRIP_D].MaxValue = 99999;
//
TripInit[EM_TRIP_D].IsRestart = 1u;
Data_Trip_KL30_Init
(
DataTripBuf
,
TripInit
,
EM_TRIP_MAX
,
Func
.
EEPromWrite_Cbk
);
}
...
...
@@ -181,7 +189,7 @@ static void Data_User_EEPROM_Write(Data_EEPROM_Enum_t BlockID, uint32_t u32Data[
void
Services_Mileage_Callback
(
void
)
{
Data_Mileage_ISR
();
//
Data_Mileage_ISR();
Data_ODO_Processing
();
Data_Trip_Processing
();
Trip_Clear_Km_Service
();
...
...
@@ -218,15 +226,15 @@ uint32_t Get_Trip_Value(void)
uint32_t
Trip
=
0
;
if
(
Get_Dis_Unit
()
==
0
)
/* 公制 */
{
Trip
=
Data_Read_Trip
(
EM_TRIP_
B
);
Trip
=
Data_Read_Trip
(
EM_TRIP_
A
);
}
else
if
(
Get_Dis_Unit
()
==
1
)
/* 英制 */
{
Trip
=
Data_Km_To_Mile
(
Data_Read_Trip
(
EM_TRIP_
B
));
Trip
=
Data_Km_To_Mile
(
Data_Read_Trip
(
EM_TRIP_
A
));
}
else
/* 无效值,按照公里处理,理论上不会执行到这 */
{
Trip
=
Data_Read_Trip
(
EM_TRIP_
B
);
Trip
=
Data_Read_Trip
(
EM_TRIP_
A
);
}
return
Trip
;
}
...
...
@@ -239,7 +247,7 @@ void Trip_Clear_Km_Service(void)
{
if
(
Get_Dis_Unit
()
==
0
)
/* 公制 */
{
if
(
Data_Read_Trip
(
EM_TRIP_
B
)
>
9999
)
/* 当前单位在KM时,里程大于999.9KM进行清零 */
if
(
Data_Read_Trip
(
EM_TRIP_
A
)
>
9999
)
/* 当前单位在KM时,里程大于999.9KM进行清零 */
{
Data_Clear_Trip_All
();
}
...
...
Firmware/Source/Component/PowerManagement/PowerManag_user.c
View file @
3b42f2ea
...
...
@@ -38,6 +38,8 @@ void PwrMemInit(void)
static
void
Power_KL30_Init
(
void
)
{
// ClearODO_Flag = 0;
RTE_GPIO_Init
();
Gpio_Init
(
Gpio_KL30_Init
);
UART_Channel_Config_st_t
loc_config
;
eeprom_StoreInfo_Init
();
loc_config
.
u32UARTChEn
=
1U
;
...
...
Firmware/Source/Device/Cmsemicon/BAT32A279/RTE/RTC/RTE_RTC.c
View file @
3b42f2ea
...
...
@@ -160,7 +160,7 @@ void RTE_RTC_Init(RTC_Information_st_t g_stRTCInformation)
RTC_InitStructure
.
RTC_1HZ_Output
=
DISABLE
;
//RTC1HZ diable output
RTC_Init
(
&
RTC_InitStructure
);
ISR_Register
(
RTC_IRQn
,
rtc_interrupt
);
//RTC????��????��??��??��
//
ISR_Register(RTC_IRQn, rtc_interrupt); //RTC????��????��??��??��
RTE_RTC_Start
();
...
...
Firmware/Source/System/Sys_Task_List.c
View file @
3b42f2ea
...
...
@@ -23,12 +23,12 @@ void Sys_2ms_Tasks(void)
Check_MCU_Info_in_630H
();
DoCAN_Timer_Update
(
2000u
);
//Can_Write_Fun(&CAN_CH0_CanMsgTxOp, 2000u);无外发
CanMSg_XMS_Analysis
(
&
CAN_CH0_CanMsgOp
,
2u
);
}
void
Sys_5ms_Tasks
(
void
)
{
Flash_Sync_Signal_Generation_Service
();
CanMSg_XMS_Analysis
(
&
CAN_CH0_CanMsgOp
,
5u
);
}
void
Sys_10ms_Tasks
(
void
)
...
...
@@ -38,7 +38,7 @@ void Sys_10ms_Tasks(void)
Line_In_Debounce_Service
(
10u
);
My_Key_Service
();
Data_Mileage_Write_EEPROM
();
Key_Clear_Time
();
//
Key_Clear_Time();
Key_TimeOut_Service
();
Fuel_R_Cal
(
10u
);
Oil_R_Cal
(
10u
);
...
...
@@ -80,7 +80,7 @@ void Sys_100ms_Tasks(void)
S3_ServerCNTT
();
Get_DisTime_Service
();
Fuel_Cal_Sevice
(
100u
);
//
Services_Mileage_Callback();
Services_Mileage_Callback
();
// Data_Mileage_Clear();
// RTE_GPIO_Config(RTE_GPIO_PORT05_PIN04, GpioOut_High);
//BackLight_Process();
...
...
@@ -112,6 +112,6 @@ void Sys_Exact_50us_Tasks(void)
if
(
task_100ms
>=
2000U
)
{
task_100ms
=
0U
;
Services_Mileage_Callback
();
Data_Mileage_ISR
();
}
}
\ No newline at end of file
Firmware/Source/System/main.c
View file @
3b42f2ea
...
...
@@ -65,10 +65,6 @@ void Sys_Startup_Pre_Init(void)
void
Sys_Startup_Init
(
void
)
{
uint8_t
u8StartupMode
=
0U
;
RTE_WDT_Enable
();
GenDelay_Init
(
RTE_WDT_Clear
);
RTE_GPIO_Init
();
Gpio_Init
(
Gpio_KL30_Init
);
Gen_TimeDelay
(
10000u
,
50u
);
PwrMemInit
(
);
Power_Management_Init
(
u8StartupMode
);
...
...
@@ -80,6 +76,8 @@ void Sys_Startup_Init(void)
int
main
(
void
)
{
Sys_Startup_Pre_Init
();
RTE_WDT_Enable
();
GenDelay_Init
(
RTE_WDT_Clear
);
Sys_Scheduler_Init
();
Sys_Startup_Init
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment