Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
V
VC66_7C
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
ISUZU
VC66_7C
Commits
7c419289
Commit
7c419289
authored
Oct 27, 2021
by
hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加气压表配置功能
parent
e6df2277
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22331 additions
and
22314 deletions
+22331
-22314
project
ghs/project
+0
-0
project.hex
ghs/project.hex
+22076
-22069
project.siz
ghs/project.siz
+1
-1
Data_AirPressure.c
source/Application/APP/Data_AirPressure/Data_AirPressure.c
+30
-17
Data_Fuel_User.c
source/Application/APP/Data_Fuel/Data_Fuel_User.c
+115
-130
GaugesInterface.c
source/Application/APP/GaugesMode/GaugesInterface.c
+109
-97
No files found.
ghs/project
View file @
7c419289
No preview for this file type
ghs/project.hex
View file @
7c419289
This source diff could not be displayed because it is too large. You can
view the blob
instead.
ghs/project.siz
View file @
7c419289
project .intvect 1536
project .text 297
64
4
project .text 297
88
4
project .rodata 412311
project .secinfo 120
project .syscall 6
...
...
source/Application/APP/Data_AirPressure/Data_AirPressure.c
View file @
7c419289
...
...
@@ -4,9 +4,8 @@
#include "CAN_Communication_Matrix.h"
#include "RTE_ADC.h"
//-------------------------------------------
//主负气压 数据处理 wangboyu
//-------------------------------------------
#include "Common_Interface.h"
//断码显示
//-------------------------------------------
//344 - 3.1.2.FRONT/REAR空气计显示
...
...
@@ -256,8 +255,22 @@ void AirPressure_AdcData_Filter(void)
uint16_t
PriVoltage
=
0
;
uint16_t
SecVoltage
=
0
;
if
((
K_Line_Set
.
K_Line_LID42
==
0x00
)
||
(
K_Line_Set
.
K_Line_LID42
==
0x02
))
{
u8PriValid
=
RTE_Read_PRIMARY_AIR_Valid
();
u8SecValid
=
RTE_Read_SECONDARY_AIR_Valid
();
}
else
if
((
K_Line_Set
.
K_Line_LID42
==
0x01
)
||
(
K_Line_Set
.
K_Line_LID42
==
0x03
))
{
u8PriValid
=
RTE_Read_SECONDARY_AIR_Valid
();
u8SecValid
=
RTE_Read_PRIMARY_AIR_Valid
();
}
else
/*配置无效时*/
{
u8PriValid
=
RTE_Read_PRIMARY_AIR_Valid
();
u8SecValid
=
RTE_Read_SECONDARY_AIR_Valid
();
}
if
(
u8PriValid
)
{
if
(
AirPressureFilter
[
PRI_ID
].
SumCnt
<
10
)
...
...
source/Application/APP/Data_Fuel/Data_Fuel_User.c
View file @
7c419289
...
...
@@ -7,7 +7,7 @@
//-------------------------------------------
//燃油 数据处理 wangboyu 2021-8-31 15:19:14
//-------------------------------------------
//342 - 4.2.燃油表
//
342 - 4.2.燃油表
//-------------------------------------------
/*----------------------------------------------------------------------------------------------------------------------
...
...
@@ -24,7 +24,7 @@ step 0 17 27 38 47 55 64 70 76 81 84 88
*-----------------------------------------------------------------------------------------------------------------------*/
static
uint8_t
Fuel_CurSeg
=
0
;
static
uint8_t
Fuel_CurSeg
=
0
;
/*-------------------------------------------------------------------------
* Function Name : Fuel_User_KL30_Init
...
...
@@ -36,8 +36,8 @@ static uint8_t Fuel_CurSeg = 0 ;
--------------------------------------------------------------------------*/
void
Fuel_User_KL30_Init
(
void
)
{
FuelStruct
FuelInitPara
;
AFC_INIT
AFCInit
;
FuelStruct
FuelInitPara
;
AFC_INIT
AFCInit
;
uint32_t
ODO_Value
=
0u
;
ODO_Value
=
Data_ODO_Read
();
...
...
@@ -45,21 +45,21 @@ void Fuel_User_KL30_Init(void)
FuelInitPara
.
FuelShortCircuitR
=
FUEL_R_MIN_VAL
;
FuelInitPara
.
FuelOpenCircuitR
=
FUEL_R_MAX_VAL
;
FuelInitPara
.
DisplayZoneBoundary
[
0
]
=
DISPLAY_BOUNDARY_ES
;
//
1500
FuelInitPara
.
DisplayZoneBoundary
[
1
]
=
DISPLAY_BOUNDARY_1
;
//
1500
FuelInitPara
.
DisplayZoneBoundary
[
2
]
=
DISPLAY_BOUNDARY_2
;
//
1373
FuelInitPara
.
DisplayZoneBoundary
[
3
]
=
DISPLAY_BOUNDARY_3
;
//
1191
FuelInitPara
.
DisplayZoneBoundary
[
4
]
=
DISPLAY_BOUNDARY_4
;
//
1009
FuelInitPara
.
DisplayZoneBoundary
[
5
]
=
DISPLAY_BOUNDARY_5
;
// 848
FuelInitPara
.
DisplayZoneBoundary
[
6
]
=
DISPLAY_BOUNDARY_6
;
// 697
FuelInitPara
.
DisplayZoneBoundary
[
7
]
=
DISPLAY_BOUNDARY_7
;
// 545
FuelInitPara
.
DisplayZoneBoundary
[
8
]
=
DISPLAY_BOUNDARY_8
;
// 436
FuelInitPara
.
DisplayZoneBoundary
[
9
]
=
DISPLAY_BOUNDARY_9
;
// 345
FuelInitPara
.
DisplayZoneBoundary
[
10
]
=
DISPLAY_BOUNDARY_10
;
// 254
FuelInitPara
.
DisplayZoneBoundary
[
11
]
=
DISPLAY_BOUNDARY_11
;
// 188
FuelInitPara
.
DisplayZoneBoundary
[
12
]
=
DISPLAY_BOUNDARY_12
;
// 132
FuelInitPara
.
DisplayZoneBoundary
[
13
]
=
DISPLAY_BOUNDARY_13
;
// 40
FuelInitPara
.
DisplayZoneBoundary
[
14
]
=
DISPLAY_BOUNDARY_FS
;
// 30
FuelInitPara
.
DisplayZoneBoundary
[
0
]
=
DISPLAY_BOUNDARY_ES
;
//
1500
FuelInitPara
.
DisplayZoneBoundary
[
1
]
=
DISPLAY_BOUNDARY_1
;
//
1500
FuelInitPara
.
DisplayZoneBoundary
[
2
]
=
DISPLAY_BOUNDARY_2
;
//
1373
FuelInitPara
.
DisplayZoneBoundary
[
3
]
=
DISPLAY_BOUNDARY_3
;
//
1191
FuelInitPara
.
DisplayZoneBoundary
[
4
]
=
DISPLAY_BOUNDARY_4
;
//
1009
FuelInitPara
.
DisplayZoneBoundary
[
5
]
=
DISPLAY_BOUNDARY_5
;
// 848
FuelInitPara
.
DisplayZoneBoundary
[
6
]
=
DISPLAY_BOUNDARY_6
;
// 697
FuelInitPara
.
DisplayZoneBoundary
[
7
]
=
DISPLAY_BOUNDARY_7
;
// 545
FuelInitPara
.
DisplayZoneBoundary
[
8
]
=
DISPLAY_BOUNDARY_8
;
// 436
FuelInitPara
.
DisplayZoneBoundary
[
9
]
=
DISPLAY_BOUNDARY_9
;
// 345
FuelInitPara
.
DisplayZoneBoundary
[
10
]
=
DISPLAY_BOUNDARY_10
;
// 254
FuelInitPara
.
DisplayZoneBoundary
[
11
]
=
DISPLAY_BOUNDARY_11
;
// 188
FuelInitPara
.
DisplayZoneBoundary
[
12
]
=
DISPLAY_BOUNDARY_12
;
// 132
FuelInitPara
.
DisplayZoneBoundary
[
13
]
=
DISPLAY_BOUNDARY_13
;
// 40
FuelInitPara
.
DisplayZoneBoundary
[
14
]
=
DISPLAY_BOUNDARY_FS
;
// 30
AFCInit
.
CalcAFCMaxNum
=
100
;
/*50公里或者100公里已更新*/
AFCInit
.
AFCMin
=
30
;
/*油耗最小值十倍*/
...
...
@@ -82,20 +82,16 @@ void Fuel_User_KL30_Init(void)
}
void
Fuel_User_KL15_ON_Init
(
void
)
{
}
void
Fuel_User_KL15_OFF_Init
(
void
)
{
}
void
Fuel_User_Wakeup_Init
(
void
)
{
}
void
Fuel_User_Sleep_Init
(
void
)
{
}
/*-------------------------------------------------------------------------
* Function Name : Fuel_User_KL15_ON_Processing_Service
...
...
@@ -105,40 +101,35 @@ void Fuel_User_Sleep_Init(void)
* Return : None
* onther : 10Ms调用
--------------------------------------------------------------------------*/
static
uint16_t
wbyTestR
=
0
;
static
uint8_t
wbyTestStep
=
0
;
static
uint8_t
Fuel_CyrStep
=
0u
;
void
Fuel_User_KL15_ON_Processing_Service
(
void
)
{
AFC_PARA
AFCPara
;
uint8_t
FuelR_Valid
=
0
;
uint16_t
FuelR
=
0
;
uint8_t
Vspeed_Valid
=
0
;
uint16_t
Vspeed
=
0
;
uint8_t
Espeed_Valid
=
0
;
uint16_t
Espeed
=
0
;
uint8_t
FuelMode
=
0
;
uint8_t
Step
=
0
;
AFC_PARA
AFCPara
;
uint8_t
FuelR_Valid
=
0u
;
uint8_t
Vspeed_Valid
=
0u
;
uint8_t
Espeed_Valid
=
0u
;
uint8_t
FuelMode
=
0u
;
uint8_t
Step
=
0u
;
uint16_t
FuelR
=
0u
;
uint16_t
Vspeed
=
0u
;
uint16_t
Espeed
=
0u
;
uint16_t
FuelResistanceV
=
0u
;
uint32_t
ODO_Value
=
0u
;
// In ---> Lib
// In ---> Lib
FuelR_Valid
=
RTE_Read_FUEL_R_Valid
();
Vspeed_Valid
=
Common_Get_Act_V_Speed_Valid
();
Espeed_Valid
=
Common_Get_Act_E_Speed_Valid
();
if
(
Common_Get_IG_Sts_Valid
()
==
COMMON_Valid
)
{
if
(
Common_Get_IG_Sts
()
==
COMMON_POWER_ON
)
if
((
Common_Get_IG_Sts
()
==
COMMON_POWER_ON
)
&&
(
Common_Get_IG_Sts_Valid
()
==
COMMON_Valid
))
{
if
(
FuelR_Valid
)
{
FuelR
=
RTE_Read_FUEL_R
();
//FuelR = wbyTestR ;
}
else
{
FuelR
=
0
;
FuelR
=
0
;
}
if
(
Vspeed_Valid
)
...
...
@@ -147,7 +138,7 @@ void Fuel_User_KL15_ON_Processing_Service(void)
}
else
{
Vspeed
=
0
;
Vspeed
=
0
;
}
if
(
Espeed_Valid
)
...
...
@@ -156,7 +147,7 @@ void Fuel_User_KL15_ON_Processing_Service(void)
}
else
{
Espeed
=
0
;
Espeed
=
0
;
}
SetPowerSt
(
1
);
...
...
@@ -165,27 +156,27 @@ void Fuel_User_KL15_ON_Processing_Service(void)
ODO_Value
=
Data_ODO_Read
();
AFCPara
.
CurODO
=
ODO_Value
*
100
;
// m
AFCPara
.
FuleConsume
=
0
;
AFCPara
.
FuleConsume
=
0
;
AFCPara
.
RPM
=
Espeed
;
// 1
AFCPara
.
Speed
=
(
Vspeed
*
10
);
// 0.1
AFCPara
.
Speed
=
(
Vspeed
*
10
);
// 0.1
SetAFCPara
(
&
AFCPara
);
FuelFSM
(
FuelR
);
}
}
SetAFCPara
((
AFC_PARA
*
)
&
AFCPara
);
FuelFSM
(
FuelR
);
/*新版增加系数*/
FuelResistanceV
=
GetFuelResistance
();
//燃油电阻获取
// Lib ---> Out
FuelMode
=
GetFuelSensorState
();
/*燃油状态获取*/
Step
=
GetFuelStep
();
wbyTestStep
=
GetFuelStep
();
if
(
FuelMode
==
FuelSensorNormal
)
{
Fuel_CurSeg
=
Step
;
Fuel_CurSeg
=
(
uint16_t
)
GetFuelSeg
();
/*段*/
Fuel_CyrStep
=
(
uint16_t
)
GetFuelStep
();
/*步*/
}
else
{
Fuel_CurSeg
=
0
;
Fuel_CurSeg
=
0u
;
Fuel_CyrStep
=
0u
;
}
}
}
/*-------------------------------------------------------------------------
...
...
@@ -199,8 +190,8 @@ void Fuel_User_KL15_ON_Processing_Service(void)
void
Fuel_User_KL15_OFF_Processing_Service
(
void
)
{
uint8_t
i
;
uint8_t
FuelR_Valid
=
0
;
uint16_t
FuelR
=
0
;
uint8_t
FuelR_Valid
=
0
;
uint16_t
FuelR
=
0
;
FuelR_Valid
=
RTE_Read_FUEL_R_Valid
();
FuelR
=
RTE_Read_FUEL_R
();
...
...
@@ -217,8 +208,6 @@ void Fuel_User_KL15_OFF_Processing_Service(void)
FuelFSM
(
FuelR
);
}
}
}
/*-------------------------------------------------------------------------
...
...
@@ -231,7 +220,7 @@ void Fuel_User_KL15_OFF_Processing_Service(void)
--------------------------------------------------------------------------*/
uint8_t
Fuel_Get_CurSeg
(
void
)
{
return
Fuel_CurSeg
;
return
Fuel_CurSeg
;
}
/*-------------------------------------------------------------------------
* Function Name : Fuel_Get_Percent
...
...
@@ -243,27 +232,26 @@ uint8_t Fuel_Get_CurSeg(void)
--------------------------------------------------------------------------*/
uint8_t
Fuel_Get_Percent
(
void
)
{
uint16_t
Percent
=
0
;
uint8_t
Step
=
0
;
uint16_t
Percent
=
0
;
uint8_t
Step
=
0
;
Step
=
GetFuelStep
();
if
(
Step
<=
10
)
{
Percent
=
0
;
Percent
=
0
;
}
else
if
(
Step
>=
90
)
{
Percent
=
100
;
Percent
=
100
;
}
else
{
Step
-=
10
;
Percent
=
Step
;
Percent
*=
100
;
//放大100倍
Percent
/=
80
;
// 90 - 10
Step
-=
10
;
Percent
=
Step
;
Percent
*=
100
;
//放大100倍
Percent
/=
80
;
// 90 - 10
}
return
Percent
;
return
Percent
;
}
uint16_t
Fuel_Get_Res
(
void
)
...
...
@@ -277,11 +265,11 @@ uint16_t Fuel_Get_Step(void)
uint8_t
Fuel_Get_LowAlarm
(
void
)
{
uint8_t
u8Result
=
0
;
uint8_t
FuelMode
=
0
;
uint8_t
Step
=
0
;
uint8_t
FuelR_Valid
=
0
;
uint16_t
FuelR
=
0
;
uint8_t
u8Result
=
0
;
uint8_t
FuelMode
=
0
;
uint8_t
Step
=
0
;
uint8_t
FuelR_Valid
=
0
;
uint16_t
FuelR
=
0
;
FuelR_Valid
=
RTE_Read_FUEL_R_Valid
();
FuelMode
=
GetFuelSensorState
();
...
...
@@ -294,29 +282,26 @@ uint8_t Fuel_Get_LowAlarm(void)
if
(
FuelMode
==
FuelSensorNormal
)
{
if
(
FuelR
>
30
&&
FuelR
<
3000
)
if
(
FuelR
>
30
&&
FuelR
<
3000
)
{
if
(
Step
<
20
)
{
u8Result
=
1
;
u8Result
=
1
;
}
else
{
u8Result
=
0
;
u8Result
=
0
;
}
}
else
{
u8Result
=
0
;
u8Result
=
0
;
}
}
else
{
u8Result
=
0
;
u8Result
=
0
;
}
return
u8Result
;
return
u8Result
;
}
source/Application/APP/GaugesMode/GaugesInterface.c
View file @
7c419289
#include "GaugesInterface.h"
#include "Menu.h"
/**@struct _GaugesInfoInit
*this is _GaugesInfoInit
*/
*this is _GaugesInfoInit
*/
#include "Common_Interface.h"
static
const
uint16_t
GaugesDataInInit
[
GaugesTotal
][
3
][
25
]
=
{
/*车速*/
{
{
0
,
200
,
400
,
600
,
800
,
1000
,
1200
,
1400
,
1600
,
1800
,
2000
,
2250
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
},
{
{
0
,
200
,
400
,
600
,
800
,
1000
,
1200
,
1400
,
1600
,
1800
,
2000
,
2250
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
},
{
0
,
200
,
400
,
600
,
800
,
1000
,
1200
,
1400
,
1600
,
1800
,
2000
,
2250
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
},
{
0
,
5
,
9
,
13
,
17
,
21
,
25
,
30
,
35
,
40
,
45
,
50
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
}
{
0
,
5
,
9
,
13
,
17
,
21
,
25
,
30
,
35
,
40
,
45
,
50
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
}
},
/*转速*/
{
{
0u
,
1000
,
1500
,
2000
,
2500
,
3000
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
},
{
0u
,
1000
,
1500
,
2000
,
2500
,
3000
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
},
{
0u
,
6
,
11
,
16
,
21
,
27
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
}
{
0u
,
6
,
11
,
16
,
21
,
27
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
}
},
/*水温*/
{
{
0
,
50
,
55
,
61
,
66
,
72
,
77
,
102
,
104
,
106
,
108
,
110
,
111
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
},
{
49
,
54
,
60
,
65
,
71
,
76
,
101
,
103
,
105
,
107
,
109
,
110
,
210
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
},
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
}
{
{
0
,
50
,
55
,
61
,
66
,
72
,
77
,
102
,
104
,
106
,
108
,
110
,
111
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
},
{
49
,
54
,
60
,
65
,
71
,
76
,
101
,
103
,
105
,
107
,
109
,
110
,
210
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
},
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
}
},
/*PRI气压*/
{
{
0
,
500
,
720
,
940
,
1160
,
1380
,
1600
,
1820
,
2040
,
2260
,
2480
,
2700
,
2920
,
3140
,
3360
,
3580
,
3800
,
4020
,
4240
,
4500
,
0
,
0
,
0
,
0
,
0
},
{
0
,
610
,
830
,
1050
,
1270
,
1490
,
1710
,
1930
,
2150
,
2370
,
2590
,
2810
,
3030
,
3250
,
3470
,
3690
,
3910
,
4130
,
4350
,
4500
,
0
,
0
,
0
,
0
,
0
},
{
0
,
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
0
,
0
,
0
,
0
,
0
}
{
{
500
,
720
,
940
,
1160
,
1380
,
1600
,
1820
,
2040
,
2260
,
2480
,
2700
,
2920
,
3140
,
3360
,
3580
,
3800
,
4020
,
4240
,
4500
,
0
,
0
,
0
,
0
,
0
},
{
610
,
830
,
1050
,
1270
,
1490
,
1710
,
1930
,
2150
,
2370
,
2590
,
2810
,
3030
,
3250
,
3470
,
3690
,
3910
,
4130
,
4350
,
4500
,
0
,
0
,
0
,
0
,
0
},
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
0
,
0
,
0
,
0
,
0
}
},
/*SEC气压*/
{
{
0
,
500
,
720
,
940
,
1160
,
1380
,
1600
,
1820
,
2040
,
2260
,
2480
,
2700
,
2920
,
3140
,
3360
,
3580
,
3800
,
4020
,
4240
,
4500
,
0
,
0
,
0
,
0
,
0
},
{
0
,
610
,
830
,
1050
,
1270
,
1490
,
1710
,
1930
,
2150
,
2370
,
2590
,
2810
,
3030
,
3250
,
3470
,
3690
,
3910
,
4130
,
4350
,
4500
,
0
,
0
,
0
,
0
,
0
},
{
0
,
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
0
,
0
,
0
,
0
,
0
}
{
{
500
,
720
,
940
,
1160
,
1380
,
1600
,
1820
,
2040
,
2260
,
2480
,
2700
,
2920
,
3140
,
3360
,
3580
,
3800
,
4020
,
4240
,
4500
,
0
,
0
,
0
,
0
,
0
},
{
610
,
830
,
1050
,
1270
,
1490
,
1710
,
1930
,
2150
,
2370
,
2590
,
2810
,
3030
,
3250
,
3470
,
3690
,
3910
,
4130
,
4350
,
4500
,
0
,
0
,
0
,
0
,
0
},
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
0
,
0
,
0
,
0
,
0
}
},
/*WET气压*/
{
{
500
,
730
,
960
,
1190
,
1420
,
1650
,
1880
,
2100
,
2330
,
2560
,
2790
,
3020
,
3250
,
3480
,
3710
,
3940
,
4170
,
4400
,
4500
,
0
,
0
,
0
,
0
,
0
,
0
},
{
600
,
830
,
1060
,
1290
,
1520
,
1750
,
1980
,
2200
,
2430
,
2660
,
2890
,
3120
,
3350
,
3580
,
3810
,
4040
,
4270
,
4500
,
4500
,
0
,
0
,
0
,
0
,
0
,
0
},
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
0
,
0
,
0
,
0
,
0
,
0
}
{
{
500
,
730
,
960
,
1190
,
1420
,
1650
,
1880
,
2100
,
2330
,
2560
,
2790
,
3020
,
3250
,
3480
,
3710
,
3940
,
4170
,
4400
,
4500
,
0
,
0
,
0
,
0
,
0
,
0
},
{
600
,
830
,
1060
,
1290
,
1520
,
1750
,
1980
,
2200
,
2430
,
2660
,
2890
,
3120
,
3350
,
3580
,
3810
,
4040
,
4270
,
4500
,
4500
,
0
,
0
,
0
,
0
,
0
,
0
},
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
0
,
0
,
0
,
0
,
0
,
0
}
},
/*电池电压*/
{
{
0
,
17000
,
19000
,
20000
,
21000
,
22000
,
23000
,
24000
,
25000
,
26000
,
27000
,
28000
,
29000
,
30000
,
30500
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
},
{
0
,
17000
,
18500
,
19500
,
20500
,
21500
,
22500
,
23500
,
24500
,
25500
,
26500
,
27500
,
28500
,
29500
,
30000
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
},
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
}
{
{
0
,
17000
,
19000
,
20000
,
21000
,
22000
,
23000
,
24000
,
25000
,
26000
,
27000
,
28000
,
29000
,
30000
,
30500
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
},
{
0
,
17000
,
18500
,
19500
,
20500
,
21500
,
22500
,
23500
,
24500
,
25500
,
26500
,
27500
,
28500
,
29500
,
30000
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
},
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
}
},
};
/*指示类型*/
/*表头1 表头2 表头3 表头4*/
/*表头5*/
/*表头6*/
/*表头7*/
static
const
uint8_t
GaugesIndicatType
[
GaugesTotal
]
=
{
LEDOtherType
,
LEDOtherType
,
LEDTempType
,
LEDGasType
,
LEDGasType
,
LEDGasType
,
LEDOtherType
};
/*初始化表头显示类型,例如水温,气压*/
static
const
uint8_t
GaugesIndicatType
[
GaugesTotal
]
=
{
LEDOtherType
,
LEDOtherType
,
LEDTempType
,
LEDGasType
,
LEDGasType
,
LEDGasType
,
LEDOtherType
};
/*初始化表头显示类型,例如水温,气压*/
/*每个表头包含的参数个数*/
/*表头1 表头2 表头3 表头4*/
static
const
uint8_t
GaugesParaNum
[
GaugesTotal
]
=
{
12
,
6
,
13
,
19
,
19
,
19
,
14
};
static
const
uint8_t
GaugesParaNum
[
GaugesTotal
]
=
{
12
,
6
,
13
,
19
,
19
,
19
,
15
};
/*每个表头IGON后开始走动时间*/
/*表头1 表头2 表头3 表头4 表头5 表头6*/
static
const
uint16_t
GaugesStarMoveTime
[
GaugesTotal
]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,};
/*0是上电就开始走动,其他参数是ms*/
static
const
uint16_t
GaugesStarMoveTime
[
GaugesTotal
]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
};
/*0是上电就开始走动,其他参数是ms*/
/*每个表头IGON后是否自检*/
/*表头1 表头2 表头3 表头4 表头5 表头6*/
static
const
uint16_t
GaugesTest
[
GaugesTotal
]
=
{
1
,
1
,
1
,
1
,
1
,
0
,
0
,};
/*1是自检,0不自检*/
static
const
uint16_t
GaugesTest
[
GaugesTotal
]
=
{
1
,
1
,
1
,
1
,
1
,
0
,
0
,
};
/*1是自检,0不自检*/
/*每个表头自检走动每格时间*/
const
uint16_t
SeftTest_Gauges_Times
[
GaugesTotal
]
=
{
1500
/
(
30
+
1
),
1500
/
(
27
+
1
)
,
1500
/
(
12
+
1
),
1500
/
(
18
+
1
),
1500
/
(
18
+
1
),
0
,
0
};
const
uint16_t
SeftTest_Gauges_Times
[
GaugesTotal
]
=
{
1500
/
(
30
+
1
),
1500
/
(
27
+
1
),
1500
/
(
12
+
1
),
1500
/
(
18
+
1
),
1500
/
(
18
+
1
),
0
,
0
};
uint16_t
RealDataIn
[
GaugesTotal
];
_GaugesInfoInit
GaugesInfo_Init_Table
[
GaugesTotal
];
/**@brief User Gauge K30 Init function
* @author TYW
* @param[in] GaugeNum Gauge Postion
* @param[in] GParam Gauge Struct
* @since 1.0.0.0
*/
* @author TYW
* @param[in] GaugeNum Gauge Postion
* @param[in] GParam Gauge Struct
* @since 1.0.0.0
*/
void
UserGaugeK30Init
(
void
)
{
uint8_t
i
=
0u
;
uint8_t
j
=
0u
;
for
(
i
=
0u
;
i
<
GaugesTotal
;
i
++
)
{
GaugesInfo_Init_Table
[
i
]
.
SectorNum
=
GaugesParaNum
[
i
];
GaugesInfo_Init_Table
[
i
]
.
GaugesType
=
GaugesIndicatType
[
i
];
GaugesInfo_Init_Table
[
i
]
.
GaugesDataIn
=
&
RealDataIn
[
i
];
GaugesInfo_Init_Table
[
i
]
.
GaugesStartTime
=
GaugesStarMoveTime
[
i
];
GaugesInfo_Init_Table
[
i
]
.
GaugesTestFlag
=
GaugesTest
[
i
];
GaugesInfo_Init_Table
[
i
]
.
SectorNum
=
GaugesParaNum
[
i
];
GaugesInfo_Init_Table
[
i
].
GaugesType
=
GaugesIndicatType
[
i
];
GaugesInfo_Init_Table
[
i
]
.
GaugesDataIn
=
&
RealDataIn
[
i
];
GaugesInfo_Init_Table
[
i
].
GaugesStartTime
=
GaugesStarMoveTime
[
i
];
GaugesInfo_Init_Table
[
i
].
GaugesTestFlag
=
GaugesTest
[
i
];
for
(
j
=
0u
;
j
<
GaugesParaNum
[
i
];
j
++
)
{
GaugesInfo_Init_Table
[
i
]
.
ReferenceDataInUp
[
j
]
=
GaugesDataInInit
[
i
][
0
][
j
];
GaugesInfo_Init_Table
[
i
]
.
ReferenceDataInDown
[
j
]
=
GaugesDataInInit
[
i
][
1
][
j
];
GaugesInfo_Init_Table
[
i
]
.
ReferenceDataInOut
[
j
]
=
GaugesDataInInit
[
i
][
2
][
j
];
GaugesInfo_Init_Table
[
i
]
.
ReferenceDataInUp
[
j
]
=
GaugesDataInInit
[
i
][
0
][
j
];
GaugesInfo_Init_Table
[
i
].
ReferenceDataInDown
[
j
]
=
GaugesDataInInit
[
i
][
1
][
j
];
GaugesInfo_Init_Table
[
i
]
.
ReferenceDataInOut
[
j
]
=
GaugesDataInInit
[
i
][
2
][
j
];
}
}
GaugesK15Init_OFF
();
}
/**@brief User Gauge K15 Init function
* @author TYW
* @param[in] GaugeNum Gauge Postion
* @param[in] GParam Gauge Struct
* @since 1.0.0.0
*/
* @author TYW
* @param[in] GaugeNum Gauge Postion
* @param[in] GParam Gauge Struct
* @since 1.0.0.0
*/
void
UserGaugeK15Init
(
void
)
{
uint8_t
i
=
0u
;
uint8_t
j
=
0u
;
for
(
i
=
0u
;
i
<
GaugesTotal
;
i
++
)
{
GaugesInfo_Init_Table
[
i
]
.
SectorNum
=
GaugesParaNum
[
i
];
GaugesInfo_Init_Table
[
i
]
.
GaugesType
=
GaugesIndicatType
[
i
];
GaugesInfo_Init_Table
[
i
]
.
GaugesDataIn
=
&
RealDataIn
[
i
];
GaugesInfo_Init_Table
[
i
]
.
GaugesStartTime
=
GaugesStarMoveTime
[
i
];
GaugesInfo_Init_Table
[
i
]
.
GaugesTestFlag
=
GaugesTest
[
i
];
GaugesInfo_Init_Table
[
i
]
.
SectorNum
=
GaugesParaNum
[
i
];
GaugesInfo_Init_Table
[
i
].
GaugesType
=
GaugesIndicatType
[
i
];
GaugesInfo_Init_Table
[
i
]
.
GaugesDataIn
=
&
RealDataIn
[
i
];
GaugesInfo_Init_Table
[
i
].
GaugesStartTime
=
GaugesStarMoveTime
[
i
];
GaugesInfo_Init_Table
[
i
].
GaugesTestFlag
=
GaugesTest
[
i
];
for
(
j
=
0u
;
j
<
GaugesParaNum
[
i
];
j
++
)
{
GaugesInfo_Init_Table
[
i
]
.
ReferenceDataInUp
[
j
]
=
GaugesDataInInit
[
i
][
0
][
j
];
GaugesInfo_Init_Table
[
i
]
.
ReferenceDataInDown
[
j
]
=
GaugesDataInInit
[
i
][
1
][
j
];
GaugesInfo_Init_Table
[
i
]
.
ReferenceDataInOut
[
j
]
=
GaugesDataInInit
[
i
][
2
][
j
];
GaugesInfo_Init_Table
[
i
].
ReferenceDataInUp
[
j
]
=
GaugesDataInInit
[
i
][
0
][
j
];
GaugesInfo_Init_Table
[
i
].
ReferenceDataInDown
[
j
]
=
GaugesDataInInit
[
i
][
1
][
j
];
GaugesInfo_Init_Table
[
i
].
ReferenceDataInOut
[
j
]
=
GaugesDataInInit
[
i
][
2
][
j
];
}
}
GaugesK15Init_ON
();
}
/**@brief Gauge Schedule function
* @author TYW
* @param[in] GaugeNum Gauge Postion
* @param[in] GParam Gauge Struct
* @since 1.0.0.0
*/
* @author TYW
* @param[in] GaugeNum Gauge Postion
* @param[in] GParam Gauge Struct
* @since 1.0.0.0
*/
void
UserGaugeSchedule
(
void
)
{
uint8_t
i
=
0u
;
...
...
@@ -129,78 +146,73 @@ void UserGaugeSchedule(void)
for
(
i
=
0u
;
i
<
GaugesTotal
;
i
++
)
{
GaugeSchedule
(
i
,
&
GaugesInfo_Init_Table
[
i
]);
}
}
/**@brief Set Gauges Paragram function
* @author TYW
* @param[in] GaugesID Gauge Name
* @param[in] GaugesVal Gauges Val
* @since 1.0.0.0
*/
* @author TYW
* @param[in] GaugesID Gauge Name
* @param[in] GaugesVal Gauges Val
* @since 1.0.0.0
*/
void
SetGaugesPara
(
uint8_t
GaugesID
,
uint16_t
GaugesVal
)
{
RealDataIn
[
GaugesID
]
=
GaugesVal
;
}
/**@brief Get Gauges Max Out Val function
* @author TYW
* @param[in] GaugesID Gauge Name
* @since 1.0.0.0
*/
* @author TYW
* @param[in] GaugesID Gauge Name
* @since 1.0.0.0
*/
uint16_t
GetGaugesMaxOutVal
(
uint8_t
GaugesID
)
{
return
GaugesInfo_Init_Table
[
GaugesID
]
.
ReferenceDataInOut
[
GaugesParaNum
[
GaugesID
]
-
1u
]
;
return
GaugesInfo_Init_Table
[
GaugesID
]
.
ReferenceDataInOut
[
GaugesParaNum
[
GaugesID
]
-
1u
]
;
}
/**@brief Set Gauges Up Val function
* @author TYW
* @param[in] GaugesID Gauge Name
* @param[in] GaugesVal Gauges Val
* @since 1.0.0.0
*/
* @author TYW
* @param[in] GaugesID Gauge Name
* @param[in] GaugesVal Gauges Val
* @since 1.0.0.0
*/
void
SetGaugesUpVal
(
uint8_t
GaugesID
,
uint16_t
GaugesUpVal
[])
{
uint8_t
i
;
for
(
i
=
0u
;
i
<
GaugesParaNum
[
GaugesID
];
i
++
)
{
GaugesInfo_Init_Table
[
GaugesID
]
.
ReferenceDataInUp
[
i
]
=
GaugesUpVal
[
i
];
GaugesInfo_Init_Table
[
GaugesID
].
ReferenceDataInUp
[
i
]
=
GaugesUpVal
[
i
];
}
}
/**@brief Set Gauges Dwom Val function
* @author TYW
* @param[in] GaugesID Gauge Name
* @param[in] GaugesVal Gauges Val
* @since 1.0.0.0
*/
* @author TYW
* @param[in] GaugesID Gauge Name
* @param[in] GaugesVal Gauges Val
* @since 1.0.0.0
*/
void
SetGaugesDownVal
(
uint8_t
GaugesID
,
uint16_t
GaugesDownVal
[])
{
uint8_t
i
;
for
(
i
=
0u
;
i
<
GaugesParaNum
[
GaugesID
];
i
++
)
{
GaugesInfo_Init_Table
[
GaugesID
]
.
ReferenceDataInDown
[
i
]
=
GaugesDownVal
[
i
];
GaugesInfo_Init_Table
[
GaugesID
].
ReferenceDataInDown
[
i
]
=
GaugesDownVal
[
i
];
}
}
/**@brief Set Gauges Out Val function
* @author TYW
* @param[in] GaugesID Gauge Name
* @param[in] GaugesVal Gauges Val
* @since 1.0.0.0
*/
* @author TYW
* @param[in] GaugesID Gauge Name
* @param[in] GaugesVal Gauges Val
* @since 1.0.0.0
*/
void
SetGaugesOutVal
(
uint8_t
GaugesID
,
uint16_t
GaugesOutVal
[])
{
uint8_t
i
;
for
(
i
=
0u
;
i
<
GaugesParaNum
[
GaugesID
];
i
++
)
{
GaugesInfo_Init_Table
[
GaugesID
]
.
ReferenceDataInOut
[
i
]
=
GaugesOutVal
[
i
];
GaugesInfo_Init_Table
[
GaugesID
]
.
ReferenceDataInOut
[
i
]
=
GaugesOutVal
[
i
];
}
}
\ No newline at end of file
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