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
490dac50
Commit
490dac50
authored
Oct 21, 2021
by
hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整指示灯
parent
0d1dff89
Changes
18
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
23279 additions
and
24009 deletions
+23279
-24009
project
ghs/project
+0
-0
project.hex
ghs/project.hex
+22010
-22009
project.siz
ghs/project.siz
+2
-2
Data_CoolantTemperature.c
...ion/APP/Data_CoolantTemperature/Data_CoolantTemperature.c
+138
-140
Data_Fuel_User.c
source/Application/APP/Data_Fuel/Data_Fuel_User.c
+342
-347
FuelConfig.h
source/Application/APP/Data_Fuel/FuelConfig.h
+115
-116
Speed_PPK_Out.c
source/Application/APP/Data_SpeedOut/Speed_PPK_Out.c
+1
-1
Data_VehicleSpeed.c
source/Application/APP/Data_VehicleSpeed/Data_VehicleSpeed.c
+4
-22
GaugesDataAnalysis.c
source/Application/APP/GaugesMode/GaugesDataAnalysis.c
+2
-2
GaugesInterface.c
source/Application/APP/GaugesMode/GaugesInterface.c
+1
-1
Key.c
source/Application/APP/Key/Key.c
+32
-20
Telltales_user.c
source/Application/APP/Telltales/Telltales_user.c
+617
-746
Popup_Lib.h
source/Application/Alarm/Popup_Lib.h
+1
-1
DisplaySch.c
source/Application/Graphic/UE/DisplaySch.c
+0
-594
GPIO.h
source/Driver/GPIO/GPIO.h
+3
-2
TimerB.c
source/Driver/Timer/TimerB.c
+2
-2
init.c
source/System/init.c
+7
-3
tasks.c
source/System/tasks.c
+2
-1
No files found.
ghs/project
View file @
490dac50
No preview for this file type
ghs/project.hex
View file @
490dac50
This diff is collapsed.
Click to expand it.
ghs/project.siz
View file @
490dac50
project .intvect 1536
project .intvect 1536
project .text 299
276
project .text 299
324
project .rodata 412383
project .rodata 412383
project .secinfo 120
project .secinfo 120
project .syscall 6
project .syscall 6
project .romdata 78
61
project .romdata 78
53
project .ROM.ramfunc 208
project .ROM.ramfunc 208
project .ramfunc 208
project .ramfunc 208
source/Application/APP/Data_CoolantTemperature/Data_CoolantTemperature.c
View file @
490dac50
...
@@ -11,12 +11,12 @@
...
@@ -11,12 +11,12 @@
//-------------------------------------------
//-------------------------------------------
static
struct
static
struct
{
{
uint8_t
Value
;
uint8_t
Value
;
uint8_t
Valid
;
uint8_t
Valid
;
uint8_t
CurSeg
;
uint8_t
CurSeg
;
}
CoolantVariable
;
}
CoolantVariable
;
static
uint8_t
CalCoolant_CurSeg
(
uint8_t
Valid
,
uint8_t
Temp
);
static
uint8_t
CalCoolant_CurSeg
(
uint8_t
Valid
,
uint8_t
Temp
);
static
uint8_t
CalCoolant_TarSeg
(
uint16_t
CanMsg
);
static
uint8_t
CalCoolant_TarSeg
(
uint16_t
CanMsg
);
/*-------------------------------------------------------------------------
/*-------------------------------------------------------------------------
* Function Name : Coolant_KL30_Init
* Function Name : Coolant_KL30_Init
...
@@ -28,34 +28,34 @@ static uint8_t CalCoolant_TarSeg(uint16_t CanMsg);
...
@@ -28,34 +28,34 @@ static uint8_t CalCoolant_TarSeg(uint16_t CanMsg);
--------------------------------------------------------------------------*/
--------------------------------------------------------------------------*/
void
Coolant_KL30_Init
(
void
)
void
Coolant_KL30_Init
(
void
)
{
{
CoolantVariable
.
Valid
=
0
;
CoolantVariable
.
Valid
=
0
;
CoolantVariable
.
Value
=
0
;
CoolantVariable
.
Value
=
0
;
CoolantVariable
.
CurSeg
=
0
;
CoolantVariable
.
CurSeg
=
0
;
}
}
void
Coolant_KL15_ON_Init
(
void
)
void
Coolant_KL15_ON_Init
(
void
)
{
{
CoolantVariable
.
Valid
=
0
;
CoolantVariable
.
Valid
=
0
;
CoolantVariable
.
Value
=
0
;
CoolantVariable
.
Value
=
0
;
CoolantVariable
.
CurSeg
=
0
;
CoolantVariable
.
CurSeg
=
0
;
}
}
void
Coolant_KL15_OFF_Init
(
void
)
void
Coolant_KL15_OFF_Init
(
void
)
{
{
CoolantVariable
.
Valid
=
0
;
CoolantVariable
.
Valid
=
0
;
CoolantVariable
.
Value
=
0
;
CoolantVariable
.
Value
=
0
;
CoolantVariable
.
CurSeg
=
0
;
CoolantVariable
.
CurSeg
=
0
;
}
}
void
Coolant_Wakeup_Init
(
void
)
void
Coolant_Wakeup_Init
(
void
)
{
{
CoolantVariable
.
Valid
=
0
;
CoolantVariable
.
Valid
=
0
;
CoolantVariable
.
Value
=
0
;
CoolantVariable
.
Value
=
0
;
CoolantVariable
.
CurSeg
=
0
;
CoolantVariable
.
CurSeg
=
0
;
}
}
void
Coolant_Sleep_Init
(
void
)
void
Coolant_Sleep_Init
(
void
)
{
{
CoolantVariable
.
Valid
=
0
;
CoolantVariable
.
Valid
=
0
;
CoolantVariable
.
Value
=
0
;
CoolantVariable
.
Value
=
0
;
CoolantVariable
.
CurSeg
=
0
;
CoolantVariable
.
CurSeg
=
0
;
}
}
/*-------------------------------------------------------------------------
/*-------------------------------------------------------------------------
* Function Name : Coolant_Processing_Service
* Function Name : Coolant_Processing_Service
...
@@ -68,56 +68,57 @@ void Coolant_Sleep_Init(void)
...
@@ -68,56 +68,57 @@ void Coolant_Sleep_Init(void)
static
uint8_t
wbyTestSeg
=
0
;
static
uint8_t
wbyTestSeg
=
0
;
void
Coolant_Processing_Service
(
void
)
void
Coolant_Processing_Service
(
void
)
{
{
static
uint8_t
Timer2s
=
0
;
static
uint8_t
Timer2s
=
0
;
uint8_t
TargetSeg
=
0
;
uint8_t
TargetSeg
=
0
;
uint8_t
Msg_CoolTemp
=
0
;
uint8_t
Msg_CoolTemp
=
0
;
if
(
CAN_MSG_Status
(
ID_CanMsg18FEEE00_Msg_Count
)
==
0x55u
)
if
(
CAN_MSG_Status
(
ID_CanMsg18FEEE00_Msg_Count
)
==
0x55u
)
{
//timeout
{
CoolantVariable
.
Valid
=
0
;
//timeout
Timer2s
=
0
;
CoolantVariable
.
Valid
=
0
;
}
Timer2s
=
0
;
else
}
{
else
Msg_CoolTemp
=
Get_ID_18FEEE00_Sig_Engine_Coolant_Temperature
();
{
Msg_CoolTemp
=
Get_ID_18FEEE00_Sig_Engine_Coolant_Temperature
();
if
(
Msg_CoolTemp
>
0xFA
)
{
//if(Timer2s < 100)
//{
// Timer2s ++ ;
//}
//else
{
CoolantVariable
.
Valid
=
0
;
}
}
else
{
Timer2s
=
0
;
CoolantVariable
.
Valid
=
1
;
CoolantVariable
.
Value
=
Msg_CoolTemp
;
TargetSeg
=
CalCoolant_TarSeg
(
Msg_CoolTemp
);
if
(
Msg_CoolTemp
>
0xFA
)
}
{
}
//if(Timer2s < 100)
//{
// Timer2s ++ ;
//}
//else
{
CoolantVariable
.
Valid
=
0
;
}
}
else
{
Timer2s
=
0
;
CoolantVariable
.
Valid
=
1
;
CoolantVariable
.
Value
=
Msg_CoolTemp
;
TargetSeg
=
CalCoolant_TarSeg
(
Msg_CoolTemp
);
}
}
if
(
Msg_CoolTemp
<
40
)
{
Msg_CoolTemp
=
0
;
}
else
{
Msg_CoolTemp
-=
40
;
}
//CoolantVariable.CurSeg = CalCoolant_CurSeg(CoolantVariable.Valid,Msg_CoolTemp);
//TargetSeg - 目标段
//CoolantVariable.Valid - 有效值
//CoolantVariable.CurSeg - 当前段
CoolantVariable
.
CurSeg
=
Coolant_Temp_Filter
(
TargetSeg
,
CoolantVariable
.
Valid
);
if
(
Msg_CoolTemp
<
40
)
{
Msg_CoolTemp
=
0
;
}
else
{
Msg_CoolTemp
-=
40
;
}
//CoolantVariable.CurSeg = CalCoolant_CurSeg(CoolantVariable.Valid,Msg_CoolTemp);
//TargetSeg - 目标段
//CoolantVariable.Valid - 有效值
//CoolantVariable.CurSeg - 当前段
CoolantVariable
.
CurSeg
=
Coolant_Temp_Filter
(
TargetSeg
,
CoolantVariable
.
Valid
);
}
}
/*-------------------------------------------------------------------------
/*-------------------------------------------------------------------------
* Function Name : CalCoolant_TarSeg
* Function Name : CalCoolant_TarSeg
...
@@ -129,61 +130,61 @@ void Coolant_Processing_Service(void)
...
@@ -129,61 +130,61 @@ void Coolant_Processing_Service(void)
--------------------------------------------------------------------------*/
--------------------------------------------------------------------------*/
static
uint8_t
CalCoolant_TarSeg
(
uint16_t
CanMsg
)
static
uint8_t
CalCoolant_TarSeg
(
uint16_t
CanMsg
)
{
{
uint8_t
TargetSeg
=
0
;
uint8_t
TargetSeg
=
0
;
if
(
CanMsg
>=
0x00
&&
CanMsg
<=
0x59
)
if
(
CanMsg
>=
0x00
&&
CanMsg
<=
0x59
)
{
{
TargetSeg
=
0
;
TargetSeg
=
0
;
}
}
if
(
CanMsg
>=
0x5A
&&
CanMsg
<=
0x5E
)
if
(
CanMsg
>=
0x5A
&&
CanMsg
<=
0x5E
)
{
{
TargetSeg
=
1
;
TargetSeg
=
1
;
}
}
if
(
CanMsg
>=
0x5F
&&
CanMsg
<=
0x64
)
if
(
CanMsg
>=
0x5F
&&
CanMsg
<=
0x64
)
{
{
TargetSeg
=
2
;
TargetSeg
=
2
;
}
}
if
(
CanMsg
>=
0x65
&&
CanMsg
<=
0x69
)
if
(
CanMsg
>=
0x65
&&
CanMsg
<=
0x69
)
{
{
TargetSeg
=
3
;
TargetSeg
=
3
;
}
}
if
(
CanMsg
>=
0x6A
&&
CanMsg
<=
0x6F
)
if
(
CanMsg
>=
0x6A
&&
CanMsg
<=
0x6F
)
{
{
TargetSeg
=
4
;
TargetSeg
=
4
;
}
}
if
(
CanMsg
>=
0x70
&&
CanMsg
<=
0x74
)
if
(
CanMsg
>=
0x70
&&
CanMsg
<=
0x74
)
{
{
TargetSeg
=
5
;
TargetSeg
=
5
;
}
}
if
(
CanMsg
>=
0x75
&&
CanMsg
<=
0x8D
)
if
(
CanMsg
>=
0x75
&&
CanMsg
<=
0x8D
)
{
{
TargetSeg
=
6
;
TargetSeg
=
6
;
}
}
if
(
CanMsg
>=
0x8E
&&
CanMsg
<=
0x8F
)
if
(
CanMsg
>=
0x8E
&&
CanMsg
<=
0x8F
)
{
{
TargetSeg
=
7
;
TargetSeg
=
7
;
}
}
if
(
CanMsg
>=
0x90
&&
CanMsg
<=
0x91
)
if
(
CanMsg
>=
0x90
&&
CanMsg
<=
0x91
)
{
{
TargetSeg
=
8
;
TargetSeg
=
8
;
}
}
if
(
CanMsg
>=
0x92
&&
CanMsg
<=
0x93
)
if
(
CanMsg
>=
0x92
&&
CanMsg
<=
0x93
)
{
{
TargetSeg
=
9
;
TargetSeg
=
9
;
}
}
if
(
CanMsg
>=
0x94
&&
CanMsg
<=
0x95
)
if
(
CanMsg
>=
0x94
&&
CanMsg
<=
0x95
)
{
{
TargetSeg
=
10
;
TargetSeg
=
10
;
}
}
if
(
CanMsg
==
0x96
)
if
(
CanMsg
==
0x96
)
{
{
TargetSeg
=
11
;
TargetSeg
=
11
;
}
}
if
(
CanMsg
>=
0x97
)
if
(
CanMsg
>=
0x97
)
{
{
TargetSeg
=
12
;
TargetSeg
=
12
;
}
}
return
TargetSeg
;
return
TargetSeg
;
}
}
/*-------------------------------------------------------------------------
/*-------------------------------------------------------------------------
* Function Name : CalCoolant_CurSeg
* Function Name : CalCoolant_CurSeg
...
@@ -193,22 +194,22 @@ static uint8_t CalCoolant_TarSeg(uint16_t CanMsg)
...
@@ -193,22 +194,22 @@ static uint8_t CalCoolant_TarSeg(uint16_t CanMsg)
* Return : None
* Return : None
* onther : None
* onther : None
--------------------------------------------------------------------------*/
--------------------------------------------------------------------------*/
static
uint8_t
CalCoolant_CurSeg
(
uint8_t
Valid
,
uint8_t
Temp
)
static
uint8_t
CalCoolant_CurSeg
(
uint8_t
Valid
,
uint8_t
Temp
)
{
{
uint8_t
u8Result
=
0u
;
uint8_t
u8Result
=
0u
;
if
(
Valid
)
if
(
Valid
)
{
{
SetGaugesPara
(
TempGauges
,
Temp
);
SetGaugesPara
(
TempGauges
,
Temp
);
u8Result
=
GetGaugesCurrentPos
(
TempGauges
)
;
u8Result
=
GetGaugesCurrentPos
(
TempGauges
)
;
}
}
else
else
{
{
//范围外/CAN中断
//范围外/CAN中断
u8Result
=
0
;
u8Result
=
0
;
}
}
return
u8Result
;
return
u8Result
;
}
}
/*-------------------------------------------------------------------------
/*-------------------------------------------------------------------------
* Function Name : Coolant_Get_ActualValue
* Function Name : Coolant_Get_ActualValue
...
@@ -221,12 +222,12 @@ static uint8_t CalCoolant_CurSeg(uint8_t Valid,uint8_t Temp)
...
@@ -221,12 +222,12 @@ static uint8_t CalCoolant_CurSeg(uint8_t Valid,uint8_t Temp)
uint8_t
Coolant_Get_ActualValue
(
void
)
uint8_t
Coolant_Get_ActualValue
(
void
)
{
{
uint8_t
u8Result
=
0u
;
uint8_t
u8Result
=
0u
;
u8Result
=
CoolantVariable
.
Value
;
u8Result
=
CoolantVariable
.
Value
;
return
u8Result
;
return
u8Result
;
}
}
/*-------------------------------------------------------------------------
/*-------------------------------------------------------------------------
* Function Name : Coolant_Get_Valid
* Function Name : Coolant_Get_Valid
* Description :
* Description :
* Input : None
* Input : None
* Output : None
* Output : None
* Return : None
* Return : None
...
@@ -235,7 +236,7 @@ uint8_t Coolant_Get_ActualValue(void)
...
@@ -235,7 +236,7 @@ uint8_t Coolant_Get_ActualValue(void)
uint8_t
Coolant_Get_Valid
(
void
)
uint8_t
Coolant_Get_Valid
(
void
)
{
{
uint8_t
u8Result
=
0u
;
uint8_t
u8Result
=
0u
;
u8Result
=
CoolantVariable
.
Valid
;
u8Result
=
CoolantVariable
.
Valid
;
return
u8Result
;
return
u8Result
;
}
}
/*-------------------------------------------------------------------------
/*-------------------------------------------------------------------------
...
@@ -249,9 +250,6 @@ uint8_t Coolant_Get_Valid(void)
...
@@ -249,9 +250,6 @@ uint8_t Coolant_Get_Valid(void)
uint8_t
Coolant_Get_CurSeg
(
void
)
uint8_t
Coolant_Get_CurSeg
(
void
)
{
{
uint8_t
u8Result
=
0u
;
uint8_t
u8Result
=
0u
;
u8Result
=
CoolantVariable
.
CurSeg
;
u8Result
=
CoolantVariable
.
CurSeg
;
return
u8Result
;
return
u8Result
;
}
}
\ No newline at end of file
source/Application/APP/Data_Fuel/Data_Fuel_User.c
View file @
490dac50
This diff is collapsed.
Click to expand it.
source/Application/APP/Data_Fuel/FuelConfig.h
View file @
490dac50
#ifndef
_FUELCONFIG_H
#ifndef
_FUELCONFIG_H
#define _FUELCONFIG_H
#define _FUELCONFIG_H
typedef
unsigned
short
INT16U
;
typedef
unsigned
short
INT16U
;
typedef
unsigned
char
INT8U
;
typedef
unsigned
char
INT8U
;
typedef
unsigned
int
INT32U
;
typedef
unsigned
int
INT32U
;
#define DISPLAY_BOUNDARY_ES 1500
#define DISPLAY_BOUNDARY_
ES 2300
#define DISPLAY_BOUNDARY_
1 1500
#define DISPLAY_BOUNDARY_
1 2060
#define DISPLAY_BOUNDARY_
2 1373
#define DISPLAY_BOUNDARY_
2 1850
#define DISPLAY_BOUNDARY_
3 1191
#define DISPLAY_BOUNDARY_
3 1570
#define DISPLAY_BOUNDARY_
4 1009
#define DISPLAY_BOUNDARY_
4 1430
#define DISPLAY_BOUNDARY_
5 848
#define DISPLAY_BOUNDARY_
5 1130
#define DISPLAY_BOUNDARY_
6 697
#define DISPLAY_BOUNDARY_
6 970
#define DISPLAY_BOUNDARY_
7 545
#define DISPLAY_BOUNDARY_
7 550
#define DISPLAY_BOUNDARY_
8 436
#define DISPLAY_BOUNDARY_
8 460
#define DISPLAY_BOUNDARY_
9 345
#define DISPLAY_BOUNDARY_
9 460
#define DISPLAY_BOUNDARY_
10 254
#define DISPLAY_BOUNDARY_1
0 460
#define DISPLAY_BOUNDARY_1
1 188
#define DISPLAY_BOUNDARY_1
1 460
#define DISPLAY_BOUNDARY_1
2 132
#define DISPLAY_BOUNDARY_1
2 460
#define DISPLAY_BOUNDARY_1
3 84
#define DISPLAY_BOUNDARY_FS
460
#define DISPLAY_BOUNDARY_FS
65
#define BOUNDARY_FUEL_ES
0
#define BOUNDARY_FUEL_ES
0
#define BOUNDARY_FUEL_1
7
0
#define BOUNDARY_FUEL_1
40
0
#define BOUNDARY_FUEL_2
13
0
#define BOUNDARY_FUEL_2
72
0
#define BOUNDARY_FUEL_3
19
0
#define BOUNDARY_FUEL_3
86
0
#define BOUNDARY_FUEL_4
25
0
#define BOUNDARY_FUEL_4
104
0
#define BOUNDARY_FUEL_5
310
#define BOUNDARY_FUEL_5
1428
#define BOUNDARY_FUEL_6
370
#define BOUNDARY_FUEL_6
2577
#define BOUNDARY_FUEL_7
44
0
#define BOUNDARY_FUEL_7
375
0
#define BOUNDARY_FUEL_8
510
#define BOUNDARY_FUEL_8
4931
#define BOUNDARY_FUEL_9
510
#define BOUNDARY_FUEL_9
5536
#define BOUNDARY_FUEL_10
510
#define BOUNDARY_FUEL_10
5724
#define BOUNDARY_FUEL_11
510
#define BOUNDARY_FUEL_11
6491
#define BOUNDARY_FUEL_12
51
0
#define BOUNDARY_FUEL_12
685
0
#define BOUNDARY_FUEL_
FS 510
#define BOUNDARY_FUEL_
13 7199
#define BOUNDARY_FUEL_FS 7600
#define FUEL_R_MIN_VAL
300 //
10 X ohm
#define FUEL_R_MIN_VAL
40 //
10 X ohm
#define FUEL_R_MAX_VAL
2700 //
10 X ohm
#define FUEL_R_MAX_VAL
3000 //
10 X ohm
// Fuel Config
//Fuel Config
typedef
struct
_FuelStruct
typedef
struct
_FuelStruct
{
{
INT16U
FuelShortCircuitR
;
INT16U
FuelShortCircuitR
;
INT16U
FuelOpenCircuitR
;
INT16U
FuelOpenCircuitR
;
INT16U
DisplayZoneBoundary
[
22
];
INT16U
DisplayZoneBoundary
[
22
];
INT16U
FuelCapacityBoundary
[
22
];
INT16U
FuelCapacityBoundary
[
22
];
}
FuelStruct
;
}
FuelStruct
;
extern
void
InitFuelParamter
(
FuelStruct
*
para
);
extern
void
InitFuelParamter
(
FuelStruct
*
para
);
extern
INT8U
*
GetFuelLibVersion
(
void
);
extern
INT8U
*
GetFuelLibVersion
(
void
);
extern
void
FuelFSM
(
INT16U
FuelResistance
);
//
unit:ohm,accuracy:0.1
extern
void
FuelFSM
(
INT16U
FuelResistance
);
//
unit:ohm,accuracy:0.1
extern
void
SetMaxFuelBlockNum
(
INT8U
n
);
//call after InitFuelParamter(),default 12,max 20
extern
void
SetMaxFuelBlockNum
(
INT8U
n
);
//
call after InitFuelParamter(),default 12,max 20
extern
void
SetFuelSensorRecoverGroupCnt
(
INT16U
n
);
//
1:500ms,2:1000ms,3:1500ms.......,range:5s(10)-30min(3600)
extern
void
SetFuelSensorRecoverGroupCnt
(
INT16U
n
);
//
1:500ms,2:1000ms,3:1500ms.......,range:5s(10)-30min(3600)
extern
void
SetFuelSensorOpenCircuitGroupCnt
(
INT16U
n
);
//1:500ms,2:1000ms,3:1500ms.......,range:5s(10)-30min(3600)
extern
void
SetFuelSensorOpenCircuitGroupCnt
(
INT16U
n
);
// 1:500ms,2:1000ms,3:1500ms.......,range:5s(10)-30min(3600)
extern
void
SetFuelSensorShortCircuitGroupCnt
(
INT16U
n
);
//
1:500ms,2:1000ms,3:1500ms.......,range:5s(10)-30min(3600)
extern
void
SetFuelSensorShortCircuitGroupCnt
(
INT16U
n
);
//
1:500ms,2:1000ms,3:1500ms.......,range:5s(10)-30min(3600)
extern
void
SetPowerSt
(
INT8U
n
);
extern
void
SetPowerSt
(
INT8U
n
);
extern
INT8U
GetFuelSeg
(
void
);
//
Segment, range:0~8
extern
INT8U
GetFuelSeg
(
void
);
//
Segment, range:0~8
extern
INT8U
GetFuelStep
(
void
);
//
Pointer or Mono TFT stepless,range:0,10~((MaxFuelBlockNum + 1) * 10) 0,10:E, ((MaxFuelBlockNum + 1) * 10):F
extern
INT8U
GetFuelStep
(
void
);
//
Pointer or Mono TFT stepless,range:0,10~((MaxFuelBlockNum + 1) * 10) 0,10:E, ((MaxFuelBlockNum + 1) * 10):F
extern
INT16U
GetFuelCapacityVal
(
void
);
//unit:L,accuracy:0.1
extern
INT16U
GetFuelCapacityVal
(
void
);
//
unit:L,accuracy:0.1
enum
{
enum
FuelSensorNormal
,
{
FuelSensorShortCircuit
,
FuelSensorNormal
,
FuelSensorOpenCircuit
,
FuelSensorShortCircuit
,
FuelSensorPreFault
,
FuelSensorOpenCircuit
,
FuelSensorPreFault
,
};
extern
INT8U
GetFuelSensorState
(
void
);
enum
{
FUEL_ST_IGN_ON_PROCESS
=
1
,
// 1
FUEL_ST_POWER_ON_ADD_FUEL
,
// 2
FUEL_ST_VEHICLE_RUN
,
// 3
FUEL_ST_IGN_OFF_PROCESS
,
// 4
FUEL_ST_IGN_OFF
,
// 5
};
};
extern
INT8U
GetFuelSensorState
(
void
);
enum
{
FUEL_ST_IGN_ON_PROCESS
=
1
,
//1
FUEL_ST_POWER_ON_ADD_FUEL
,
//2
FUEL_ST_VEHICLE_RUN
,
//3
FUEL_ST_IGN_OFF_PROCESS
,
//4
FUEL_ST_IGN_OFF
,
//5
};
extern
INT8U
GetFuelFSM_St
(
void
);
extern
INT8U
GetFuelFSM_St
(
void
);
extern
INT16U
GetFuelResistance
(
void
);
//unit:ohm,accuracy:0.1
extern
INT16U
GetFuelResistance
(
void
);
//
unit:ohm,accuracy:0.1
extern
void
SetPowerDnStep
(
INT8U
step
);
//call every ign on (after InitFuelParamter())
extern
void
SetPowerDnStep
(
INT8U
step
);
// call every ign on (after InitFuelParamter())
extern
INT8U
GetPowerDnStep
(
void
);
//every 10km or ign off or refuel(FUEL_ST_POWER_ON_ADD_FUEL->FUEL_ST_VEHICLE_RUN) record
extern
INT8U
GetPowerDnStep
(
void
);
// every 10km or ign off or refuel(FUEL_ST_POWER_ON_ADD_FUEL->FUEL_ST_VEHICLE_RUN) record
// AFC & DrivingRange
// AFC & DrivingRange
typedef
struct
_AFC_INIT
{
typedef
struct
_AFC_INIT
INT8U
CalcAFCMaxNum
;
//max 100km,default 50
{
INT16U
AFCMin
;
//unit:L,accuracy:0.1
INT8U
CalcAFCMaxNum
;
// max 100km,default 50
INT16U
AFCMax
;
//unit:L,accuracy:0.1
INT16U
AFCMin
;
// unit:L,accuracy:0.1
INT16U
AFCPreinstall
;
//unit:L,accuracy:0.1
INT16U
AFCMax
;
// unit:L,accuracy:0.1
INT32U
CurODO
;
// unit:m,accuracy:1
INT16U
AFCPreinstall
;
// unit:L,accuracy:0.1
INT32U
MaxDRMileage
;
//unit:km,accuracy:0.01
INT32U
CurODO
;
// unit:m,accuracy:1
}
AFC_INIT
;
INT32U
MaxDRMileage
;
// unit:km,accuracy:0.01
}
AFC_INIT
;
extern
void
InitAFC
(
AFC_INIT
*
data
);
extern
void
InitAFC
(
AFC_INIT
*
data
);
extern
void
ResetAFC
(
AFC_INIT
*
data
);
extern
void
ResetAFC
(
AFC_INIT
*
data
);
typedef
struct
_AFC_PARA
{
typedef
struct
_AFC_PARA
INT32U
CurODO
;
// unit:m,accuracy:1
{
INT16U
FuleConsume
;
// unit:ul,accuracy:1
INT32U
CurODO
;
// unit:m,accuracy:1
INT16U
RPM
;
// unit:RPM,accuracy:1
INT16U
FuleConsume
;
// unit:ul,accuracy:1
INT8U
Speed
;
// unit:km/h,accuracy:1
INT16U
RPM
;
// unit:RPM,accuracy:1
}
AFC_PARA
;
INT8U
Speed
;
// unit:km/h,accuracy:1
}
AFC_PARA
;
extern
void
SetAFCPara
(
AFC_PARA
*
data
);
extern
void
SetAFCPara
(
AFC_PARA
*
data
);
typedef
struct
_DAFC_PARA
{
typedef
struct
_DAFC_PARA
INT32U
DAFC_FuelConsumeSum
;
//unit:ul (ul:m->ml:km->L:1000km)
{
INT32U
DAFC_ODO
;
//unit:m
INT32U
DAFC_FuelConsumeSum
;
// unit:ul (ul:m->ml:km->L:1000km)
}
DAFC_PARA
;
INT32U
DAFC_ODO
;
// unit:m
extern
void
DAFC_GetPowerDownPara
(
DAFC_PARA
*
data
);
//call every 10km or ign off or reset afc
}
DAFC_PARA
;
extern
void
DAFC_SetPowerDownPara
(
DAFC_PARA
*
data
);
//call every KL30 OFF -> KL30 ON (after InitAFC())
extern
void
DAFC_GetPowerDownPara
(
DAFC_PARA
*
data
);
// call every 10km or ign off or reset afc
extern
void
DAFC_SetPowerDownPara
(
DAFC_PARA
*
data
);
// call every KL30 OFF -> KL30 ON (after InitAFC())
typedef
struct
_DR_PARA
{
INT32U
DR_FuelConsumeSum
;
//unit:ul (ul:m->ml:km->L:1000km)
typedef
struct
_DR_PARA
INT32U
DR_Mileage
;
//unit:km,accuracy:0.01
{
}
DR_PARA
;
INT32U
DR_FuelConsumeSum
;
// unit:ul (ul:m->ml:km->L:1000km)
extern
void
DR_GetPowerDownPara
(
DR_PARA
*
data
);
//call every 10km or ign off
INT32U
DR_Mileage
;
// unit:km,accuracy:0.01
extern
void
DR_SetPowerDownPara
(
DR_PARA
*
data
);
//call every KL30 OFF -> KL30 ON (after InitAFC())
}
DR_PARA
;
extern
void
DR_GetPowerDownPara
(
DR_PARA
*
data
);
// call every 10km or ign off
extern
void
AFCTimerCall
(
void
);
//must per 10ms interrupt
extern
void
DR_SetPowerDownPara
(
DR_PARA
*
data
);
// call every KL30 OFF -> KL30 ON (after InitAFC())
extern
INT16U
GetDRMileage
(
void
);
//unit:km,accuracy:1
extern
INT16U
GetCurAFC
(
void
);
//unit:L,accuracy:0.1
extern
void
AFCTimerCall
(
void
);
// must per 10ms interrupt
extern
INT16U
GetDRMileage
(
void
);
// unit:km,accuracy:1
extern
INT16U
GetCurAFC
(
void
);
// unit:L,accuracy:0.1
//display afc
// display afc
extern
void
DAFC_Reset
(
AFC_INIT
*
data
);
extern
void
DAFC_Reset
(
AFC_INIT
*
data
);
extern
INT16U
DAFC_GetAFC
(
void
);
//unit:L,accuracy:0.1
extern
INT16U
DAFC_GetAFC
(
void
);
// unit:L,accuracy:0.1
//display afc end
// display afc end
#endif
extern
void
SetIgnOffRefuelThreshold
(
uint8_t
data
);
#endif
source/Application/APP/Data_SpeedOut/Speed_PPK_Out.c
View file @
490dac50
...
@@ -10,7 +10,7 @@ uint16_t Speed_PPK_Calc(uint16_t V_Speed, uint16_t m_PPK)
...
@@ -10,7 +10,7 @@ uint16_t Speed_PPK_Calc(uint16_t V_Speed, uint16_t m_PPK)
{
{
uint32_t
Frequency
;
uint32_t
Frequency
;
Frequency
=
(
uint32_t
)
V_Speed
/
10u
;
Frequency
=
(
uint32_t
)
V_Speed
/
10u
;
Frequency
=
(
uint32_t
)(
Frequency
*
m_PPK
/
10u
);
Frequency
=
(
uint32_t
)(
Frequency
*
m_PPK
);
Frequency
=
Frequency
/
3600u
;
Frequency
=
Frequency
/
3600u
;
return
(
uint16_t
)
Frequency
;
return
(
uint16_t
)
Frequency
;
}
}
...
...
source/Application/APP/Data_VehicleSpeed/Data_VehicleSpeed.c
View file @
490dac50
...
@@ -11,7 +11,7 @@ static struct
...
@@ -11,7 +11,7 @@ static struct
uint16_t
Data
[
VEH_FILTER_LEN
];
uint16_t
Data
[
VEH_FILTER_LEN
];
}
VehcleFilter
;
}
VehcleFilter
;
static
uint32_t
SPEED_PPK
=
1592
46
ul
;
static
uint32_t
SPEED_PPK
=
1592
5
ul
;
static
uint32_t
SPEED_RADIO
=
637
;
static
uint32_t
SPEED_RADIO
=
637
;
uint16_t
Vehicle_ACT_Speed
;
uint16_t
Vehicle_ACT_Speed
;
...
@@ -34,7 +34,7 @@ void Speed_KL30_Init(void)
...
@@ -34,7 +34,7 @@ void Speed_KL30_Init(void)
VehcleFilter
.
Data
[
i
]
=
0
;
VehcleFilter
.
Data
[
i
]
=
0
;
}
}
Set_Speed_PPK
(
159246ul
);
Set_Speed_PPK
(
SPEED_RADIO
);
}
}
void
Speed_KL15_ON_Init
(
void
)
void
Speed_KL15_ON_Init
(
void
)
{
{
...
@@ -49,7 +49,7 @@ void Speed_KL15_ON_Init(void)
...
@@ -49,7 +49,7 @@ void Speed_KL15_ON_Init(void)
VehcleFilter
.
Data
[
i
]
=
0
;
VehcleFilter
.
Data
[
i
]
=
0
;
}
}
Veh_Fre_Init
(
Get_Speed_PPK
()
/
10
);
Veh_Fre_Init
(
Get_Speed_PPK
());
}
}
void
Speed_KL15_OFF_Init
(
void
)
void
Speed_KL15_OFF_Init
(
void
)
{
{
...
@@ -93,31 +93,13 @@ void Speed_Processing_Service(void)
...
@@ -93,31 +93,13 @@ void Speed_Processing_Service(void)
{
{
uint32_t
VehValTmp
=
0u
;
uint32_t
VehValTmp
=
0u
;
uint32_t
PPK
=
0u
;
uint32_t
PPK
=
0u
;
// if(Get_Veh_Fre_Event())
//{
// VehValTmp = Cal_VehSpeed(Get_Veh_Fre(),VEH_FILTER_LEN) ;
// VehValTmp *= 3600 ;
// VehValTmp *= 10 ;
// VehValTmp *= 10 ;
// VehValTmp /= PPK ;
// Vehicle_ACT_Speed = VehValTmp ;
//}
PPK
=
Get_Speed_PPK
();
PPK
=
Get_Speed_PPK
();
VehValTmp
=
Cal_Veh_Frequency
();
VehValTmp
=
Cal_Veh_Frequency
();
VehValTmp
*=
3600
;
VehValTmp
*=
36000u
;
VehValTmp
*=
10
;
VehValTmp
*=
10
;
VehValTmp
/=
PPK
;
VehValTmp
/=
PPK
;
// VehValTmp = Cal_Veh_Frequency();
// VehValTmp *= 3600 ;
// VehValTmp *= 10 ;
// VehValTmp /= PPK ;
if
(
VehValTmp
>
2250
)
if
(
VehValTmp
>
2250
)
{
{
VehValTmp
=
0
;
VehValTmp
=
0
;
...
...
source/Application/APP/GaugesMode/GaugesDataAnalysis.c
View file @
490dac50
...
@@ -334,8 +334,8 @@ void Veh_Fre_Init(uint32_t PPK)
...
@@ -334,8 +334,8 @@ void Veh_Fre_Init(uint32_t PPK)
VehFre
.
Cycle
=
0u
;
VehFre
.
Cycle
=
0u
;
VehFre
.
Frequency
=
0u
;
VehFre
.
Frequency
=
0u
;
VehFre
.
PulseCnt
=
0u
;
VehFre
.
PulseCnt
=
0u
;
//
VehFreLimit = (3600000000u / (220u * PPK)) / 4u / 50u;
VehFreLimit
=
(
3600000000u
/
(
220u
*
PPK
))
/
4u
/
50u
;
VehFreLimit
=
(
3600000000u
/
(
250u
*
PPK
))
/
4u
/
50u
;
//
VehFreLimit = (3600000000u / (250u * PPK)) / 4u / 50u;
}
}
/*-------------------------------------------------------------------------
/*-------------------------------------------------------------------------
...
...
source/Application/APP/GaugesMode/GaugesInterface.c
View file @
490dac50
GetVehDisValGetVehDisVal
#
include
"GaugesInterface.h"
#include "GaugesInterface.h"
#include "Menu.h"
#include "Menu.h"
/**@struct _GaugesInfoInit
/**@struct _GaugesInfoInit
*this is _GaugesInfoInit
*this is _GaugesInfoInit
...
...
source/Application/APP/Key/Key.c
View file @
490dac50
...
@@ -28,19 +28,22 @@ typedef struct
...
@@ -28,19 +28,22 @@ typedef struct
uint16_t
u16KeyValidTimeCount
;
uint16_t
u16KeyValidTimeCount
;
uint16_t
u16KeyFirstIGNTimeRecord
;
uint16_t
u16KeyFirstIGNTimeRecord
;
Key_IGN_en_t
enKeyIGNFirstStatus
;
Key_IGN_en_t
enKeyIGNFirstStatus
;
Key_IGN_en_t
enKeyIGNStatusLast
;
uint8_t
u8KeyIGNChangeFlag
;
uint16_t
u16KeyIGNTimeCount
;
}
Key_Ctr_st_t
;
}
Key_Ctr_st_t
;
/*------------------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------------------*/
#pragma ghs section bss
=
".myNonInitArea"
#pragma ghs section bss
=
".myNonInitArea"
static
Key_Parameter_st_t
stKeyParameter
;
static
Key_Parameter_st_t
stKeyParameter
;
#pragma ghs section bss
=
default
#pragma ghs section bss
=
default
static
Key_Ctr_st_t
stKeyCtrVariate
[
KEY_NUM_MAX
];
static
Key_Ctr_st_t
stKeyCtrVariate
[
KEY_NUM_MAX
];
//static Key_IGN_en_t enKeyIGNFirstStatus = KEY_IG_INVALID;
//static Key_IGN_en_t enKeyIGNFirstStatus = KEY_IG_INVALID;
static
Key_IGN_en_t
enKeyIGNStatusLast
=
KEY_IG_INVALID
;
//
static Key_IGN_en_t enKeyIGNStatusLast = KEY_IG_INVALID;
static
uint8_t
u8KeyIGNChangeFlag
=
0U
;
//
static uint8_t u8KeyIGNChangeFlag = 0U;
static
uint16_t
u16KeyIGNTimeCount
;
//
static uint16_t u16KeyIGNTimeCount;
/*-----------------------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------------------*/
static
void
Key_Process
(
Key_Num_en_t
enKeyIndex
);
static
void
Key_Process
(
Key_Num_en_t
enKeyIndex
);
...
@@ -149,9 +152,9 @@ static void Key_Process(Key_Num_en_t enKeyIndex)
...
@@ -149,9 +152,9 @@ static void Key_Process(Key_Num_en_t enKeyIndex)
stKeyCtrVariate
[
enKeyIndex
].
enKeyTypeLast
=
KEY_LINE_LOOSEN
;
stKeyCtrVariate
[
enKeyIndex
].
enKeyTypeLast
=
KEY_LINE_LOOSEN
;
stKeyCtrVariate
[
enKeyIndex
].
u16KeyFirstIGNTimeRecord
=
0U
;
stKeyCtrVariate
[
enKeyIndex
].
u16KeyFirstIGNTimeRecord
=
0U
;
stKeyCtrVariate
[
enKeyIndex
].
enKeyIGNFirstStatus
=
KEY_IG_INVALID
;
stKeyCtrVariate
[
enKeyIndex
].
enKeyIGNFirstStatus
=
KEY_IG_INVALID
;
enKeyIGNStatusLast
=
KEY_IG_INVALID
;
stKeyCtrVariate
[
enKeyIndex
].
enKeyIGNStatusLast
=
KEY_IG_INVALID
;
u8KeyIGNChangeFlag
=
0U
;
stKeyCtrVariate
[
enKeyIndex
].
u8KeyIGNChangeFlag
=
0U
;
u16KeyIGNTimeCount
=
0U
;
stKeyCtrVariate
[
enKeyIndex
].
u16KeyIGNTimeCount
=
0U
;
}
}
if
((
stKeyCtrVariate
[
enKeyIndex
].
u16KeyInvalidTimeCount
>=
stKeyParameter
.
u16KeyLoosenTime
)
&&
if
((
stKeyCtrVariate
[
enKeyIndex
].
u16KeyInvalidTimeCount
>=
stKeyParameter
.
u16KeyLoosenTime
)
&&
(
stKeyCtrVariate
[
enKeyIndex
].
u16KeyValidTimeCount
>=
stKeyParameter
.
u16KeyShortPressTime
)
&&
(
stKeyCtrVariate
[
enKeyIndex
].
u16KeyValidTimeCount
>=
stKeyParameter
.
u16KeyShortPressTime
)
&&
...
@@ -172,29 +175,29 @@ static void Key_Process(Key_Num_en_t enKeyIndex)
...
@@ -172,29 +175,29 @@ static void Key_Process(Key_Num_en_t enKeyIndex)
stKeyCtrVariate
[
enKeyIndex
].
u16KeyValidTimeCount
=
0U
;
stKeyCtrVariate
[
enKeyIndex
].
u16KeyValidTimeCount
=
0U
;
stKeyCtrVariate
[
enKeyIndex
].
u16KeyFirstIGNTimeRecord
=
0U
;
stKeyCtrVariate
[
enKeyIndex
].
u16KeyFirstIGNTimeRecord
=
0U
;
stKeyCtrVariate
[
enKeyIndex
].
enKeyTypeLast
=
enKeyRealType
;
stKeyCtrVariate
[
enKeyIndex
].
enKeyTypeLast
=
enKeyRealType
;
u16KeyIGNTimeCount
=
0U
;
stKeyCtrVariate
[
enKeyIndex
].
u16KeyIGNTimeCount
=
0U
;
stKeyCtrVariate
[
enKeyIndex
].
enKeyIGNFirstStatus
=
enKeyIGNRealStatus
;
stKeyCtrVariate
[
enKeyIndex
].
enKeyIGNFirstStatus
=
enKeyIGNRealStatus
;
enKeyIGNStatusLast
=
enKeyIGNRealStatus
;
stKeyCtrVariate
[
enKeyIndex
].
enKeyIGNStatusLast
=
enKeyIGNRealStatus
;
}
}
else
else
{
{
if
(
enKeyIGNStatusLast
!=
enKeyIGNRealStatus
)
if
(
stKeyCtrVariate
[
enKeyIndex
].
enKeyIGNStatusLast
!=
enKeyIGNRealStatus
)
{
{
enKeyIGNStatusLast
=
enKeyIGNRealStatus
;
stKeyCtrVariate
[
enKeyIndex
].
enKeyIGNStatusLast
=
enKeyIGNRealStatus
;
if
(
stKeyCtrVariate
[
enKeyIndex
].
enKeyIGNFirstStatus
!=
enKeyIGNRealStatus
)
if
(
stKeyCtrVariate
[
enKeyIndex
].
enKeyIGNFirstStatus
!=
enKeyIGNRealStatus
)
{
{
stKeyCtrVariate
[
enKeyIndex
].
u16KeyFirstIGNTimeRecord
=
u16KeyIGNTimeCount
;
stKeyCtrVariate
[
enKeyIndex
].
u16KeyFirstIGNTimeRecord
=
stKeyCtrVariate
[
enKeyIndex
].
u16KeyIGNTimeCount
;
}
}
u16KeyIGNTimeCount
=
0U
;
stKeyCtrVariate
[
enKeyIndex
].
u16KeyIGNTimeCount
=
0U
;
}
}
else
else
{
{
if
(
u16KeyIGNTimeCount
<
0xFFF0U
)
if
(
stKeyCtrVariate
[
enKeyIndex
].
u16KeyIGNTimeCount
<
0xFFF0U
)
{
{
u16KeyIGNTimeCount
+=
KEY_CALL_CYCLE
;
stKeyCtrVariate
[
enKeyIndex
].
u16KeyIGNTimeCount
+=
KEY_CALL_CYCLE
;
}
}
}
}
...
@@ -204,14 +207,14 @@ static void Key_Process(Key_Num_en_t enKeyIndex)
...
@@ -204,14 +207,14 @@ static void Key_Process(Key_Num_en_t enKeyIndex)
}
}
if
(
stKeyCtrVariate
[
enKeyIndex
].
enKeyIGNFirstStatus
!=
enKeyIGNRealStatus
)
if
(
stKeyCtrVariate
[
enKeyIndex
].
enKeyIGNFirstStatus
!=
enKeyIGNRealStatus
)
{
{
u8KeyIGNChangeFlag
=
1U
;
stKeyCtrVariate
[
enKeyIndex
].
u8KeyIGNChangeFlag
=
1U
;
}
}
if
(
stKeyCtrVariate
[
enKeyIndex
].
u16KeyValidTimeCount
>=
stKeyParameter
.
u16KeyShortPressTime
)
if
(
stKeyCtrVariate
[
enKeyIndex
].
u16KeyValidTimeCount
>=
stKeyParameter
.
u16KeyShortPressTime
)
{
{
stKeyCtrVariate
[
enKeyIndex
].
u16KeyInvalidTimeCount
=
0U
;
stKeyCtrVariate
[
enKeyIndex
].
u16KeyInvalidTimeCount
=
0U
;
}
}
if
(
u8KeyIGNChangeFlag
==
0U
)
if
(
stKeyCtrVariate
[
enKeyIndex
].
u8KeyIGNChangeFlag
==
0U
)
{
{
if
(
stKeyCtrVariate
[
enKeyIndex
].
u16KeyValidTimeCount
>=
stKeyParameter
.
u16KeySuperLongPressTime
)
if
(
stKeyCtrVariate
[
enKeyIndex
].
u16KeyValidTimeCount
>=
stKeyParameter
.
u16KeySuperLongPressTime
)
{
{
...
@@ -235,12 +238,13 @@ static void Key_Process(Key_Num_en_t enKeyIndex)
...
@@ -235,12 +238,13 @@ static void Key_Process(Key_Num_en_t enKeyIndex)
if
(
enKeyIGNRealStatus
==
KEY_IG_ON
)
if
(
enKeyIGNRealStatus
==
KEY_IG_ON
)
{
{
if
((
stKeyCtrVariate
[
enKeyIndex
].
u16KeyFirstIGNTimeRecord
>=
stKeyParameter
.
u16KeyValidOFFTime
)
&&
if
((
stKeyCtrVariate
[
enKeyIndex
].
u16KeyFirstIGNTimeRecord
>=
stKeyParameter
.
u16KeyValidOFFTime
)
&&
(
u16KeyIGNTimeCount
>=
stKeyParameter
.
u16KeyValidONTime
))
(
stKeyCtrVariate
[
enKeyIndex
].
u16KeyIGNTimeCount
>=
stKeyParameter
.
u16KeyValidONTime
))
{
{
if
(
stKeyAttribute
[
enKeyIndex
].
pfnKeyOperationCallBack
!=
0U
)
if
(
stKeyAttribute
[
enKeyIndex
].
pfnKeyOperationCallBack
!=
0U
)
{
{
stKeyAttribute
[
enKeyIndex
].
pfnKeyOperationCallBack
(
KEY_EVENT_OFF_TO_ON
);
stKeyAttribute
[
enKeyIndex
].
pfnKeyOperationCallBack
(
KEY_EVENT_OFF_TO_ON
);
}
}
stKeyCtrVariate
[
enKeyIndex
].
u16KeyFirstIGNTimeRecord
=
0U
;
}
}
}
}
}
}
...
@@ -249,12 +253,13 @@ static void Key_Process(Key_Num_en_t enKeyIndex)
...
@@ -249,12 +253,13 @@ static void Key_Process(Key_Num_en_t enKeyIndex)
if
(
enKeyIGNRealStatus
==
KEY_IG_OFF
)
if
(
enKeyIGNRealStatus
==
KEY_IG_OFF
)
{
{
if
((
stKeyCtrVariate
[
enKeyIndex
].
u16KeyFirstIGNTimeRecord
>=
stKeyParameter
.
u16KeyValidONTime
)
&&
if
((
stKeyCtrVariate
[
enKeyIndex
].
u16KeyFirstIGNTimeRecord
>=
stKeyParameter
.
u16KeyValidONTime
)
&&
(
u16KeyIGNTimeCount
>=
stKeyParameter
.
u16KeyValidOFFTime
))
(
stKeyCtrVariate
[
enKeyIndex
].
u16KeyIGNTimeCount
>=
stKeyParameter
.
u16KeyValidOFFTime
))
{
{
if
(
stKeyAttribute
[
enKeyIndex
].
pfnKeyOperationCallBack
!=
0U
)
if
(
stKeyAttribute
[
enKeyIndex
].
pfnKeyOperationCallBack
!=
0U
)
{
{
stKeyAttribute
[
enKeyIndex
].
pfnKeyOperationCallBack
(
KEY_EVENT_ON_TO_OFF
);
stKeyAttribute
[
enKeyIndex
].
pfnKeyOperationCallBack
(
KEY_EVENT_ON_TO_OFF
);
}
}
stKeyCtrVariate
[
enKeyIndex
].
u16KeyFirstIGNTimeRecord
=
0U
;
}
}
}
}
}
}
...
@@ -292,11 +297,18 @@ void Key_Init(void)
...
@@ -292,11 +297,18 @@ void Key_Init(void)
stKeyCtrVariate
[
i
].
enKeyTypeLast
=
KEY_CAN_NONE
;
stKeyCtrVariate
[
i
].
enKeyTypeLast
=
KEY_CAN_NONE
;
stKeyCtrVariate
[
i
].
u16KeyInvalidTimeCount
=
0U
;
stKeyCtrVariate
[
i
].
u16KeyInvalidTimeCount
=
0U
;
stKeyCtrVariate
[
i
].
u16KeyValidTimeCount
=
0U
;
stKeyCtrVariate
[
i
].
u16KeyValidTimeCount
=
0U
;
stKeyCtrVariate
[
i
].
u16KeyFirstIGNTimeRecord
=
0U
;
stKeyCtrVariate
[
i
].
enKeyIGNFirstStatus
=
KEY_IG_INVALID
;
stKeyCtrVariate
[
i
].
enKeyIGNStatusLast
=
KEY_IG_INVALID
;
stKeyCtrVariate
[
i
].
u8KeyIGNChangeFlag
=
0U
;
stKeyCtrVariate
[
i
].
u16KeyIGNTimeCount
=
0U
;
}
}
stKeyParameter
.
u16KeyLoosenTime
=
50U
;
stKeyParameter
.
u16KeyLoosenTime
=
50U
;
stKeyParameter
.
u16KeyShortPressTime
=
40U
;
stKeyParameter
.
u16KeyShortPressTime
=
40U
;
stKeyParameter
.
u16KeyLongPressTime
=
2000U
;
stKeyParameter
.
u16KeyLongPressTime
=
2000U
;
stKeyParameter
.
u16KeySuperLongPressTime
=
30000U
;
stKeyParameter
.
u16KeySuperLongPressTime
=
30000U
;
stKeyParameter
.
u16KeyValidOFFTime
=
200U
;
/*按键动作时间*/
stKeyParameter
.
u16KeyValidONTime
=
1000U
;
}
}
/*对于硬线按键而言,判断短按的时间参数*/
/*对于硬线按键而言,判断短按的时间参数*/
Key_Set_en_t
Key_Parameter_Set_Short_Press_Time
(
uint16_t
u16Time
)
Key_Set_en_t
Key_Parameter_Set_Short_Press_Time
(
uint16_t
u16Time
)
...
...
source/Application/APP/Telltales/Telltales_user.c
View file @
490dac50
This diff is collapsed.
Click to expand it.
source/Application/Alarm/Popup_Lib.h
View file @
490dac50
...
@@ -70,7 +70,7 @@ typedef struct
...
@@ -70,7 +70,7 @@ typedef struct
Popuplib_uint8_t
Class
;
Popuplib_uint8_t
Class
;
const
Popuplib_uint8_t
*
pMbrList
;
const
Popuplib_uint8_t
*
pMbrList
;
Popuplib_uint8_t
MbrCnt
;
Popuplib_uint8_t
MbrCnt
;
Popuplib_uint
8_t
Message
;
Popuplib_uint
16_t
Message
;
Popuplib_uint8_t
DispMode
;
Popuplib_uint8_t
DispMode
;
Popuplib_uint8_t
Snd
;
Popuplib_uint8_t
Snd
;
Popuplib_uint8_t
SndMode
;
Popuplib_uint8_t
SndMode
;
...
...
source/Application/Graphic/UE/DisplaySch.c
View file @
490dac50
This diff is collapsed.
Click to expand it.
source/Driver/GPIO/GPIO.h
View file @
490dac50
#ifndef GPIO_H__
#ifndef GPIO_H__
#define GPIO_H__
#define GPIO_H__
#include "dr7f701441.dvf.h"
#include "dr7f701441.dvf.h"
/* --- PORT Data Direction --- */
/* --- PORT Data Direction --- */
...
@@ -457,8 +458,8 @@
...
@@ -457,8 +458,8 @@
#define ADC_AIR2 GPIO_IN_PORT10_PIN09
#define ADC_AIR2 GPIO_IN_PORT10_PIN09
#define ADC_AIR GPIO_IN_PORT10_PIN10
#define ADC_AIR GPIO_IN_PORT10_PIN10
#define ADC_KEY GPIO_IN_PORT10_PIN11
#define ADC_KEY GPIO_IN_PORT10_PIN11
#define
T1_LED_OUT
GPIO_OUT_PORT11_PIN00
#define
RR_DIFF_LOCK_MCU
GPIO_OUT_PORT11_PIN00
#define
R5_LED_OUT
GPIO_OUT_PORT11_PIN01
#define
BRAKE_AIR_EBS_LED_MCU
GPIO_OUT_PORT11_PIN01
#define CD4051A_COM6_MCU_IN GPIO_IN_PORT11_PIN02
#define CD4051A_COM6_MCU_IN GPIO_IN_PORT11_PIN02
#define CD4051A_COM7_MCU_IN GPIO_IN_PORT11_PIN03
#define CD4051A_COM7_MCU_IN GPIO_IN_PORT11_PIN03
#define CD4051A_COM1_MCU_IN GPIO_IN_PORT16_PIN00
#define CD4051A_COM1_MCU_IN GPIO_IN_PORT16_PIN00
...
...
source/Driver/Timer/TimerB.c
View file @
490dac50
...
@@ -577,8 +577,8 @@ void TimerB_PWM_Init(void)
...
@@ -577,8 +577,8 @@ void TimerB_PWM_Init(void)
TimerB_VehFreOut_Init
();
TimerB_VehFreOut_Init
();
TimerB_EngFreOut_Init
();
TimerB_EngFreOut_Init
();
TimerB_Input_Channel_Init
(
TIMERB_0_CH2
,
TIMERB_CLOCK_3
,
TIMERB_RISING
);
//车速输入捕获
//
TimerB_Input_Channel_Init(TIMERB_0_CH2, TIMERB_CLOCK_3, TIMERB_RISING); //车速输入捕获
TimerB_Input_Channel_Start
(
TIMERB_0_CH2
);
//
TimerB_Input_Channel_Start(TIMERB_0_CH2);
}
}
static
void
TimerB_PWM_Master_Channel_Init
(
TIMERB_Channel_en_t
enTimerBChannel
,
TIMERB_Clock_en_t
enTimerBClock
)
static
void
TimerB_PWM_Master_Channel_Init
(
TIMERB_Channel_en_t
enTimerBChannel
,
TIMERB_Clock_en_t
enTimerBClock
)
{
{
...
...
source/System/init.c
View file @
490dac50
...
@@ -93,17 +93,17 @@ void Sys_Startup_Init(void)
...
@@ -93,17 +93,17 @@ void Sys_Startup_Init(void)
/* init graphic tick driver */
/* init graphic tick driver */
R_TICK_Init
(
0
);
R_TICK_Init
(
0
);
Gfx_Init
(
GFX_VO_SINGLE_RGB888
/* | GFX_VI_ITU656*/
);
Gfx_Init
(
GFX_VO_SINGLE_RGB888
|
GFX_VI_ITU656
);
CPU_Init
();
CPU_Init
();
RTC_Init
();
RTC_Init
();
Sys_Tick_Timer_Start
();
Sys_Tick_Timer_Start
();
COM_CAN_Init
();
/*COM_CAN_Init(); 原CAN初始化位置*/
RTE_ADC_Init
();
RTE_ADC_Init
();
InitSeriFlashExternReadMode
();
Int_Flash_Init
();
Int_Flash_Init
();
EEPROM_Init
();
EEPROM_Init
();
...
@@ -113,7 +113,11 @@ void Sys_Startup_Init(void)
...
@@ -113,7 +113,11 @@ void Sys_Startup_Init(void)
d_printf
(
"Init complete!
\n
"
);
d_printf
(
"Init complete!
\n
"
);
InitSeriFlashExternReadMode
();
/*30电数据初始化*/
APP_Startup_Init
(
Clock_Get_Startup_Mode
());
APP_Startup_Init
(
Clock_Get_Startup_Mode
());
/*外发要用到EEP数据,位置移动*/
COM_CAN_Init
();
Gfx_Sys_Start
();
Gfx_Sys_Start
();
}
}
...
...
source/System/tasks.c
View file @
490dac50
...
@@ -137,6 +137,7 @@ void Sys_Run_Mode_5ms_Tasks(void)
...
@@ -137,6 +137,7 @@ void Sys_Run_Mode_5ms_Tasks(void)
------------------------------------------------------------------------------*/
------------------------------------------------------------------------------*/
void
Sys_Run_Mode_10ms_Tasks
(
void
)
void
Sys_Run_Mode_10ms_Tasks
(
void
)
{
{
DisplayServices
();
loc_Display_Service
();
loc_Display_Service
();
Data_Mileage_Write_EEPROM
();
Data_Mileage_Write_EEPROM
();
Line_In_Debounce_Service
();
Line_In_Debounce_Service
();
...
@@ -144,7 +145,7 @@ void Sys_Run_Mode_10ms_Tasks(void)
...
@@ -144,7 +145,7 @@ void Sys_Run_Mode_10ms_Tasks(void)
// Test_LED_AllLight();
// Test_LED_AllLight();
Key_Service
();
Key_Service
();
CAN_BUSOFF_Recover
();
CAN_BUSOFF_Recover
();
DisplayServices
();
/*表头调度函数 added by yutian*/
/*表头调度函数 added by yutian*/
UserGaugeSchedule
();
/*在主循环中调用*/
UserGaugeSchedule
();
/*在主循环中调用*/
/*end*/
/*end*/
...
...
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