Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
TianYing_ty100
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
TY
TianYing_ty100
Commits
da3e8754
Commit
da3e8754
authored
May 07, 2024
by
李俭双
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:增加水温表数据处理
parent
c6757124
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
411 additions
and
25 deletions
+411
-25
RTE_Components.h
...semicon/BAT32A239/MDK_ARM/RTE/_HaoJin232/RTE_Components.h
+0
-21
Application.h
Firmware/Source/Application/Application.h
+4
-3
Data_Coolant.c
Firmware/Source/Application/Data_Coolant/Data_Coolant.c
+347
-0
Data_Coolant.h
Firmware/Source/Application/Data_Coolant/Data_Coolant.h
+57
-0
PowerManag_user.c
Firmware/Source/Component/PowerManagement/PowerManag_user.c
+2
-1
Sys_Task_List.c
Firmware/Source/System/Sys_Task_List.c
+1
-0
No files found.
Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/RTE/_HaoJin232/RTE_Components.h
deleted
100644 → 0
View file @
c6757124
/*
* Auto generated Run-Time-Environment Configuration File
* *** Do not modify ! ***
*
* Project: 'HaoJin'
* Target: 'HaoJin232'
*/
#ifndef RTE_COMPONENTS_H
#define RTE_COMPONENTS_H
/*
* Define the Device Header File:
*/
#define CMSIS_device_header "BAT32A239.h"
#endif
/* RTE_COMPONENTS_H */
Firmware/Source/Application/Application.h
View file @
da3e8754
...
...
@@ -14,9 +14,10 @@
#include "CAN_APP\CAN_CH0_CAN_Communication_Matrix.h"
#include "Can_User/Can_User.h"
#include "Can_User/Can_App.h"
#include "Data_Coolant/Data_Coolant.h"
#include "Data_TPMS/Data_TPMS.h"
#include "Data_Voltage/Data_Voltage.h"
#include "FaultCode/FaultCode.h"
#endif
Firmware/Source/Application/Data_Coolant/Data_Coolant.c
0 → 100644
View file @
da3e8754
#include "Data_Coolant\Data_Coolant.h"
#include "Application.h"
DataCoolantTempStruct
DataCoolantTemp
;
DataCoolantTempDisStruct
DataCoolantTemp_Dis
;
void
Data_Coolant_Temp_KL30_Init
(
void
)
{
DataCoolantTemp
.
Value
=
0
;
DataCoolantTemp
.
Valid
=
0
;
DataCoolantTemp_Dis
.
u8_CurSeg
=
0
;
DataCoolantTemp_Dis
.
u8_DestSeg
=
0
;
DataCoolantTemp_Dis
.
u8_UpFlashtimer
=
CoolantFlashtimer
;
DataCoolantTemp_Dis
.
u8_DownFlashtimer
=
CoolantFlashtimer
;
DataCoolantTemp_Dis
.
u8_Warnflg
=
0
;
DataCoolantTemp_Dis
.
u8_Flg
=
0
;
}
void
Data_Coolant_Temp_KL15_Init
(
void
)
{
DataCoolantTemp_Dis
.
u8_CurSeg
=
0
;
DataCoolantTemp_Dis
.
u8_DestSeg
=
0
;
DataCoolantTemp_Dis
.
u8_UpFlashtimer
=
0
;
DataCoolantTemp_Dis
.
u8_DownFlashtimer
=
0
;
DataCoolantTemp_Dis
.
u8_Warnflg
=
0
;
DataCoolantTemp_Dis
.
u8_Flg
=
0
;
}
void
Data_Coolant_Temp_Processing_Service
(
void
)
{
uint16_t
Coolant_Temperature
;
uint8_t
Coolant_Temperature_State
;
uint32_t
Temp
;
uint8_t
i
;
Coolant_Temperature
=
Get_CAN_CH0_ID_101_Sig_ECU_Engine_Temperature
();
Coolant_Temperature_State
=
Get_CAN_CH0_ID_101_Sig_ECU_Engine_Temperature_State
();
if
(
SYS_OPR_STAT_IGN_ON
)
{
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
CAN_CH0_ID_CAN_0x101_Msg_Count
)
==
CAN_SIG_LOST
)
{
DataCoolantTemp
.
Valid
=
0
;
DataCoolantTemp
.
Value
=
0
;
}
else
{
if
(
Coolant_Temperature_State
==
1
)
{
DataCoolantTemp
.
Valid
=
0
;
DataCoolantTemp
.
Value
=
0
;
}
else
{
DataCoolantTemp
.
Valid
=
1
;
if
(
Coolant_Temperature
>=
2730
)
{
Coolant_Temperature
-=
2730
;
}
else
{
Coolant_Temperature
=
0
;
}
if
((
Coolant_Temperature
%
10
)
>=
5
)
{
Coolant_Temperature
+=
5
;
}
if
(
Coolant_Temperature
>
1990
)
{
Coolant_Temperature
=
1990
;
}
DataCoolantTemp
.
Value
=
Coolant_Temperature
/
10
;
}
}
}
else
{
DataCoolantTemp
.
Valid
=
0
;
DataCoolantTemp
.
Value
=
0
;
}
//显示
Data_Coolant_Temp_Display
();
}
void
Data_Coolant_Temp_Display
(
void
)
{
if
(
SYS_OPR_STAT_IGN_ON
)
{
if
(
Common_Get_SelfCheckTime_Finish
()
==
0
)
{
DataCoolantTemp_Dis
.
u8_Uptimer
=
CoolantSelfCheckFlashtimer
;
DataCoolantTemp_Dis
.
u8_Downtimer
=
CoolantSelfCheckFlashtimer
;
if
(
DataCoolantTemp_Dis
.
u8_CurSeg
==
0
)
{
DataCoolantTemp_Dis
.
u8_DestSeg
=
5
;
}
if
(
DataCoolantTemp_Dis
.
u8_CurSeg
==
5
)
{
DataCoolantTemp_Dis
.
u8_DestSeg
=
0
;
}
DataCoolantTemp_Dis
.
u8_Warnflg
=
0
;
DataCoolantTemp_Dis
.
u8_Flg
=
0
;
DataCoolantTemp_Dis
.
Dis_Valid
=
0
;
}
else
{
DataCoolantTemp_Dis
.
u8_Uptimer
=
CoolantFlashtimer
;
DataCoolantTemp_Dis
.
u8_Downtimer
=
CoolantFlashtimer
;
Get_Coolant_Temp_Seg
(
DataCoolantTemp
.
Value
);
if
(
DataCoolantTemp
.
Valid
==
0
)
{
DataCoolantTemp_Dis
.
Dis_Valid
=
0
;
DataCoolantTemp_Dis
.
u8_UpFlashtimer
=
DataCoolantTemp_Dis
.
u8_Uptimer
;
DataCoolantTemp_Dis
.
u8_DownFlashtimer
=
DataCoolantTemp_Dis
.
u8_Downtimer
;
DataCoolantTemp_Dis
.
u8_CurSeg
=
0
;
DataCoolantTemp_Dis
.
u8_DestSeg
=
0
;
DataCoolantTemp_Dis
.
u8_Flg
=
0
;
}
else
{
DataCoolantTemp_Dis
.
Dis_Valid
=
1
;
if
(
DataCoolantTemp_Dis
.
u8_Flg
==
0
)
{
DataCoolantTemp_Dis
.
u8_Flg
=
1
;
DataCoolantTemp_Dis
.
u8_CurSeg
=
DataCoolantTemp_Dis
.
u8_DestSeg
;
DataCoolantTemp_Dis
.
u8_UpFlashtimer
=
DataCoolantTemp_Dis
.
u8_Uptimer
;
DataCoolantTemp_Dis
.
u8_DownFlashtimer
=
DataCoolantTemp_Dis
.
u8_Downtimer
;
}
}
}
if
(
DataCoolantTemp_Dis
.
u8_CurSeg
>
DataCoolantTemp_Dis
.
u8_DestSeg
)
{
DataCoolantTemp_Dis
.
u8_UpFlashtimer
=
0
;
DataCoolantTemp_Dis
.
u8_DownFlashtimer
++
;
if
(
DataCoolantTemp_Dis
.
u8_DownFlashtimer
>=
DataCoolantTemp_Dis
.
u8_Downtimer
)
{
DataCoolantTemp_Dis
.
u8_DownFlashtimer
=
0
;
DataCoolantTemp_Dis
.
u8_CurSeg
--
;
}
}
else
if
(
DataCoolantTemp_Dis
.
u8_CurSeg
<
DataCoolantTemp_Dis
.
u8_DestSeg
)
{
DataCoolantTemp_Dis
.
u8_DownFlashtimer
=
0
;
DataCoolantTemp_Dis
.
u8_UpFlashtimer
++
;
if
(
DataCoolantTemp_Dis
.
u8_UpFlashtimer
>=
DataCoolantTemp_Dis
.
u8_Uptimer
)
{
DataCoolantTemp_Dis
.
u8_UpFlashtimer
=
0
;
DataCoolantTemp_Dis
.
u8_CurSeg
++
;
}
}
//warning
if
(
DataCoolantTemp
.
Valid
==
0
)
{
DataCoolantTemp_Dis
.
u8_Warnflg
=
1
;
}
else
{
if
(
DataCoolantTemp
.
Value
>=
115
)
{
DataCoolantTemp_Dis
.
u8_Warnflg
=
2
;
}
else
if
(
DataCoolantTemp
.
Value
>=
112
)
{
DataCoolantTemp_Dis
.
u8_Warnflg
=
0
;
}
else
{
;
}
}
}
else
{
DataCoolantTemp_Dis
.
Dis_Valid
=
0
;
DataCoolantTemp_Dis
.
u8_UpFlashtimer
=
DataCoolantTemp_Dis
.
u8_Uptimer
;
DataCoolantTemp_Dis
.
u8_DownFlashtimer
=
DataCoolantTemp_Dis
.
u8_Downtimer
;
DataCoolantTemp_Dis
.
u8_Warnflg
=
0
;
DataCoolantTemp_Dis
.
u8_Flg
=
0
;
}
}
void
Get_Coolant_Temp_Seg
(
uint16_t
Temp_Value
)
{
uint8_t
TempSeg
;
uint8_t
CurTempSeg
;
if
(
Temp_Value
<
50
)
{
if
(
DataCoolantTemp_Dis
.
u8_CurSeg
>
1
)
{
DataCoolantTemp_Dis
.
u8_DestSeg
=
1
;
}
else
if
(
DataCoolantTemp_Dis
.
u8_CurSeg
>
0
)
{
if
(
Temp_Value
<=
47
)
{
DataCoolantTemp_Dis
.
u8_DestSeg
=
0
;
}
}
else
{
DataCoolantTemp_Dis
.
u8_DestSeg
=
0
;
}
}
else
if
((
Temp_Value
<
62
)
&&
(
Temp_Value
>=
50
))
{
if
(
DataCoolantTemp_Dis
.
u8_CurSeg
>
2
)
{
DataCoolantTemp_Dis
.
u8_DestSeg
=
2
;
}
else
if
(
DataCoolantTemp_Dis
.
u8_CurSeg
>
1
)
{
if
(
Temp_Value
<=
59
)
{
DataCoolantTemp_Dis
.
u8_DestSeg
=
1
;
}
}
else
{
DataCoolantTemp_Dis
.
u8_DestSeg
=
1
;
}
}
else
if
((
Temp_Value
<
80
)
&&
(
Temp_Value
>=
62
))
{
if
(
DataCoolantTemp_Dis
.
u8_CurSeg
>
3
)
{
DataCoolantTemp_Dis
.
u8_DestSeg
=
3
;
}
else
if
(
DataCoolantTemp_Dis
.
u8_CurSeg
>
2
)
{
if
(
Temp_Value
<=
77
)
{
DataCoolantTemp_Dis
.
u8_DestSeg
=
2
;
}
}
else
{
DataCoolantTemp_Dis
.
u8_DestSeg
=
2
;
}
}
else
if
((
Temp_Value
<
98
)
&&
(
Temp_Value
>=
80
))
{
if
(
DataCoolantTemp_Dis
.
u8_CurSeg
>
4
)
{
DataCoolantTemp_Dis
.
u8_DestSeg
=
4
;
}
else
if
(
DataCoolantTemp_Dis
.
u8_CurSeg
>
3
)
{
if
(
Temp_Value
<=
95
)
{
DataCoolantTemp_Dis
.
u8_DestSeg
=
3
;
}
}
else
{
DataCoolantTemp_Dis
.
u8_DestSeg
=
3
;
}
}
else
if
((
Temp_Value
<
115
)
&&
(
Temp_Value
>=
98
))
{
if
(
DataCoolantTemp_Dis
.
u8_CurSeg
>
4
)
{
if
(
Temp_Value
<=
112
)
{
DataCoolantTemp_Dis
.
u8_DestSeg
=
4
;
}
}
else
{
DataCoolantTemp_Dis
.
u8_DestSeg
=
4
;
}
}
else
{
DataCoolantTemp_Dis
.
u8_DestSeg
=
5
;
}
}
//水温显示格数
uint8_t
GET_DataCoolantTempSegDisp
(
void
)
{
return
DataCoolantTemp_Dis
.
u8_CurSeg
;
}
//水温显示有效标志
uint8_t
GET_DataCollantTempSegValid
(
void
)
{
return
DataCoolantTemp_Dis
.
Dis_Valid
;
}
//水温数显。作为外发使用的时候+40
uint16_t
GET_DataCoolantTempValueDisp
(
void
)
{
return
DataCoolantTemp
.
Value
;
}
uint8_t
GET_DataCollantTempValueValid
(
void
)
{
return
DataCoolantTemp
.
Valid
;
}
//水温灯及显示的报警信号 0:无报警,正常显示 1:掉线或者state无效,白色闪烁 2:高温,红色闪烁
uint8_t
GET_DataCollantTempWarnflg
(
void
)
{
return
DataCoolantTemp_Dis
.
u8_Warnflg
;
}
Firmware/Source/Application/Data_Coolant/Data_Coolant.h
0 → 100644
View file @
da3e8754
#ifndef _DATA_Coolant_H_
#define _DATA_Coolant_H_
#define CoolantFlashtimer 250
#define CoolantSelfCheckFlashtimer 15
/*** 控制结构 ***/
typedef
struct
{
uint8_t
Dis_Valid
;
uint8_t
u8_DestSeg
;
uint8_t
u8_CurSeg
;
uint8_t
u8_UpFlashtimer
;
uint8_t
u8_DownFlashtimer
;
uint8_t
u8_Uptimer
;
uint8_t
u8_Downtimer
;
uint8_t
u8_Flashflg
;
uint8_t
u8_Warnflg
;
uint8_t
u8_Flg
;
}
DataCoolantTempDisStruct
;
extern
DataCoolantTempDisStruct
DataCoolantTemp_Dis
;
typedef
struct
{
uint16_t
Value
;
uint8_t
Valid
;
}
DataCoolantTempStruct
;
//水温数据结构
void
Data_Coolant_Temp_KL30_Init
(
void
);
void
Data_Coolant_Temp_KL15_Init
(
void
);
void
Data_Coolant_Temp_Processing_Service
(
void
);
void
Get_Coolant_Temp_Seg
(
uint16_t
Temp_Value
);
void
Data_Coolant_Temp_Display
(
void
);
uint8_t
GET_DataCollantTempSegValid
(
void
);
uint8_t
GET_DataCoolantTempSegDisp
(
void
);
uint16_t
GET_DataCoolantTempValueDisp
(
void
);
uint8_t
GET_DataCollantTempWarnflg
(
void
);
extern
DataCoolantTempStruct
DataCoolantTemp
;
#endif
Firmware/Source/Component/PowerManagement/PowerManag_user.c
View file @
da3e8754
...
...
@@ -54,6 +54,7 @@ static void Power_KL30_Init(void)
Checkself_Init
();
Data_Vehicle_Speed_KL30_Init
();
Data_Engine_Speed_KL30_Wakeup_Init
();
Data_Coolant_Temp_KL30_Init
();
LINE_IN_Init
();
Key_KL30_Init_EXample
();
Light_Sensor_Init_Example
();
//注意顺序1
...
...
@@ -139,7 +140,7 @@ static void Power_IG_ON_Init(void)
Telltales_KL15_Init
();
Telltales_UserInit
();
Fuel_KL15_Init
();
Data_Coolant_Temp_KL15_Init
();
}
static
void
Power_Sleep_Init
(
void
)
...
...
Firmware/Source/System/Sys_Task_List.c
View file @
da3e8754
...
...
@@ -55,6 +55,7 @@ void Sys_20ms_Tasks(void)
Key_Auto_Save
();
Data_Vehicle_Speed_Processing_Service
();
Data_Engine_Speed_Processing_Service
();
Data_Coolant_Temp_Processing_Service
();
}
void
Sys_50ms_Tasks
(
void
)
...
...
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