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
7728ec5d
Commit
7728ec5d
authored
Jan 28, 2023
by
hu
Browse files
Options
Browse Files
Download
Plain Diff
解决合并冲突,按键好使分支合并
parents
ea51bf2d
37f6cfaa
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
312 additions
and
737 deletions
+312
-737
Application.gpj
ghs/group/Application.gpj
+2
-1
project.gpj
ghs/project.gpj
+1
-1
Data_Gear.c
source/Application/APP/Data_Gear/Data_Gear.c
+0
-51
Key.c
source/Application/APP/Key/Key.c
+0
-367
Key.h
source/Application/APP/Key/Key.h
+139
-132
Key_V1.3_1441.a
source/Application/APP/Key/Key_V1.3_1441.a
+0
-0
Key_user.c
source/Application/APP/Key/Key_user.c
+129
-95
Key_user.h
source/Application/APP/Key/Key_user.h
+10
-0
PowerManagement_user.c
...ce/Application/APP/PowerManagement/PowerManagement_user.c
+7
-1
SEG_DISPLAY.c
source/Application/APP/SEG_LCD/SEG_DISPLAY.c
+2
-1
Fuel_Calibration.h
source/Application/Gen_Tool/Fuel_Calibration.h
+1
-1
Menu_user.c
source/Application/Graphic/Menu/Menu_user.c
+2
-0
DisplaySch_user.c
source/Application/Graphic/UE/DisplaySch_user.c
+16
-30
kwp2000_protocol.c
source/Application/K_BUS/kwp2000_protocol.c
+1
-27
Common_Interface.c
source/Application/RTE/Common_Interface.c
+1
-29
Emulated_EEPROM_Access.c
source/Driver/Memory/Emulated_EEPROM_Access.c
+1
-1
No files found.
ghs/group/Application.gpj
View file @
7728ec5d
...
@@ -98,8 +98,9 @@
...
@@ -98,8 +98,9 @@
.\APP\GaugesMode\GaugesInterface.c
.\APP\GaugesMode\GaugesInterface.c
.\APP\GaugesMode\GaugesInterface.h
.\APP\GaugesMode\GaugesInterface.h
.\APP\Key\Key.h
.\APP\Key\Key.h
.\APP\Key\Key.c
.\APP\Key\Key_user.c
.\APP\Key\Key_user.c
.\APP\Key\Key_user.h
.\APP\Key\Key_V1.3_1441.a
.\APP\LINE_IN\Line_In.c
.\APP\LINE_IN\Line_In.c
.\APP\LINE_IN\Line_In.h
.\APP\LINE_IN\Line_In.h
.\APP\LINE_IN\Line_In_user.h
.\APP\LINE_IN\Line_In_user.h
...
...
ghs/project.gpj
View file @
7728ec5d
...
@@ -263,7 +263,7 @@ primaryTarget=v800_standalone.tgt
...
@@ -263,7 +263,7 @@ primaryTarget=v800_standalone.tgt
-rh850_4bytewordoffset
-rh850_4bytewordoffset
-reserve_r2
-reserve_r2
-DPlatform_32Bit
-DPlatform_32Bit
-O
general
-O
none
.\group\Application.gpj
.\group\Application.gpj
.\group\Driver.gpj
.\group\Driver.gpj
.\group\Graphic.gpj
.\group\Graphic.gpj
...
...
source/Application/APP/Data_Gear/Data_Gear.c
View file @
7728ec5d
...
@@ -43,35 +43,7 @@ void Data_Service_Gear_Processing(void)
...
@@ -43,35 +43,7 @@ void Data_Service_Gear_Processing(void)
{
{
Gear_Processing_Service
();
Gear_Processing_Service
();
}
}
/******************************************************************************
Function:Get_Gear_Mode_Type
Description:Get Gear P/R/N/D/M/S
Input:
Output: P/R/N/D/M/S
******************************************************************************/
uint8_t
Get_Gear_Mode_Type
(
void
)
{
}
/******************************************************************************
Get_Gear_Mode_UPDOWN_Number
Description:Get Gear 1/2/3/4/...
Input:
Output: 1/2/3/4/...
******************************************************************************/
uint8_t
Get_Gear_Mode_UPDOWN_Number
(
void
)
{
}
/******************************************************************************
Function:Get_Gear_Mode_Up_Down
Description:Get Gear UP/DOWN
Input:
Output: UP/DOWN
******************************************************************************/
uint8_t
Get_Gear_Mode_Up_Down
(
void
)
{
}
/******************************************************************************
/******************************************************************************
Function:Gear_Mode_Display
Function:Gear_Mode_Display
Description:
Description:
...
@@ -86,29 +58,6 @@ uint8_t Get_Gear_Mode_Display_Flash(void)
...
@@ -86,29 +58,6 @@ uint8_t Get_Gear_Mode_Display_Flash(void)
return
(
uint8_t
)
Gear_Status
;
return
(
uint8_t
)
Gear_Status
;
}
}
uint8_t
Get_Gear_Mode_M_A_Display
(
void
)
{
}
uint8_t
Get_Gear_Mode_P_E_Display
(
void
)
{
}
uint8_t
Get_Gear_Mode_L_C_Display
(
void
)
{
}
//-------------------------------------------
//档位 数据处理
//-------------------------------------------
//区域7显示逻辑
//-------------------------------------------
//344 - 3.2.档位显示
//-------------------------------------------
static
struct
static
struct
{
{
uint8_t
Number
;
//档位编号
uint8_t
Number
;
//档位编号
...
...
source/Application/APP/Key/Key.c
deleted
100644 → 0
View file @
ea51bf2d
#include "Key.h"
/*------------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------*/
/*-----按键服务函数调用周期。单位ms--------*/
#define KEY_CALL_CYCLE 10U
/*-----------------------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------------------*/
typedef
struct
{
uint16_t
u16KeyShortPressTime
;
/*¶Ì°´¼ì²âʱ¼ä*/
uint16_t
u16KeyLongPressTime
;
/*³¤°´¼ì²âʱ¼ä*/
uint16_t
u16KeySuperLongPressTime
;
/*³¬³¤°´¼ì²âʱ¼ä*/
uint16_t
u16KeyLoosenTime
;
/*ËÉ¿ª¼ì²âʱ¼ä*/
uint16_t
u16KeyValidOFFTime
;
/*ÓÐЧOFF¼ì²âʱ¼ä*/
uint16_t
u16KeyValidONTime
;
/*ÓÐЧON¼ì²âʱ¼ä*/
}
Key_Parameter_st_t
;
typedef
struct
{
Key_Real_Status_en_t
enKeyTypeLast
;
uint16_t
u16KeyInvalidTimeCount
;
uint16_t
u16KeyValidTimeCount
;
uint16_t
u16KeyFirstIGNTimeRecord
;
Key_IGN_en_t
enKeyIGNFirstStatus
;
Key_IGN_en_t
enKeyIGNStatusLast
;
uint8_t
u8KeyIGNChangeFlag
;
uint16_t
u16KeyIGNTimeCount
;
}
Key_Ctr_st_t
;
/*------------------------------------------------------------------------------------------*/
#pragma ghs section bss = ".myNonInitArea"
static
Key_Parameter_st_t
stKeyParameter
;
#pragma ghs section bss = default
static
Key_Ctr_st_t
stKeyCtrVariate
[
KEY_NUM_MAX
];
// static Key_IGN_en_t enKeyIGNFirstStatus = KEY_IG_INVALID;
// static Key_IGN_en_t enKeyIGNStatusLast = KEY_IG_INVALID;
// static uint8_t u8KeyIGNChangeFlag = 0U;
// static uint16_t u16KeyIGNTimeCount;
/*-----------------------------------------------------------------------------------------*/
static
void
Key_Process
(
Key_Num_en_t
enKeyIndex
);
void
Key_Service
(
void
);
void
Key_Init
(
void
);
Key_Set_en_t
Key_Parameter_Set_Short_Press_Time
(
uint16_t
u16Time
);
Key_Set_en_t
Key_Parameter_Set_Long_Press_Time
(
uint16_t
u16Time
);
Key_Set_en_t
Key_Parameter_Set_Super_Long_Press_Time
(
uint16_t
u16Time
);
Key_Set_en_t
Key_Parameter_Set_OFF_Press_Time
(
uint16_t
u16Time
);
Key_Set_en_t
Key_Parameter_Set_ON_Press_Time
(
uint16_t
u16Time
);
/*-----------------------------------------------------*/
static
void
Key_Process
(
Key_Num_en_t
enKeyIndex
)
{
if
(
enKeyIndex
<
KEY_NUM_MAX
)
{
/*Key_Real_Status_en_t enKeyRealType = (*stKeyAttribute[enKeyIndex].penKeyRealStatus);*/
Key_Real_Status_en_t
enKeyRealType
=
KEY_CAN_NONE
;
Key_IGN_en_t
enKeyIGNRealStatus
=
Key_Get_IGN_Status
();
if
(
stKeyAttribute
[
enKeyIndex
].
pfnKeyReadStatusCallBack
!=
0U
)
{
enKeyRealType
=
stKeyAttribute
[
enKeyIndex
].
pfnKeyReadStatusCallBack
();
}
/*CAN°´¼ü*/
if
(
stKeyAttribute
[
enKeyIndex
].
enKeyType
==
KEY_NO_DEBOUNCE_RISE
)
{
if
(
enKeyRealType
<=
KEY_CAN_LONG_PRESS_NOT_RELEASE
)
{
if
(
stKeyAttribute
[
enKeyIndex
].
pfnKeyOperationCallBack
!=
0U
)
{
if
((
stKeyCtrVariate
[
enKeyIndex
].
enKeyTypeLast
==
KEY_CAN_NONE
)
&&
(
enKeyRealType
==
KEY_CAN_SHORT_PRESS
))
{
stKeyAttribute
[
enKeyIndex
].
pfnKeyOperationCallBack
(
KEY_EVENT_SHORT_PRESS
);
}
else
if
((
stKeyCtrVariate
[
enKeyIndex
].
enKeyTypeLast
==
KEY_CAN_NONE
)
&&
(
enKeyRealType
==
KEY_CAN_LONG_PRESS
))
{
stKeyAttribute
[
enKeyIndex
].
pfnKeyOperationCallBack
(
KEY_EVENT_LONG_PRESS
);
}
else
if
((
stKeyCtrVariate
[
enKeyIndex
].
enKeyTypeLast
==
KEY_CAN_NONE
)
&&
(
enKeyRealType
==
KEY_CAN_LONG_PRESS_NOT_RELEASE
))
{
stKeyAttribute
[
enKeyIndex
].
pfnKeyOperationCallBack
(
KEY_EVENT_SUPER_LONG_PRESS
);
}
else
{
stKeyAttribute
[
enKeyIndex
].
pfnKeyOperationCallBack
(
KEY_EVENT_NONE
);
}
}
stKeyCtrVariate
[
enKeyIndex
].
enKeyTypeLast
=
enKeyRealType
;
}
else
{
stKeyCtrVariate
[
enKeyIndex
].
enKeyTypeLast
=
KEY_CAN_NONE
;
}
}
else
if
(
stKeyAttribute
[
enKeyIndex
].
enKeyType
==
KEY_NO_DEBOUNCE_FALL
)
{
if
(
enKeyRealType
<=
KEY_CAN_LONG_PRESS_NOT_RELEASE
)
{
if
(
stKeyAttribute
[
enKeyIndex
].
pfnKeyOperationCallBack
!=
0U
)
{
if
((
stKeyCtrVariate
[
enKeyIndex
].
enKeyTypeLast
==
KEY_CAN_SHORT_PRESS
)
&&
(
enKeyRealType
==
KEY_CAN_NONE
))
{
stKeyAttribute
[
enKeyIndex
].
pfnKeyOperationCallBack
(
KEY_EVENT_SHORT_PRESS
);
}
else
if
((
stKeyCtrVariate
[
enKeyIndex
].
enKeyTypeLast
==
KEY_CAN_LONG_PRESS
)
&&
(
enKeyRealType
==
KEY_CAN_NONE
))
{
stKeyAttribute
[
enKeyIndex
].
pfnKeyOperationCallBack
(
KEY_EVENT_LONG_PRESS
);
}
else
if
((
stKeyCtrVariate
[
enKeyIndex
].
enKeyTypeLast
==
KEY_CAN_LONG_PRESS_NOT_RELEASE
)
&&
(
enKeyRealType
==
KEY_CAN_NONE
))
{
stKeyAttribute
[
enKeyIndex
].
pfnKeyOperationCallBack
(
KEY_EVENT_SUPER_LONG_PRESS
);
}
else
{
stKeyAttribute
[
enKeyIndex
].
pfnKeyOperationCallBack
(
KEY_EVENT_NONE
);
}
}
stKeyCtrVariate
[
enKeyIndex
].
enKeyTypeLast
=
enKeyRealType
;
}
else
{
stKeyCtrVariate
[
enKeyIndex
].
enKeyTypeLast
=
KEY_CAN_NONE
;
}
}
/*Ó²Ïß°´¼ü*/
else
if
(
stKeyAttribute
[
enKeyIndex
].
enKeyType
==
KEY_NEED_DEBOUNCE_NORMAL
)
{
if
(
enKeyRealType
==
KEY_LINE_LOOSEN
)
/*空闲*/
{
if
(
stKeyCtrVariate
[
enKeyIndex
].
u16KeyInvalidTimeCount
<=
stKeyParameter
.
u16KeyLoosenTime
)
{
stKeyCtrVariate
[
enKeyIndex
].
u16KeyInvalidTimeCount
+=
KEY_CALL_CYCLE
;
}
else
{
stKeyCtrVariate
[
enKeyIndex
].
u16KeyValidTimeCount
=
0U
;
stKeyCtrVariate
[
enKeyIndex
].
enKeyTypeLast
=
KEY_LINE_LOOSEN
;
stKeyCtrVariate
[
enKeyIndex
].
u16KeyFirstIGNTimeRecord
=
0U
;
stKeyCtrVariate
[
enKeyIndex
].
enKeyIGNFirstStatus
=
KEY_IG_INVALID
;
stKeyCtrVariate
[
enKeyIndex
].
enKeyIGNStatusLast
=
KEY_IG_INVALID
;
stKeyCtrVariate
[
enKeyIndex
].
u8KeyIGNChangeFlag
=
0U
;
stKeyCtrVariate
[
enKeyIndex
].
u16KeyIGNTimeCount
=
0U
;
}
if
((
stKeyCtrVariate
[
enKeyIndex
].
u16KeyInvalidTimeCount
>=
stKeyParameter
.
u16KeyLoosenTime
)
&&
(
stKeyCtrVariate
[
enKeyIndex
].
u16KeyValidTimeCount
>=
stKeyParameter
.
u16KeyShortPressTime
)
&&
(
stKeyCtrVariate
[
enKeyIndex
].
u16KeyValidTimeCount
<
stKeyParameter
.
u16KeyLongPressTime
))
{
stKeyCtrVariate
[
enKeyIndex
].
u16KeyValidTimeCount
=
0U
;
/* call back */
if
(
stKeyAttribute
[
enKeyIndex
].
pfnKeyOperationCallBack
!=
0U
)
{
stKeyAttribute
[
enKeyIndex
].
pfnKeyOperationCallBack
(
KEY_EVENT_SHORT_PRESS
);
}
}
}
else
if
(
enKeyRealType
==
KEY_LINE_PRESS
)
/*按键按下*/
{
if
(
stKeyCtrVariate
[
enKeyIndex
].
enKeyTypeLast
!=
enKeyRealType
)
{
stKeyCtrVariate
[
enKeyIndex
].
u16KeyValidTimeCount
=
0U
;
stKeyCtrVariate
[
enKeyIndex
].
u16KeyFirstIGNTimeRecord
=
0U
;
stKeyCtrVariate
[
enKeyIndex
].
enKeyTypeLast
=
enKeyRealType
;
stKeyCtrVariate
[
enKeyIndex
].
u16KeyIGNTimeCount
=
0U
;
stKeyCtrVariate
[
enKeyIndex
].
enKeyIGNFirstStatus
=
enKeyIGNRealStatus
;
stKeyCtrVariate
[
enKeyIndex
].
enKeyIGNStatusLast
=
enKeyIGNRealStatus
;
}
else
{
if
(
stKeyCtrVariate
[
enKeyIndex
].
enKeyIGNStatusLast
!=
enKeyIGNRealStatus
)
{
stKeyCtrVariate
[
enKeyIndex
].
enKeyIGNStatusLast
=
enKeyIGNRealStatus
;
if
(
stKeyCtrVariate
[
enKeyIndex
].
enKeyIGNFirstStatus
!=
enKeyIGNRealStatus
)
{
stKeyCtrVariate
[
enKeyIndex
].
u16KeyFirstIGNTimeRecord
=
stKeyCtrVariate
[
enKeyIndex
].
u16KeyIGNTimeCount
;
}
stKeyCtrVariate
[
enKeyIndex
].
u16KeyIGNTimeCount
=
0U
;
}
else
{
if
(
stKeyCtrVariate
[
enKeyIndex
].
u16KeyIGNTimeCount
<
0xFFF0U
)
{
stKeyCtrVariate
[
enKeyIndex
].
u16KeyIGNTimeCount
+=
KEY_CALL_CYCLE
;
}
}
if
(
stKeyCtrVariate
[
enKeyIndex
].
u16KeyValidTimeCount
<
0xFFF0U
)
{
stKeyCtrVariate
[
enKeyIndex
].
u16KeyValidTimeCount
+=
KEY_CALL_CYCLE
;
}
if
(
stKeyCtrVariate
[
enKeyIndex
].
enKeyIGNFirstStatus
!=
enKeyIGNRealStatus
)
{
stKeyCtrVariate
[
enKeyIndex
].
u8KeyIGNChangeFlag
=
1U
;
}
if
(
stKeyCtrVariate
[
enKeyIndex
].
u16KeyValidTimeCount
>=
stKeyParameter
.
u16KeyShortPressTime
)
{
// stKeyCtrVariate[enKeyIndex].u16KeyInvalidTimeCount = 0U;
}
stKeyCtrVariate
[
enKeyIndex
].
u16KeyInvalidTimeCount
=
0U
;
if
(
stKeyCtrVariate
[
enKeyIndex
].
u8KeyIGNChangeFlag
==
0U
)
{
if
(
stKeyCtrVariate
[
enKeyIndex
].
u16KeyValidTimeCount
>=
stKeyParameter
.
u16KeySuperLongPressTime
)
{
if
(
stKeyAttribute
[
enKeyIndex
].
pfnKeyOperationCallBack
!=
0U
)
{
stKeyAttribute
[
enKeyIndex
].
pfnKeyOperationCallBack
(
KEY_EVENT_SUPER_LONG_PRESS
);
}
}
else
if
(
stKeyCtrVariate
[
enKeyIndex
].
u16KeyValidTimeCount
>=
stKeyParameter
.
u16KeyLongPressTime
)
{
if
(
stKeyAttribute
[
enKeyIndex
].
pfnKeyOperationCallBack
!=
0U
)
{
stKeyAttribute
[
enKeyIndex
].
pfnKeyOperationCallBack
(
KEY_EVENT_LONG_PRESS
);
}
}
}
else
{
if
(
stKeyCtrVariate
[
enKeyIndex
].
enKeyIGNFirstStatus
==
KEY_IG_OFF
)
{
if
(
enKeyIGNRealStatus
==
KEY_IG_ON
)
{
if
((
stKeyCtrVariate
[
enKeyIndex
].
u16KeyFirstIGNTimeRecord
>=
stKeyParameter
.
u16KeyValidOFFTime
)
&&
(
stKeyCtrVariate
[
enKeyIndex
].
u16KeyIGNTimeCount
>=
stKeyParameter
.
u16KeyValidONTime
))
{
if
(
stKeyAttribute
[
enKeyIndex
].
pfnKeyOperationCallBack
!=
0U
)
{
stKeyAttribute
[
enKeyIndex
].
pfnKeyOperationCallBack
(
KEY_EVENT_OFF_TO_ON
);
}
stKeyCtrVariate
[
enKeyIndex
].
u16KeyFirstIGNTimeRecord
=
0U
;
}
}
}
else
if
(
stKeyCtrVariate
[
enKeyIndex
].
enKeyIGNFirstStatus
==
KEY_IG_ON
)
{
if
(
enKeyIGNRealStatus
==
KEY_IG_OFF
)
{
if
((
stKeyCtrVariate
[
enKeyIndex
].
u16KeyFirstIGNTimeRecord
>=
stKeyParameter
.
u16KeyValidONTime
)
&&
(
stKeyCtrVariate
[
enKeyIndex
].
u16KeyIGNTimeCount
>=
stKeyParameter
.
u16KeyValidOFFTime
))
{
if
(
stKeyAttribute
[
enKeyIndex
].
pfnKeyOperationCallBack
!=
0U
)
{
stKeyAttribute
[
enKeyIndex
].
pfnKeyOperationCallBack
(
KEY_EVENT_ON_TO_OFF
);
}
stKeyCtrVariate
[
enKeyIndex
].
u16KeyFirstIGNTimeRecord
=
0U
;
}
}
}
}
}
}
else
{
/*ERROR*/
stKeyCtrVariate
[
enKeyIndex
].
u16KeyInvalidTimeCount
=
0U
;
stKeyCtrVariate
[
enKeyIndex
].
u16KeyValidTimeCount
=
0U
;
stKeyCtrVariate
[
enKeyIndex
].
enKeyTypeLast
=
(
Key_Real_Status_en_t
)
0U
;
}
}
else
{
}
}
}
/*10ms调用一次*/
void
Key_Service
(
void
)
{
uint8_t
i
=
0U
;
for
(
i
=
0U
;
i
<
KEY_NUM_MAX
;
i
++
)
{
Key_Process
((
Key_Num_en_t
)
i
);
/*Key_Num_en_t*/
}
}
/*首次上电时调用一次即可*/
void
Key_Init
(
void
)
{
uint8_t
i
=
0U
;
for
(
i
=
0U
;
i
<
KEY_NUM_MAX
;
i
++
)
{
stKeyCtrVariate
[
i
].
enKeyTypeLast
=
KEY_CAN_NONE
;
stKeyCtrVariate
[
i
].
u16KeyInvalidTimeCount
=
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
;
}
/*按键动作时间*/
/*342 4.1 短按/长按操作的判断标准(判定时间):短按;40ms以上,未到800ms,长按;800ms以上*/
stKeyParameter
.
u16KeyLoosenTime
=
100U
;
stKeyParameter
.
u16KeyShortPressTime
=
80U
;
stKeyParameter
.
u16KeyLongPressTime
=
1000U
;
stKeyParameter
.
u16KeySuperLongPressTime
=
3000U
;
stKeyParameter
.
u16KeyValidOFFTime
=
200U
;
/*按键动作时间*/
stKeyParameter
.
u16KeyValidONTime
=
1000U
;
}
/*对于硬线按键而言,判断短按的时间参数*/
Key_Set_en_t
Key_Parameter_Set_Short_Press_Time
(
uint16_t
u16Time
)
{
Key_Set_en_t
enKeySetResult
=
KEY_SET_OK
;
if
(
u16Time
<
stKeyParameter
.
u16KeyLoosenTime
)
{
enKeySetResult
=
KEY_SET_ERROR
;
}
else
if
(
u16Time
>
stKeyParameter
.
u16KeyLongPressTime
)
{
enKeySetResult
=
KEY_SET_ERROR
;
}
else
{
stKeyParameter
.
u16KeyShortPressTime
=
u16Time
;
}
return
enKeySetResult
;
}
/*对于硬线按键而言,判断长按的时间参数*/
Key_Set_en_t
Key_Parameter_Set_Long_Press_Time
(
uint16_t
u16Time
)
{
Key_Set_en_t
enKeySetResult
=
KEY_SET_OK
;
if
(
u16Time
<
stKeyParameter
.
u16KeyShortPressTime
)
{
enKeySetResult
=
KEY_SET_ERROR
;
}
else
if
(
u16Time
>
stKeyParameter
.
u16KeySuperLongPressTime
)
{
enKeySetResult
=
KEY_SET_ERROR
;
}
else
{
stKeyParameter
.
u16KeyLongPressTime
=
u16Time
;
}
return
enKeySetResult
;
}
/*对于硬线按键而言,判断超长按的时间参数*/
Key_Set_en_t
Key_Parameter_Set_Super_Long_Press_Time
(
uint16_t
u16Time
)
{
Key_Set_en_t
enKeySetResult
=
KEY_SET_OK
;
if
(
u16Time
<
stKeyParameter
.
u16KeyLongPressTime
)
{
enKeySetResult
=
KEY_SET_ERROR
;
}
else
{
stKeyParameter
.
u16KeySuperLongPressTime
=
u16Time
;
}
return
enKeySetResult
;
}
source/Application/APP/Key/Key.h
View file @
7728ec5d
#ifndef KEY_H__
#ifndef KEY_H__
#define KEY_H__
#define KEY_H__
//#define KEY_PLATFORM_16BIT
#include "TYW_stdint.h"
#ifdef KEY_PLATFORM_16BIT
typedef
unsigned
char
Key_uint8_t
;
/*
typedef
unsigned
int
Key_uint16_t
;
说明:
typedef
unsigned
long
Key_uint32_t
;
1、按键类型分为两类:
#else
1)CAN按键。
typedef
unsigned
char
Key_uint8_t
;
2)单纯硬线按键,AD按键。
typedef
unsigned
short
Key_uint16_t
;
2、按键触发时间:
typedef
unsigned
int
Key_uint32_t
;
1)短按动作在抬手时触发、
typedef
unsigned
long
long
Key_uint64_t
;
2)长按动作(或超长按)在时间达到,按住时就可触发。
#endif
3)OFF到ON(或ON到OFF)在各个电源状态时按键按下时间满足后即可触发,不必抬手。
/*所有按键枚举*/
/*默认所有按键在任意电源状态下均可被触发*/
*/
/*所有按键枚举,目前最多支持8个按键*/
typedef
enum
typedef
enum
{
{
KEY_UP
=
0U
,
KEY_UP
=
0U
,
...
@@ -24,110 +22,119 @@ typedef enum
...
@@ -24,110 +22,119 @@ typedef enum
KEY_MENU
,
KEY_MENU
,
KEY_ODOTRIP
,
KEY_ODOTRIP
,
KEY_NUM_MAX
,
KEY_NUM_MAX
,
}
Key_Num_en_t
;
}
Key_Num_en_t
;
/*--------------------------Do not modify the following--------------------------------*/
/*--------------------------Do not modify the following--------------------------------*/
/*--------------------------Do not modify the following--------------------------------*/
/*--------------------------Do not modify the following--------------------------------*/
/*--------------------------Do not modify the following--------------------------------*/
/*--------------------------Do not modify the following--------------------------------*/
#define KEY_RAM_DATA_LEN (KEY_NUM_MAX * 16U + 24U)
typedef
enum
typedef
enum
{
{
// KEY_TYPE_CAN = 0U, /*CAN按键。按键不需要消抖*/
// KEY_TYPE_LINE, /*硬线按键,包含AD按键。按键需要消抖*/
/*按键检测方式选择*/
/*按键检测方式选择*/
KEY_NO_DEBOUNCE_RISE
=
0U
,
/*按键不需要消抖,并且在无效状态切换到有效状态的上升沿触发按键动作*/
/*按键不需要消抖,并且在无效状态切换到有效状态的上升沿触发按键动作。
KEY_NO_DEBOUNCE_FALL
,
/*按键不需要消抖,并且在有效状态切换到无效状态的下降沿触发按键动作*/
一般用于CAN发送按键处理后状态时*/
KEY_NO_DEBOUNCE_RISE
=
0U
,
KEY_NEED_DEBOUNCE_NORMAL
,
/*按键需要消抖,短按松手触发,长按,超超按,按住即可触发*/
/*按键不需要消抖,并且在有效状态切换到无效状态的下降沿触发按键动作。
一般用于CAN发送按键处理后状态时*/
KEY_NO_DEBOUNCE_FALL
,
/*按键需要消抖,短按松手触发,长按按住即可触发。
一般用于硬线按键,AD按键,CAN发送按键实时状态时*/
KEY_NEED_DEBOUNCE_NORMAL
,
KEY_TYPE_MAX
,
KEY_TYPE_MAX
,
}
Key_Type_en_t
;
}
Key_Type_en_t
;
/*按键相关设置返回状态*/
/*按键相关设置返回状态*/
typedef
enum
typedef
enum
{
{
KEY_SET_OK
=
0U
,
KEY_SET_OK
=
0U
,
KEY_SET_ERROR
,
KEY_SET_ERROR
,
KEY_SET_MAX
,
KEY_SET_MAX
,
}
Key_Set_en_t
;
}
Key_Set_en_t
;
/*按键IG状态*/
/*-----传入的按键状态--------*/
typedef
enum
{
KEY_IG_INVALID
=
0U
,
KEY_IG_OFF
,
KEY_IG_ON
,
}
Key_IGN_en_t
;
/*-----实时传入的键值--------*/
typedef
enum
typedef
enum
{
{
/*当按键检测方式选择需要消抖时使用*/
KEY_CAN_NONE
=
0U
,
/*CAN按键时,按键无动作*/
KEY_REALTIME_LOOSEN
=
0U
,
/*按键松开*/
KEY_CAN_SHORT_PRESS
,
/*CAN按键时,按键短按动作*/
KEY_REALTIME_PRESS
,
/*按键按下*/
KEY_CAN_LONG_PRESS
,
/*CAN按键时,按键长按动作*/
/*当按键检测方式选择不需要消抖时使用*/
KEY_CAN_LONG_PRESS_NOT_RELEASE
,
/*CAN按键时,按键长按不松手动作,触发动作超长按*/
KEY_STATUS_IDLE
,
KEY_STATUS_SHORT_PRESS_1
,
KEY_LINE_PRESS
,
/*硬线按键时,按键按下*/
KEY_STATUS_SHORT_PRESS_2
,
KEY_LINE_LOOSEN
,
/*硬线按键时,按键松开*/
KEY_STATUS_LONG_PRESS_1
,
KEY_STATUS_LONG_PRESS_2
,
KEY_REAL_STATUS_MAX
,
KEY_STATUS_LONG_PRESS_3
,
KEY_STATUS_LONG_PRESS_4
,
}
Key_Real_Status_en_t
;
KEY_STATUS_MAX
,
}
Key_Status_en_t
;
/*按键支持的具体动作*/
/*按键支持的具体动作*/
typedef
enum
typedef
enum
{
{
KEY_EVENT_NONE
=
0U
,
KEY_EVENT_NONE
=
0U
,
/***超时动作可在这个按键动作下自行计时触发**/
KEY_EVENT_SHORT_PRESS
,
/*以下按键动作都是单次触发,只有松手后才能再次触发*/
KEY_EVENT_LONG_PRESS
,
KEY_EVENT_SHORT_PRESS_1
,
KEY_EVENT_SUPER_LONG_PRESS
,
KEY_EVENT_SHORT_PRESS_2
,
KEY_EVENT_LONG_PRESS_1
,
KEY_EVENT_LONG_PRESS_2
,
KEY_EVENT_LONG_PRESS_3
,
KEY_EVENT_LONG_PRESS_4
,
/*OFF时才首先按下按键,然后不松手,之后切换到ON并持续一定时间后触发动作。*/
KEY_EVENT_OFF_TO_ON
,
KEY_EVENT_OFF_TO_ON
,
KEY_EVENT_ON_TO_OFF
,
KEY_EVENT_ON_TO_OFF
,
KEY_EVENT_MAX
,
KEY_EVENT_MAX
,
}
Key_Event_en_t
;
}
Key_Event_en_t
;
/*按键IG状态*/
typedef
struct
typedef
enum
{
{
uint32_t
u32KeyRAMAddr
;
/* 数据缓冲地址 */
KEY_IG_INVALID
=
0U
,
/***无效的电源状态**/
uint16_t
u16KeyRAMLen
;
/* 数据缓冲大小:以uint32_t为单位*/
KEY_IG_OFF
,
}
Key_RAM_Attribute_st_t
;
KEY_IG_ON
,
}
Key_IGN_en_t
;
typedef
Key_
Real_Status_en_t
(
*
Key_Real_Status_Read
)(
void
);
typedef
Key_
Status_en_t
(
*
Key_Status_Read
)(
void
);
typedef
void
(
*
Key_Operation
)(
Key_Event_en_t
enKeyEvent
);
typedef
void
(
*
Key_Operation
)(
Key_Event_en_t
enKeyEvent
);
/*每个按键的属性*/
/*每个按键的属性*/
typedef
struct
typedef
struct
{
{
/*按键类型,是CAN的还是硬线的*/
/*按键检测方式选择*/
Key_Type_en_t
enKeyType
;
Key_Type_en_t
enKeyType
;
/*获取按键实时状态的回调函数*/
/*获取按键传入状态的回调函数*/
Key_Real_Status_Read
pfnKeyReadStatusCallBack
;
Key_Status_Read
pfnKeyReadStatusCallBack
;
/*按键触发动作的回调函数*/
/*按键触发动作的回调函数*/
Key_Operation
pfnKeyOperationCallBack
;
Key_Operation
pfnKeyOperationCallBack
;
}
Key_Attribute_st_t
;
}
Key_Attribute_st_t
;
typedef
struct
{
/*当前IG状态*/
Key_IGN_en_t
enKeyIGNRealStatus
;
/*按键数量,也就是KEY_NUM_MAX*/
Key_uint8_t
u8KeyNum
;
}
Key_Init_st_t
;
/*--------------------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------------------*/
extern
const
Key_Attribute_st_t
stKeyAttribute
[
KEY_NUM_MAX
];
/*------------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------------*/
/*10ms调用一次*/
/*10ms调用一次*/
extern
void
Key_Service
(
void
);
extern
void
Key_Service
(
void
);
/*首次上电时调用一次即可*/
/*首次上电时调用.
extern
void
Key_Init
(
void
);
默认短按1时间100ms~~1000ms,
/*对于硬线按键而言,判断短按的时间参数*/
默认短按2时间1100ms~~2000ms,
extern
Key_Set_en_t
Key_Parameter_Set_Short_Press_Time
(
uint16_t
u16Time
);
长按1时间2000ms,
/*对于硬线按键而言,判断长按的时间参数*/
长按2时间10000ms,
extern
Key_Set_en_t
Key_Parameter_Set_Long_Press_Time
(
uint16_t
u16Time
);
长按3时间30000ms,
/*对于硬线按键而言,判断超长按的时间参数*/
长按4时间60000ms,
extern
Key_Set_en_t
Key_Parameter_Set_Super_Long_Press_Time
(
uint16_t
u16Time
);
OFF下时间500ms,ON下时间500ms*/
/*获取IG状态*/
extern
void
Key_KL30_Init
(
Key_uint8_t
*
pu8KyeRamData
,
const
Key_Attribute_st_t
*
pstKeyAttribute
,
Key_Init_st_t
*
pstKeyInit
);
extern
Key_IGN_en_t
Key_Get_IGN_Status
(
void
);
/***确保传入的内存指针在休眠唤醒后不会丢失,那么可正常使用唤醒初始化函数。否是使用上述KL30初始化**/
extern
void
Key_Wakeup_Init
(
Key_uint8_t
*
pu8KyeRamData
,
const
Key_Attribute_st_t
*
pstKeyAttribute
,
Key_Init_st_t
*
pstKeyInit
);
extern
uint8_t
Common_Get_RetMenu_Flag
(
void
);
/*对于消抖按键而言,判断短按的时间参数。
u16TimeMin :最小识别的时间 u16TimeMax:最大识别的时间 (不可大于短按2的最小识别时间)*/
extern
Key_Set_en_t
Key_Parameter_Set_Short_Press_1_Time
(
Key_uint16_t
u16TimeMin
,
Key_uint16_t
u16TimeMax
);
/*对于消抖按键而言,判断短按2的时间参数。
u16TimeMin :最小识别的时间(不可小于短按1的最大识别时间) u16TimeMax:最大识别的时间*/
extern
Key_Set_en_t
Key_Parameter_Set_Short_Press_2_Time
(
Key_uint16_t
u16TimeMin
,
Key_uint16_t
u16TimeMax
);
/*对于消抖按键而言,判断长按1的时间参数。不可大于长按2的时间*/
extern
Key_Set_en_t
Key_Parameter_Set_Long_Press_1_Time
(
Key_uint16_t
u16Time
);
/*对于消抖按键而言,判断长按2的时间参数。不可小于长按1的时间,不可大于长按3的时间*/
extern
Key_Set_en_t
Key_Parameter_Set_Long_Press_2_Time
(
Key_uint16_t
u16Time
);
/*对于消抖按键而言,判断长按3的时间参数。不可小于长按2的时间,不可大于长按4的时间*/
extern
Key_Set_en_t
Key_Parameter_Set_Long_Press_3_Time
(
Key_uint16_t
u16Time
);
/*对于消抖按键而言,判断长按4的时间参数。不可小于长按3的时间*/
extern
Key_Set_en_t
Key_Parameter_Set_Long_Press_4_Time
(
Key_uint16_t
u16Time
);
/*设置电源状态给按键,单次调用或者多次调用均可*/
extern
void
Key_Set_IG_Status
(
Key_IGN_en_t
enIGStatus
);
#endif
#endif
\ No newline at end of file
source/Application/APP/Key/Key_V1.3_1441.a
0 → 100644
View file @
7728ec5d
File added
source/Application/APP/Key/Key_user.c
View file @
7728ec5d
...
@@ -14,9 +14,16 @@
...
@@ -14,9 +14,16 @@
#include "kwp2000_service.h"
#include "kwp2000_service.h"
#include "CAN_Communication_Matrix.h"
#include "CAN_Communication_Matrix.h"
<<<<<<<
HEAD
#include "UDS_Common.h"
#include "UDS_Common.h"
=======
#include "SEG_DISPLAY.h"
>>>>>>>
development
/*----------按键具体功能执行的回调函数-----------------------*/
/*----------按键具体功能执行的回调函数-----------------------*/
#pragma ghs section bss=".myNonInitArea"
Key_uint8_t
u8KeyRamData
[
KEY_RAM_DATA_LEN
];
#pragma ghs section bss=default
void
Key_Operation_Enter
(
Key_Event_en_t
enKeyEvent
);
void
Key_Operation_Enter
(
Key_Event_en_t
enKeyEvent
);
void
Key_Operation_Return
(
Key_Event_en_t
enKeyEvent
);
void
Key_Operation_Return
(
Key_Event_en_t
enKeyEvent
);
...
@@ -25,8 +32,6 @@ void Key_Operation_Down(Key_Event_en_t enKeyEvent);
...
@@ -25,8 +32,6 @@ void Key_Operation_Down(Key_Event_en_t enKeyEvent);
void
Key_Operation_Menu
(
Key_Event_en_t
enKeyEvent
);
void
Key_Operation_Menu
(
Key_Event_en_t
enKeyEvent
);
void
Key_Operation_ODOTrip
(
Key_Event_en_t
enKeyEvent
);
void
Key_Operation_ODOTrip
(
Key_Event_en_t
enKeyEvent
);
Key_IGN_en_t
Key_Get_IGN_Status
(
void
);
/*******************************UP***********************************************
/*******************************UP***********************************************
Function: Key_Operation_Up
Function: Key_Operation_Up
Description:
Description:
...
@@ -51,7 +56,7 @@ void Key_Operation_Up(Key_Event_en_t enKeyEvent)
...
@@ -51,7 +56,7 @@ void Key_Operation_Up(Key_Event_en_t enKeyEvent)
/*----无车速,无报警----*/
/*----无车速,无报警----*/
if
(
HMI_MENU_Sta
!=
Display_Alarm
)
if
(
HMI_MENU_Sta
!=
Display_Alarm
)
{
{
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
_1
)
{
{
/*主界面 一级菜单 二级菜单*/
/*主界面 一级菜单 二级菜单*/
if
(((
bCurMenuIDX
>=
_MN_DSP_LEVEL1MENU_1
)
&&
(
bCurMenuIDX
<=
_MN_DSP_LEVEL2_6_MENU_2
))
||
if
(((
bCurMenuIDX
>=
_MN_DSP_LEVEL1MENU_1
)
&&
(
bCurMenuIDX
<=
_MN_DSP_LEVEL2_6_MENU_2
))
||
...
@@ -351,7 +356,7 @@ void Key_Operation_Up(Key_Event_en_t enKeyEvent)
...
@@ -351,7 +356,7 @@ void Key_Operation_Up(Key_Event_en_t enKeyEvent)
;
/*Do Nothing!*/
;
/*Do Nothing!*/
}
}
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
_1
)
{
{
MenuFlag
.
Menu_Key_Time
++
;
MenuFlag
.
Menu_Key_Time
++
;
if
(
MenuFlag
.
Menu_Key_Time
>
10
)
if
(
MenuFlag
.
Menu_Key_Time
>
10
)
...
@@ -460,11 +465,11 @@ void Key_Operation_Up(Key_Event_en_t enKeyEvent)
...
@@ -460,11 +465,11 @@ void Key_Operation_Up(Key_Event_en_t enKeyEvent)
/*----无车速,有报警----*/
/*----无车速,有报警----*/
else
else
{
{
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
_1
)
{
{
;
/*D0 Nothing!*/
;
/*D0 Nothing!*/
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
_1
)
{
{
;
/*D0 Nothing!*/
;
/*D0 Nothing!*/
}
}
...
@@ -475,7 +480,7 @@ void Key_Operation_Up(Key_Event_en_t enKeyEvent)
...
@@ -475,7 +480,7 @@ void Key_Operation_Up(Key_Event_en_t enKeyEvent)
/*----有车速,无报警----*/
/*----有车速,无报警----*/
if
(
HMI_MENU_Sta
!=
Display_Alarm
)
if
(
HMI_MENU_Sta
!=
Display_Alarm
)
{
{
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
_1
)
{
{
/*工厂模式*/
/*经销商模式*/
/*工厂模式*/
/*经销商模式*/
if
(((
bCurMenuIDX
>=
_FAC_DSP_LEVEL1MENU_1
)
&&
(
bCurMenuIDX
<=
_FAC_DSP_LEVEL1_3MENU_2
))
||
if
(((
bCurMenuIDX
>=
_FAC_DSP_LEVEL1MENU_1
)
&&
(
bCurMenuIDX
<=
_FAC_DSP_LEVEL1_3MENU_2
))
||
...
@@ -502,7 +507,7 @@ void Key_Operation_Up(Key_Event_en_t enKeyEvent)
...
@@ -502,7 +507,7 @@ void Key_Operation_Up(Key_Event_en_t enKeyEvent)
;
/*Do Nothing!*/
;
/*Do Nothing!*/
}
}
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
_1
)
{
{
;
/*D0 Nothing!*/
;
/*D0 Nothing!*/
}
}
...
@@ -510,11 +515,11 @@ void Key_Operation_Up(Key_Event_en_t enKeyEvent)
...
@@ -510,11 +515,11 @@ void Key_Operation_Up(Key_Event_en_t enKeyEvent)
/*----有车速,有报警----*/
/*----有车速,有报警----*/
else
else
{
{
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
_1
)
{
{
;
/*D0 Nothing!*/
;
/*D0 Nothing!*/
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
_1
)
{
{
;
/*D0 Nothing!*/
;
/*D0 Nothing!*/
}
}
...
@@ -543,7 +548,7 @@ void Key_Operation_Down(Key_Event_en_t enKeyEvent)
...
@@ -543,7 +548,7 @@ void Key_Operation_Down(Key_Event_en_t enKeyEvent)
/*----无车速,无报警----*/
/*----无车速,无报警----*/
if
(
HMI_MENU_Sta
!=
Display_Alarm
)
if
(
HMI_MENU_Sta
!=
Display_Alarm
)
{
{
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
_1
)
{
{
/*主界面 一级菜单 二级菜单*/
/*主界面 一级菜单 二级菜单*/
if
(((
bCurMenuIDX
>=
_MN_DSP_LEVEL1MENU_1
)
&&
(
bCurMenuIDX
<=
_MN_DSP_LEVEL2_6_MENU_2
))
||
if
(((
bCurMenuIDX
>=
_MN_DSP_LEVEL1MENU_1
)
&&
(
bCurMenuIDX
<=
_MN_DSP_LEVEL2_6_MENU_2
))
||
...
@@ -858,7 +863,7 @@ void Key_Operation_Down(Key_Event_en_t enKeyEvent)
...
@@ -858,7 +863,7 @@ void Key_Operation_Down(Key_Event_en_t enKeyEvent)
;
/*Do Nothing!*/
;
/*Do Nothing!*/
}
}
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
_1
)
{
{
MenuFlag
.
Menu_Key_Time
++
;
MenuFlag
.
Menu_Key_Time
++
;
if
(
MenuFlag
.
Menu_Key_Time
>
10
)
if
(
MenuFlag
.
Menu_Key_Time
>
10
)
...
@@ -974,11 +979,11 @@ void Key_Operation_Down(Key_Event_en_t enKeyEvent)
...
@@ -974,11 +979,11 @@ void Key_Operation_Down(Key_Event_en_t enKeyEvent)
else
else
{
{
/*----无车速,有报警----*/
/*----无车速,有报警----*/
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
_1
)
{
{
;
/*D0 Nothing!*/
;
/*D0 Nothing!*/
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
_1
)
{
{
;
/*D0 Nothing!*/
;
/*D0 Nothing!*/
}
}
...
@@ -989,7 +994,7 @@ void Key_Operation_Down(Key_Event_en_t enKeyEvent)
...
@@ -989,7 +994,7 @@ void Key_Operation_Down(Key_Event_en_t enKeyEvent)
/*----有车速,无报警----*/
/*----有车速,无报警----*/
if
(
HMI_MENU_Sta
!=
Display_Alarm
)
if
(
HMI_MENU_Sta
!=
Display_Alarm
)
{
{
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
_1
)
{
{
/*工厂模式*/
/*经销商模式*/
/*工厂模式*/
/*经销商模式*/
if
(((
bCurMenuIDX
>=
_FAC_DSP_LEVEL1MENU_1
)
&&
(
bCurMenuIDX
<=
_FAC_DSP_LEVEL1_3MENU_2
))
||
if
(((
bCurMenuIDX
>=
_FAC_DSP_LEVEL1MENU_1
)
&&
(
bCurMenuIDX
<=
_FAC_DSP_LEVEL1_3MENU_2
))
||
...
@@ -1016,7 +1021,7 @@ void Key_Operation_Down(Key_Event_en_t enKeyEvent)
...
@@ -1016,7 +1021,7 @@ void Key_Operation_Down(Key_Event_en_t enKeyEvent)
;
/*Do Nothing!*/
;
/*Do Nothing!*/
}
}
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
_1
)
{
{
;
/*D0 Nothing!*/
;
/*D0 Nothing!*/
}
}
...
@@ -1024,11 +1029,11 @@ void Key_Operation_Down(Key_Event_en_t enKeyEvent)
...
@@ -1024,11 +1029,11 @@ void Key_Operation_Down(Key_Event_en_t enKeyEvent)
/*----有车速,有报警----*/
/*----有车速,有报警----*/
else
else
{
{
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
_1
)
{
{
;
/*D0 Nothing!*/
;
/*D0 Nothing!*/
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
_1
)
{
{
;
/*D0 Nothing!*/
;
/*D0 Nothing!*/
}
}
...
@@ -1056,7 +1061,7 @@ void Key_Operation_Enter(Key_Event_en_t enKeyEvent)
...
@@ -1056,7 +1061,7 @@ void Key_Operation_Enter(Key_Event_en_t enKeyEvent)
/*----无车速,无报警----*/
/*----无车速,无报警----*/
if
(
HMI_MENU_Sta
!=
Display_Alarm
)
if
(
HMI_MENU_Sta
!=
Display_Alarm
)
{
{
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
_1
)
{
{
if
(((
bCurMenuIDX
>=
_MN_DSP_LEVEL2MENU_1
)
&&
(
bCurMenuIDX
<=
_MN_DSP_LEVEL2_5_MENU_4
))
||
if
(((
bCurMenuIDX
>=
_MN_DSP_LEVEL2MENU_1
)
&&
(
bCurMenuIDX
<=
_MN_DSP_LEVEL2_5_MENU_4
))
||
((
bCurMenuIDX
>=
_MN_DSP_LEVEL3_4_MENU_41
)
&&
(
bCurMenuIDX
<=
_MN_DSP_LEVEL3_4_MENU_47
)))
((
bCurMenuIDX
>=
_MN_DSP_LEVEL3_4_MENU_41
)
&&
(
bCurMenuIDX
<=
_MN_DSP_LEVEL3_4_MENU_47
)))
...
@@ -1135,7 +1140,7 @@ void Key_Operation_Enter(Key_Event_en_t enKeyEvent)
...
@@ -1135,7 +1140,7 @@ void Key_Operation_Enter(Key_Event_en_t enKeyEvent)
;
/*Do Nothing!*/
;
/*Do Nothing!*/
}
}
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
_1
)
{
{
/*Go Enter*/
/*Go Enter*/
if
((
bCurMenuIDX
>=
_MN_DSP_LEVEL3_2_MENU_1
)
&&
(
bCurMenuIDX
<=
_MN_DSP_LEVEL3_2_MENU_8
))
if
((
bCurMenuIDX
>=
_MN_DSP_LEVEL3_2_MENU_1
)
&&
(
bCurMenuIDX
<=
_MN_DSP_LEVEL3_2_MENU_8
))
...
@@ -1148,11 +1153,11 @@ void Key_Operation_Enter(Key_Event_en_t enKeyEvent)
...
@@ -1148,11 +1153,11 @@ void Key_Operation_Enter(Key_Event_en_t enKeyEvent)
else
else
{
{
/*----无车速,有报警----*/
/*----无车速,有报警----*/
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
_1
)
{
{
;
/*D0 Nothing!*/
;
/*D0 Nothing!*/
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
_1
)
{
{
;
/*D0 Nothing!*/
;
/*D0 Nothing!*/
}
}
...
@@ -1163,7 +1168,7 @@ void Key_Operation_Enter(Key_Event_en_t enKeyEvent)
...
@@ -1163,7 +1168,7 @@ void Key_Operation_Enter(Key_Event_en_t enKeyEvent)
/*----有车速,无报警----*/
/*----有车速,无报警----*/
if
(
HMI_MENU_Sta
!=
Display_Alarm
)
if
(
HMI_MENU_Sta
!=
Display_Alarm
)
{
{
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
_1
)
{
{
/*工厂模式 经销商模式*/
/*工厂模式 经销商模式*/
if
((
bCurMenuIDX
>=
_FAC_DSP_LEVEL0MENU_1
)
&&
(
bCurMenuIDX
<=
_MN_DSP_MENU_MAX
))
if
((
bCurMenuIDX
>=
_FAC_DSP_LEVEL0MENU_1
)
&&
(
bCurMenuIDX
<=
_MN_DSP_MENU_MAX
))
...
@@ -1194,7 +1199,7 @@ void Key_Operation_Enter(Key_Event_en_t enKeyEvent)
...
@@ -1194,7 +1199,7 @@ void Key_Operation_Enter(Key_Event_en_t enKeyEvent)
;
/*Do Nothing!*/
;
/*Do Nothing!*/
}
}
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
_1
)
{
{
;
/*D0 Nothing!*/
;
/*D0 Nothing!*/
}
}
...
@@ -1202,11 +1207,11 @@ void Key_Operation_Enter(Key_Event_en_t enKeyEvent)
...
@@ -1202,11 +1207,11 @@ void Key_Operation_Enter(Key_Event_en_t enKeyEvent)
/*----有车速,有报警----*/
/*----有车速,有报警----*/
else
else
{
{
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
_1
)
{
{
;
/*D0 Nothing!*/
;
/*D0 Nothing!*/
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
_1
)
{
{
;
/*D0 Nothing!*/
;
/*D0 Nothing!*/
}
}
...
@@ -1235,7 +1240,7 @@ void Key_Operation_Return(Key_Event_en_t enKeyEvent)
...
@@ -1235,7 +1240,7 @@ void Key_Operation_Return(Key_Event_en_t enKeyEvent)
/*----无车速,无报警----*/
/*----无车速,无报警----*/
if
(
HMI_MENU_Sta
!=
Display_Alarm
)
if
(
HMI_MENU_Sta
!=
Display_Alarm
)
{
{
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
_1
)
{
{
if
((
bCurMenuIDX
>=
_MN_DSP_LEVEL2_1_MENU_1
)
&&
(
bCurMenuIDX
<
_MN_DSP_ENTER_MENU
))
if
((
bCurMenuIDX
>=
_MN_DSP_LEVEL2_1_MENU_1
)
&&
(
bCurMenuIDX
<
_MN_DSP_ENTER_MENU
))
{
{
...
@@ -1295,7 +1300,7 @@ void Key_Operation_Return(Key_Event_en_t enKeyEvent)
...
@@ -1295,7 +1300,7 @@ void Key_Operation_Return(Key_Event_en_t enKeyEvent)
;
/*do nothing*/
;
/*do nothing*/
}
}
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
_1
)
{
{
;
/*D0 Nothing!*/
;
/*D0 Nothing!*/
}
}
...
@@ -1303,11 +1308,11 @@ void Key_Operation_Return(Key_Event_en_t enKeyEvent)
...
@@ -1303,11 +1308,11 @@ void Key_Operation_Return(Key_Event_en_t enKeyEvent)
else
else
{
{
/*----无车速,有报警----*/
/*----无车速,有报警----*/
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
_1
)
{
{
;
/*Do Nothing!*/
;
/*Do Nothing!*/
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
_1
)
{
{
MenuFlag
.
Key_Menu_Popup_time
=
6000u
;
MenuFlag
.
Key_Menu_Popup_time
=
6000u
;
}
}
...
@@ -1318,7 +1323,7 @@ void Key_Operation_Return(Key_Event_en_t enKeyEvent)
...
@@ -1318,7 +1323,7 @@ void Key_Operation_Return(Key_Event_en_t enKeyEvent)
if
(
HMI_MENU_Sta
!=
Display_Alarm
)
if
(
HMI_MENU_Sta
!=
Display_Alarm
)
{
{
/*----有车速,无报警----*/
/*----有车速,无报警----*/
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
_1
)
{
{
/*工厂模式 经销商模式*/
/*工厂模式 经销商模式*/
if
((
bCurMenuIDX
>=
_FAC_DSP_LEVEL0MENU_1
)
&&
(
bCurMenuIDX
<=
_MN_DSP_MENU_MAX
))
if
((
bCurMenuIDX
>=
_FAC_DSP_LEVEL0MENU_1
)
&&
(
bCurMenuIDX
<=
_MN_DSP_MENU_MAX
))
...
@@ -1330,7 +1335,7 @@ void Key_Operation_Return(Key_Event_en_t enKeyEvent)
...
@@ -1330,7 +1335,7 @@ void Key_Operation_Return(Key_Event_en_t enKeyEvent)
;
/*do nothing*/
;
/*do nothing*/
}
}
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
_1
)
{
{
;
/*Do Nothing!*/
;
/*Do Nothing!*/
}
}
...
@@ -1338,11 +1343,11 @@ void Key_Operation_Return(Key_Event_en_t enKeyEvent)
...
@@ -1338,11 +1343,11 @@ void Key_Operation_Return(Key_Event_en_t enKeyEvent)
else
else
{
{
/*----有车速,无报警----*/
/*----有车速,无报警----*/
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
_1
)
{
{
;
/*Do Nothing!*/
;
/*Do Nothing!*/
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
_1
)
{
{
MenuFlag
.
Key_Menu_Popup_time
=
6000u
;
MenuFlag
.
Key_Menu_Popup_time
=
6000u
;
}
}
...
@@ -1374,7 +1379,7 @@ void Key_Operation_Menu(Key_Event_en_t enKeyEvent)
...
@@ -1374,7 +1379,7 @@ void Key_Operation_Menu(Key_Event_en_t enKeyEvent)
/*----无车速,无报警----*/
/*----无车速,无报警----*/
if
(
HMI_MENU_Sta
!=
Display_Alarm
)
if
(
HMI_MENU_Sta
!=
Display_Alarm
)
{
{
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
_1
)
{
{
/*自检模式进入经销商模式*/
/*自检模式进入经销商模式*/
if
(
bCurMenuIDX
==
_MN_DSP_Menu_Test
)
if
(
bCurMenuIDX
==
_MN_DSP_Menu_Test
)
...
@@ -1410,7 +1415,11 @@ void Key_Operation_Menu(Key_Event_en_t enKeyEvent)
...
@@ -1410,7 +1415,11 @@ void Key_Operation_Menu(Key_Event_en_t enKeyEvent)
NextMenu
(
MenuFlag
.
Menu_Flag
);
NextMenu
(
MenuFlag
.
Menu_Flag
);
}
}
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS_1
)
{
;
/*Do Nothing!*/
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS_2
)
{
{
/*EOL USB 刷写功能----20220721*/
/*EOL USB 刷写功能----20220721*/
if
(
bCurMenuIDX
==
_MN_DSP_Menu_Test
)
if
(
bCurMenuIDX
==
_MN_DSP_Menu_Test
)
...
@@ -1422,7 +1431,7 @@ void Key_Operation_Menu(Key_Event_en_t enKeyEvent)
...
@@ -1422,7 +1431,7 @@ void Key_Operation_Menu(Key_Event_en_t enKeyEvent)
else
else
{
{
/*----无车速,有报警----*/
/*----无车速,有报警----*/
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
_1
)
{
{
/*自检模式进入经销商模式*/
/*自检模式进入经销商模式*/
if
(
bCurMenuIDX
==
_MN_DSP_Menu_Test
)
if
(
bCurMenuIDX
==
_MN_DSP_Menu_Test
)
...
@@ -1446,7 +1455,11 @@ void Key_Operation_Menu(Key_Event_en_t enKeyEvent)
...
@@ -1446,7 +1455,11 @@ void Key_Operation_Menu(Key_Event_en_t enKeyEvent)
MenuFlag
.
Menu_StaFlag
=
0x01u
;
MenuFlag
.
Menu_StaFlag
=
0x01u
;
}
}
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS_1
)
{
;
/*Do Nothing!*/
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS_2
)
{
{
/*EOL USB 刷写功能----20220721*/
/*EOL USB 刷写功能----20220721*/
if
(
bCurMenuIDX
==
_MN_DSP_Menu_Test
)
if
(
bCurMenuIDX
==
_MN_DSP_Menu_Test
)
...
@@ -1461,7 +1474,7 @@ void Key_Operation_Menu(Key_Event_en_t enKeyEvent)
...
@@ -1461,7 +1474,7 @@ void Key_Operation_Menu(Key_Event_en_t enKeyEvent)
if
(
HMI_MENU_Sta
!=
Display_Alarm
)
if
(
HMI_MENU_Sta
!=
Display_Alarm
)
{
{
/*----有车速,无报警----*/
/*----有车速,无报警----*/
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
_1
)
{
{
/*工厂模式*/
/*工厂模式*/
if
(
MenuFlag
.
Menu_StaFlag
==
0x00u
)
if
(
MenuFlag
.
Menu_StaFlag
==
0x00u
)
...
@@ -1480,7 +1493,7 @@ void Key_Operation_Menu(Key_Event_en_t enKeyEvent)
...
@@ -1480,7 +1493,7 @@ void Key_Operation_Menu(Key_Event_en_t enKeyEvent)
MenuFlag
.
Menu_StaFlag
=
0x01u
;
MenuFlag
.
Menu_StaFlag
=
0x01u
;
}
}
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
_1
)
{
{
/*EOL USB 刷写功能----20220721*/
/*EOL USB 刷写功能----20220721*/
if
(
bCurMenuIDX
==
_MN_DSP_Menu_Test
)
if
(
bCurMenuIDX
==
_MN_DSP_Menu_Test
)
...
@@ -1488,11 +1501,17 @@ void Key_Operation_Menu(Key_Event_en_t enKeyEvent)
...
@@ -1488,11 +1501,17 @@ void Key_Operation_Menu(Key_Event_en_t enKeyEvent)
StartUSBUpgrade
();
StartUSBUpgrade
();
}
}
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS_2
)
{
Gui_Display_Test
();
/*TYW总计清零*/
TYW_Data_ODO_Clear
();
}
}
}
else
else
{
{
/*----有车速,无报警----*/
/*----有车速,无报警----*/
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
_1
)
{
{
/*工厂模式*/
/*工厂模式*/
if
(
MenuFlag
.
Menu_StaFlag
==
0x00u
)
if
(
MenuFlag
.
Menu_StaFlag
==
0x00u
)
...
@@ -1511,7 +1530,7 @@ void Key_Operation_Menu(Key_Event_en_t enKeyEvent)
...
@@ -1511,7 +1530,7 @@ void Key_Operation_Menu(Key_Event_en_t enKeyEvent)
MenuFlag
.
Menu_StaFlag
=
0x01u
;
MenuFlag
.
Menu_StaFlag
=
0x01u
;
}
}
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
_1
)
{
{
/*EOL USB 刷写功能----20220721*/
/*EOL USB 刷写功能----20220721*/
if
(
bCurMenuIDX
==
_MN_DSP_Menu_Test
)
if
(
bCurMenuIDX
==
_MN_DSP_Menu_Test
)
...
@@ -1519,6 +1538,12 @@ void Key_Operation_Menu(Key_Event_en_t enKeyEvent)
...
@@ -1519,6 +1538,12 @@ void Key_Operation_Menu(Key_Event_en_t enKeyEvent)
StartUSBUpgrade
();
StartUSBUpgrade
();
}
}
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS_2
)
{
Gui_Display_Test
();
/*TYW总计清零*/
TYW_Data_ODO_Clear
();
}
}
}
}
}
}
}
...
@@ -1545,7 +1570,7 @@ void Key_Operation_ODOTrip(Key_Event_en_t enKeyEvent)
...
@@ -1545,7 +1570,7 @@ void Key_Operation_ODOTrip(Key_Event_en_t enKeyEvent)
{
{
MenuFlag
.
Key_MenuTest_Long
=
1u
;
MenuFlag
.
Key_MenuTest_Long
=
1u
;
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
else
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
_1
)
{
{
if
(
PowerStatus
==
COMMON_POWER_ON
)
if
(
PowerStatus
==
COMMON_POWER_ON
)
{
{
...
@@ -1578,7 +1603,7 @@ void Key_Operation_ODOTrip(Key_Event_en_t enKeyEvent)
...
@@ -1578,7 +1603,7 @@ void Key_Operation_ODOTrip(Key_Event_en_t enKeyEvent)
State_Flag
.
Menu_Key_Static
=
1u
;
State_Flag
.
Menu_Key_Static
=
1u
;
}
}
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
_1
)
{
{
if
(
PowerStatus
==
COMMON_POWER_ON
)
if
(
PowerStatus
==
COMMON_POWER_ON
)
{
{
...
@@ -1603,11 +1628,11 @@ void Key_Operation_ODOTrip(Key_Event_en_t enKeyEvent)
...
@@ -1603,11 +1628,11 @@ void Key_Operation_ODOTrip(Key_Event_en_t enKeyEvent)
if (HMI_MENU_Sta != Display_Alarm)
if (HMI_MENU_Sta != Display_Alarm)
{
{
/*----无车速,无报警----*/
/*----无车速,无报警----*/
if (enKeyEvent == KEY_EVENT_SHORT_PRESS)
if (enKeyEvent == KEY_EVENT_SHORT_PRESS
_1
)
{
{
;
;
}
}
else if (enKeyEvent == KEY_EVENT_LONG_PRESS)
else if (enKeyEvent == KEY_EVENT_LONG_PRESS
_1
)
{
{
; /*Do Nothing!*/
; /*Do Nothing!*/
}
}
...
@@ -1615,11 +1640,11 @@ void Key_Operation_ODOTrip(Key_Event_en_t enKeyEvent)
...
@@ -1615,11 +1640,11 @@ void Key_Operation_ODOTrip(Key_Event_en_t enKeyEvent)
else
else
{
{
/*----无车速,有报警----*/
/*----无车速,有报警----*/
if (enKeyEvent == KEY_EVENT_SHORT_PRESS)
if (enKeyEvent == KEY_EVENT_SHORT_PRESS
_1
)
{
{
; /*Do Nothing!*/
; /*Do Nothing!*/
}
}
else if (enKeyEvent == KEY_EVENT_LONG_PRESS)
else if (enKeyEvent == KEY_EVENT_LONG_PRESS
_1
)
{
{
; /*Do Nothing!*/
; /*Do Nothing!*/
}
}
...
@@ -1630,11 +1655,11 @@ void Key_Operation_ODOTrip(Key_Event_en_t enKeyEvent)
...
@@ -1630,11 +1655,11 @@ void Key_Operation_ODOTrip(Key_Event_en_t enKeyEvent)
if (HMI_MENU_Sta != Display_Alarm)
if (HMI_MENU_Sta != Display_Alarm)
{
{
/*----有车速,无报警----*/
/*----有车速,无报警----*/
if (enKeyEvent == KEY_EVENT_SHORT_PRESS)
if (enKeyEvent == KEY_EVENT_SHORT_PRESS
_1
)
{
{
; /*Do Nothing!*/
; /*Do Nothing!*/
}
}
else if (enKeyEvent == KEY_EVENT_LONG_PRESS)
else if (enKeyEvent == KEY_EVENT_LONG_PRESS
_1
)
{
{
; /*Do Nothing!*/
; /*Do Nothing!*/
}
}
...
@@ -1642,11 +1667,11 @@ void Key_Operation_ODOTrip(Key_Event_en_t enKeyEvent)
...
@@ -1642,11 +1667,11 @@ void Key_Operation_ODOTrip(Key_Event_en_t enKeyEvent)
else
else
{
{
/*----有车速,无报警----*/
/*----有车速,无报警----*/
if (enKeyEvent == KEY_EVENT_SHORT_PRESS)
if (enKeyEvent == KEY_EVENT_SHORT_PRESS
_1
)
{
{
; /*Do Nothing!*/
; /*Do Nothing!*/
}
}
else if (enKeyEvent == KEY_EVENT_LONG_PRESS)
else if (enKeyEvent == KEY_EVENT_LONG_PRESS
_1
)
{
{
; /*Do Nothing!*/
; /*Do Nothing!*/
}
}
...
@@ -1660,11 +1685,11 @@ uint8_t Common_Get_RetMenu_Flag(void)
...
@@ -1660,11 +1685,11 @@ uint8_t Common_Get_RetMenu_Flag(void)
return
MenuFlag
.
Menu_Flag
;
return
MenuFlag
.
Menu_Flag
;
}
}
/*------------读按键实时状态的回调函数-------------------------------------------*/
/*------------读按键实时状态的回调函数-------------------------------------------*/
Key_
Real_
Status_en_t
Key_Real_Status_Read_Enter
(
void
);
Key_Status_en_t
Key_Real_Status_Read_Enter
(
void
);
Key_
Real_
Status_en_t
Key_Real_Status_Read_Return
(
void
);
Key_Status_en_t
Key_Real_Status_Read_Return
(
void
);
Key_
Real_
Status_en_t
Key_Real_Status_Read_Up
(
void
);
Key_Status_en_t
Key_Real_Status_Read_Up
(
void
);
Key_
Real_
Status_en_t
Key_Real_Status_Read_Down
(
void
);
Key_Status_en_t
Key_Real_Status_Read_Down
(
void
);
Key_
Real_
Status_en_t
Key_Real_Status_Read_Menu
(
void
);
Key_Status_en_t
Key_Real_Status_Read_Menu
(
void
);
/*-------------------------------------------------*/
/*-------------------------------------------------*/
// Menu_R = 24000*470 / (24000 + 470) = 460.97Ω
// Menu_R = 24000*470 / (24000 + 470) = 460.97Ω
...
@@ -1688,26 +1713,26 @@ Key_Real_Status_en_t Key_Real_Status_Read_Menu(void);
...
@@ -1688,26 +1713,26 @@ Key_Real_Status_en_t Key_Real_Status_Read_Menu(void);
// Down_R 3000~3200Ω
// Down_R 3000~3200Ω
/*上*/
/*上*/
Key_
Real_
Status_en_t
Key_Real_Status_Read_Up
(
void
)
Key_Status_en_t
Key_Real_Status_Read_Up
(
void
)
{
{
Key_
Real_Status_en_t
enKeyRealStatus
=
KEY_LIN
E_LOOSEN
;
Key_
Status_en_t
enKeyRealStatus
=
KEY_REALTIM
E_LOOSEN
;
uint16_t
Key_R
=
0
;
uint16_t
Key_R
=
0
;
Key_R
=
(
uint16_t
)
RTE_Read_KEY_R
();
Key_R
=
(
uint16_t
)
RTE_Read_KEY_R
();
if
(
RTE_Read_KEY_R_Valid
()
==
0
)
if
(
RTE_Read_KEY_R_Valid
()
==
0
)
{
{
enKeyRealStatus
=
KEY_
LIN
E_LOOSEN
;
enKeyRealStatus
=
KEY_
REALTIM
E_LOOSEN
;
}
}
else
else
{
{
if
((
Key_R
>=
(
1250
-
400
))
&&
(
Key_R
<=
(
1250
+
400
)))
if
((
Key_R
>=
(
1250
-
400
))
&&
(
Key_R
<=
(
1250
+
400
)))
{
{
enKeyRealStatus
=
KEY_
LIN
E_PRESS
;
enKeyRealStatus
=
KEY_
REALTIM
E_PRESS
;
}
}
else
else
{
{
enKeyRealStatus
=
KEY_
LIN
E_LOOSEN
;
enKeyRealStatus
=
KEY_
REALTIM
E_LOOSEN
;
}
}
}
}
...
@@ -1715,26 +1740,26 @@ Key_Real_Status_en_t Key_Real_Status_Read_Up(void)
...
@@ -1715,26 +1740,26 @@ Key_Real_Status_en_t Key_Real_Status_Read_Up(void)
}
}
/*下*/
/*下*/
Key_
Real_
Status_en_t
Key_Real_Status_Read_Down
(
void
)
Key_Status_en_t
Key_Real_Status_Read_Down
(
void
)
{
{
Key_
Real_Status_en_t
enKeyRealStatus
=
KEY_LIN
E_LOOSEN
;
Key_
Status_en_t
enKeyRealStatus
=
KEY_REALTIM
E_LOOSEN
;
uint16_t
Key_R
=
0
;
uint16_t
Key_R
=
0
;
Key_R
=
(
uint16_t
)
RTE_Read_KEY_R
();
Key_R
=
(
uint16_t
)
RTE_Read_KEY_R
();
if
(
RTE_Read_KEY_R_Valid
()
==
0
)
if
(
RTE_Read_KEY_R_Valid
()
==
0
)
{
{
enKeyRealStatus
=
KEY_
LIN
E_LOOSEN
;
enKeyRealStatus
=
KEY_
REALTIM
E_LOOSEN
;
}
}
else
else
{
{
if
((
Key_R
>=
(
2900
-
400
))
&&
(
Key_R
<=
(
2900
+
400
)))
if
((
Key_R
>=
(
2900
-
400
))
&&
(
Key_R
<=
(
2900
+
400
)))
{
{
enKeyRealStatus
=
KEY_
LIN
E_PRESS
;
enKeyRealStatus
=
KEY_
REALTIM
E_PRESS
;
}
}
else
else
{
{
enKeyRealStatus
=
KEY_
LIN
E_LOOSEN
;
enKeyRealStatus
=
KEY_
REALTIM
E_LOOSEN
;
}
}
}
}
...
@@ -1742,52 +1767,52 @@ Key_Real_Status_en_t Key_Real_Status_Read_Down(void)
...
@@ -1742,52 +1767,52 @@ Key_Real_Status_en_t Key_Real_Status_Read_Down(void)
}
}
/*Enter*/
/*Enter*/
Key_
Real_
Status_en_t
Key_Real_Status_Read_Enter
(
void
)
Key_Status_en_t
Key_Real_Status_Read_Enter
(
void
)
{
{
Key_
Real_Status_en_t
enKeyRealStatus
=
KEY_LIN
E_LOOSEN
;
Key_
Status_en_t
enKeyRealStatus
=
KEY_REALTIM
E_LOOSEN
;
uint16_t
Key_R
=
0
;
uint16_t
Key_R
=
0
;
Key_R
=
(
uint16_t
)
RTE_Read_KEY_R
();
Key_R
=
(
uint16_t
)
RTE_Read_KEY_R
();
if
(
RTE_Read_KEY_R_Valid
()
==
0
)
if
(
RTE_Read_KEY_R_Valid
()
==
0
)
{
{
enKeyRealStatus
=
KEY_
LIN
E_LOOSEN
;
enKeyRealStatus
=
KEY_
REALTIM
E_LOOSEN
;
}
}
else
else
{
{
if
((
Key_R
>=
(
4800
-
400
))
&&
(
Key_R
<=
(
5300
+
400
)))
if
((
Key_R
>=
(
4800
-
400
))
&&
(
Key_R
<=
(
5300
+
400
)))
{
{
enKeyRealStatus
=
KEY_
LIN
E_PRESS
;
enKeyRealStatus
=
KEY_
REALTIM
E_PRESS
;
}
}
else
else
{
{
enKeyRealStatus
=
KEY_
LIN
E_LOOSEN
;
enKeyRealStatus
=
KEY_
REALTIM
E_LOOSEN
;
}
}
}
}
return
enKeyRealStatus
;
return
enKeyRealStatus
;
}
}
/*Return*/
/*Return*/
Key_
Real_
Status_en_t
Key_Real_Status_Read_Return
(
void
)
Key_Status_en_t
Key_Real_Status_Read_Return
(
void
)
{
{
Key_
Real_Status_en_t
enKeyRealStatus
=
KEY_LIN
E_LOOSEN
;
Key_
Status_en_t
enKeyRealStatus
=
KEY_REALTIM
E_LOOSEN
;
uint16_t
Key_R
=
0
;
uint16_t
Key_R
=
0
;
Key_R
=
(
uint16_t
)
RTE_Read_KEY_R
();
Key_R
=
(
uint16_t
)
RTE_Read_KEY_R
();
if
(
RTE_Read_KEY_R_Valid
()
==
0
)
if
(
RTE_Read_KEY_R_Valid
()
==
0
)
{
{
enKeyRealStatus
=
KEY_
LIN
E_LOOSEN
;
enKeyRealStatus
=
KEY_
REALTIM
E_LOOSEN
;
}
}
else
else
{
{
if
((
Key_R
>=
(
7800
-
400
))
&&
(
Key_R
<=
(
8900
+
400
)))
if
((
Key_R
>=
(
7800
-
400
))
&&
(
Key_R
<=
(
8900
+
400
)))
{
{
enKeyRealStatus
=
KEY_
LIN
E_PRESS
;
enKeyRealStatus
=
KEY_
REALTIM
E_PRESS
;
}
}
else
else
{
{
enKeyRealStatus
=
KEY_
LIN
E_LOOSEN
;
enKeyRealStatus
=
KEY_
REALTIM
E_LOOSEN
;
}
}
}
}
...
@@ -1795,26 +1820,26 @@ Key_Real_Status_en_t Key_Real_Status_Read_Return(void)
...
@@ -1795,26 +1820,26 @@ Key_Real_Status_en_t Key_Real_Status_Read_Return(void)
}
}
/*Menu*/
/*Menu*/
Key_
Real_
Status_en_t
Key_Real_Status_Read_Menu
(
void
)
Key_Status_en_t
Key_Real_Status_Read_Menu
(
void
)
{
{
Key_
Real_Status_en_t
enKeyRealStatus
=
KEY_LIN
E_LOOSEN
;
Key_
Status_en_t
enKeyRealStatus
=
KEY_REALTIM
E_LOOSEN
;
uint16_t
Key_R
=
0
;
uint16_t
Key_R
=
0
;
Key_R
=
(
uint16_t
)
RTE_Read_KEY_R
();
Key_R
=
(
uint16_t
)
RTE_Read_KEY_R
();
if
(
RTE_Read_KEY_R_Valid
()
==
0
)
if
(
RTE_Read_KEY_R_Valid
()
==
0
)
{
{
enKeyRealStatus
=
KEY_
LIN
E_LOOSEN
;
enKeyRealStatus
=
KEY_
REALTIM
E_LOOSEN
;
}
}
else
else
{
{
if
((
Key_R
>=
(
500
-
300
))
&&
(
Key_R
<=
(
500
+
300
)))
if
((
Key_R
>=
(
500
-
300
))
&&
(
Key_R
<=
(
500
+
300
)))
{
{
enKeyRealStatus
=
KEY_
LIN
E_PRESS
;
enKeyRealStatus
=
KEY_
REALTIM
E_PRESS
;
}
}
else
else
{
{
enKeyRealStatus
=
KEY_
LIN
E_LOOSEN
;
enKeyRealStatus
=
KEY_
REALTIM
E_LOOSEN
;
}
}
}
}
...
@@ -1822,20 +1847,20 @@ Key_Real_Status_en_t Key_Real_Status_Read_Menu(void)
...
@@ -1822,20 +1847,20 @@ Key_Real_Status_en_t Key_Real_Status_Read_Menu(void)
}
}
/*TRIO-ODO*/
/*TRIO-ODO*/
Key_
Real_
Status_en_t
Key_Real_Status_Read_ODOTrip
(
void
)
Key_Status_en_t
Key_Real_Status_Read_ODOTrip
(
void
)
{
{
Key_
Real_Status_en_t
enKeyRealStatus
=
KEY_LIN
E_LOOSEN
;
Key_
Status_en_t
enKeyRealStatus
=
KEY_REALTIM
E_LOOSEN
;
uint16_t
Key_R
=
0
;
uint16_t
Key_R
=
0
;
Key_R
=
(
uint16_t
)
CD4051_COM3_X5_IN
;
Key_R
=
(
uint16_t
)
CD4051_COM3_X5_IN
;
if
(
Key_R
==
0u
)
if
(
Key_R
==
0u
)
{
{
enKeyRealStatus
=
KEY_
LIN
E_PRESS
;
enKeyRealStatus
=
KEY_
REALTIM
E_PRESS
;
}
}
else
else
{
{
enKeyRealStatus
=
KEY_
LIN
E_LOOSEN
;
enKeyRealStatus
=
KEY_
REALTIM
E_LOOSEN
;
}
}
return
enKeyRealStatus
;
return
enKeyRealStatus
;
...
@@ -1851,16 +1876,25 @@ const Key_Attribute_st_t stKeyAttribute[KEY_NUM_MAX] =
...
@@ -1851,16 +1876,25 @@ const Key_Attribute_st_t stKeyAttribute[KEY_NUM_MAX] =
{
KEY_NEED_DEBOUNCE_NORMAL
,
Key_Real_Status_Read_ODOTrip
,
Key_Operation_ODOTrip
},
{
KEY_NEED_DEBOUNCE_NORMAL
,
Key_Real_Status_Read_ODOTrip
,
Key_Operation_ODOTrip
},
};
};
Key_IGN_en_t
Key_Get_IGN_Status
(
void
)
void
Key_KL30_Init_EXample
(
void
)
{
{
Key_IGN_en_t
ret
=
KEY_IG_INVALID
;
Key_Init_st_t
stKeyInitTem
;
if
(
SYS_OPR_STAT_IGN_ON
)
Key_uint16_t
i
;
for
(
i
=
0
;
i
<
KEY_RAM_DATA_LEN
;
i
++
)
{
{
ret
=
KEY_IG_ON
;
u8KeyRamData
[
i
]
=
0
;
}
}
else
{
stKeyInitTem
.
u8KeyNum
=
KEY_NUM_MAX
;
ret
=
KEY_IG_OFF
;
stKeyInitTem
.
enKeyIGNRealStatus
=
KEY_IG_OFF
;
}
Key_KL30_Init
(
&
u8KeyRamData
[
0
],
stKeyAttribute
,
&
stKeyInitTem
);
return
ret
;
}
void
Key_Wakeup_Init_EXample
(
void
)
{
Key_Init_st_t
stKeyInitTem
;
stKeyInitTem
.
u8KeyNum
=
KEY_NUM_MAX
;
stKeyInitTem
.
enKeyIGNRealStatus
=
KEY_IG_OFF
;
//
Key_Wakeup_Init
(
&
u8KeyRamData
[
0
],
stKeyAttribute
,
&
stKeyInitTem
);
}
}
\ No newline at end of file
source/Application/APP/Key/Key_user.h
0 → 100644
View file @
7728ec5d
#ifndef KEY_USER_H__
#define KEY_USER_H__
extern
void
Key_KL30_Init_EXample
(
void
);
extern
void
Key_Wakeup_Init_EXample
(
void
);
#endif
\ No newline at end of file
source/Application/APP/PowerManagement/PowerManagement_user.c
View file @
7728ec5d
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
#include "Door.h"
#include "Door.h"
#include "Data_AirPressure.h"
#include "Data_AirPressure.h"
#include "Key.h"
#include "Key.h"
#include "Key_user.h"
#include "Menu.h"
#include "Menu.h"
#include "Services_ODO_User.h"
#include "Services_ODO_User.h"
#include "AvgSpeed.h"
#include "AvgSpeed.h"
...
@@ -96,7 +97,9 @@ Power_Status_t Power_KL30_Init ( void )
...
@@ -96,7 +97,9 @@ Power_Status_t Power_KL30_Init ( void )
SeatbeltInit
();
SeatbeltInit
();
Door_WakeUpInit
();
Door_WakeUpInit
();
Key_Init
();
Key_KL30_Init_EXample
();
Key_Parameter_Set_Short_Press_1_Time
(
40
,
800
);
Key_Parameter_Set_Long_Press_2_Time
(
4000
);
LED_Driver_Init
();
LED_Driver_Init
();
Sound_Scheduler_Init
();
Sound_Scheduler_Init
();
...
@@ -209,6 +212,7 @@ Power_Status_t Power_Wakeup_Init ( void )
...
@@ -209,6 +212,7 @@ Power_Status_t Power_Wakeup_Init ( void )
Door_WakeUpInit
();
Door_WakeUpInit
();
RTE_PWM_Init
();
RTE_PWM_Init
();
Key_Wakeup_Init_EXample
();
/*燃油新增 ----20220503----*/
/*燃油新增 ----20220503----*/
Fuel_User_Wakeup_Init
();
Fuel_User_Wakeup_Init
();
...
@@ -243,6 +247,7 @@ void Power_IG_OFF_Init(void)
...
@@ -243,6 +247,7 @@ void Power_IG_OFF_Init(void)
/*关闭所有断码*/
/*关闭所有断码*/
Seg_Display_OFF
();
Seg_Display_OFF
();
Key_Set_IG_Status
(
KEY_IG_OFF
);
}
}
void
Power_IG_ON_Init
(
void
)
void
Power_IG_ON_Init
(
void
)
{
{
...
@@ -263,6 +268,7 @@ void Power_IG_ON_Init(void)
...
@@ -263,6 +268,7 @@ void Power_IG_ON_Init(void)
UserGaugeK15Init
()
;
/*仪表IGON调用*/
UserGaugeK15Init
()
;
/*仪表IGON调用*/
/*end*/
/*end*/
CD4051B_KL15Init
();
CD4051B_KL15Init
();
Key_Set_IG_Status
(
KEY_IG_ON
);
/*5s不按按键计时清零*/
/*5s不按按键计时清零*/
//LongTimeNoKey_Operation_TimeRest();
//LongTimeNoKey_Operation_TimeRest();
...
...
source/Application/APP/SEG_LCD/SEG_DISPLAY.c
View file @
7728ec5d
...
@@ -1207,7 +1207,7 @@ void Seg_Display_OFF(void)
...
@@ -1207,7 +1207,7 @@ void Seg_Display_OFF(void)
uint8_t
Flash_time
=
0
;
uint8_t
Flash_time
=
0
;
uint16_t
Color_Time
=
0
;
// 20 更换一次颜色
uint16_t
Color_Time
=
0
;
// 20 更换一次颜色
extern
uint8_t
BackOdoFlagSta
;
uint8_t
BackOdoFlagSta
;
void
Gui_Display_Test
(
void
)
void
Gui_Display_Test
(
void
)
{
{
uint16_t
Get_Data_Veh_value
=
0u
;
uint16_t
Get_Data_Veh_value
=
0u
;
...
@@ -1283,6 +1283,7 @@ void Gui_Display_Test(void)
...
@@ -1283,6 +1283,7 @@ void Gui_Display_Test(void)
Loc_Display_Red
(
1
,
1
,
1
);
Loc_Display_Red
(
1
,
1
,
1
);
Flash_time
=
0
;
Flash_time
=
0
;
Color_Time
=
0
;
Color_Time
=
0
;
BackOdoFlagSta
=
1
;
break
;
break
;
}
}
}
}
...
...
source/Application/Gen_Tool/Fuel_Calibration.h
View file @
7728ec5d
#ifndef __Fuel_Calibration__
#ifndef __Fuel_Calibration__
#define __Fuel_Calibration__
#define __Fuel_Calibration__
#include "stdint.h"
#include "
TYW_
stdint.h"
void
Fuel_Set_Filling
(
uint8_t
Filling
);
void
Fuel_Set_Filling
(
uint8_t
Filling
);
void
Fuel_Set_EstimationFlag
(
uint8_t
m_EstimationFlag
);
void
Fuel_Set_EstimationFlag
(
uint8_t
m_EstimationFlag
);
...
...
source/Application/Graphic/Menu/Menu_user.c
View file @
7728ec5d
...
@@ -1756,6 +1756,7 @@ void Level3_4Menu_7Enter_1(void)
...
@@ -1756,6 +1756,7 @@ void Level3_4Menu_7Enter_1(void)
void
Level3_4Menu_7Do_1
(
void
)
void
Level3_4Menu_7Do_1
(
void
)
{
{
GUI_OftenShow_Display
();
GUI_OftenShow_Display
();
GUI_BG_UserSet_Display
(
GUI_DISP_MODE_NORMAL
);
GUI_BG_User_Light1_Display
(
GUI_DISP_MODE_NORMAL
);
GUI_BG_User_Light1_Display
(
GUI_DISP_MODE_NORMAL
);
}
}
void
Level3_4Menu_7Exit_1
(
void
)
void
Level3_4Menu_7Exit_1
(
void
)
...
@@ -1779,6 +1780,7 @@ void Level3_4Menu_7Enter_2(void)
...
@@ -1779,6 +1780,7 @@ void Level3_4Menu_7Enter_2(void)
void
Level3_4Menu_7Do_2
(
void
)
void
Level3_4Menu_7Do_2
(
void
)
{
{
GUI_OftenShow_Display
();
GUI_OftenShow_Display
();
GUI_BG_UserSet_Display
(
GUI_DISP_MODE_NORMAL
);
GUI_BG_User_Light2_Display
(
GUI_DISP_MODE_NORMAL
);
GUI_BG_User_Light2_Display
(
GUI_DISP_MODE_NORMAL
);
}
}
void
Level3_4Menu_7Exit_2
(
void
)
void
Level3_4Menu_7Exit_2
(
void
)
...
...
source/Application/Graphic/UE/DisplaySch_user.c
View file @
7728ec5d
...
@@ -6,11 +6,9 @@
...
@@ -6,11 +6,9 @@
#include "Key.h"
#include "Key.h"
#include "CAN_Lib.h"
#include "CAN_Lib.h"
#include "GUI.h"
#include "GUI.h"
#include "Services_ODO_User.h"
/*清空总计里程函数*/
#include "Menu.h"
#include "Menu.h"
#include "jcua.h"
#include "jcua.h"
#include "kwp2000_service.h"
#include "kwp2000_service.h"
#include "SEG_DISPLAY.h"
uint32_t
EnterTimer
[
10
];
uint32_t
EnterTimer
[
10
];
uint8_t
UE_EN
[
Display_MAX
];
uint8_t
UE_EN
[
Display_MAX
];
...
@@ -26,8 +24,6 @@ uint8_t BG_display_flag;
...
@@ -26,8 +24,6 @@ uint8_t BG_display_flag;
uint16_t
HMI_StartAnimationFrameCnt
;
uint16_t
HMI_StartAnimationFrameCnt
;
uint8_t
backgroundOFFFlag
;
uint8_t
backgroundOFFFlag
;
uint8_t
BackOdoFlagSta
;
uint8_t
BackOdoFlag
;
static
void
switch_branch
(
void
);
static
void
switch_branch
(
void
);
...
@@ -154,68 +150,59 @@ void DisplayServices(void)
...
@@ -154,68 +150,59 @@ void DisplayServices(void)
}
}
DispSch_xxxMs_Logic
(
10u
);
DispSch_xxxMs_Logic
(
10u
);
#if 0
/*上短*/
/*上短*/
if
(
UE_CtrlInfo
.
HMI_KEYInfo
.
u8KEY_UP
==
KEY_EVENT_SHORT_PRESS
)
if (UE_CtrlInfo.HMI_KEYInfo.u8KEY_UP == KEY_EVENT_SHORT_PRESS
_1
)
{
{
HMI_Clear_KEY_UP();
HMI_Clear_KEY_UP();
}
}
/*上长*/
/*上长*/
else
if
(
UE_CtrlInfo
.
HMI_KEYInfo
.
u8KEY_UP
==
KEY_EVENT_LONG_PRESS
)
else if (UE_CtrlInfo.HMI_KEYInfo.u8KEY_UP == KEY_EVENT_LONG_PRESS
_1
)
{
{
HMI_Clear_KEY_UP();
HMI_Clear_KEY_UP();
}
}
/*下短*/
/*下短*/
else
if
(
UE_CtrlInfo
.
HMI_KEYInfo
.
u8KEY_DOWN
==
KEY_EVENT_SHORT_PRESS
)
else if (UE_CtrlInfo.HMI_KEYInfo.u8KEY_DOWN == KEY_EVENT_SHORT_PRESS
_1
)
{
{
HMI_Clear_KEY_DOWN();
HMI_Clear_KEY_DOWN();
}
}
/*下长*/
/*下长*/
else
if
(
UE_CtrlInfo
.
HMI_KEYInfo
.
u8KEY_DOWN
==
KEY_EVENT_LONG_PRESS
)
else if (UE_CtrlInfo.HMI_KEYInfo.u8KEY_DOWN == KEY_EVENT_LONG_PRESS
_1
)
{
{
HMI_Clear_KEY_DOWN();
HMI_Clear_KEY_DOWN();
}
}
/*确认短*/
/*确认短*/
else
if
(
UE_CtrlInfo
.
HMI_KEYInfo
.
u8KEY_CONFIRM
==
KEY_EVENT_SHORT_PRESS
)
else if (UE_CtrlInfo.HMI_KEYInfo.u8KEY_CONFIRM == KEY_EVENT_SHORT_PRESS
_1
)
{
{
HMI_Clear_KEY_CONFIRM();
HMI_Clear_KEY_CONFIRM();
}
}
/*确认长*/
/*确认长*/
else
if
(
UE_CtrlInfo
.
HMI_KEYInfo
.
u8KEY_CONFIRM
==
KEY_EVENT_LONG_PRESS
)
else if (UE_CtrlInfo.HMI_KEYInfo.u8KEY_CONFIRM == KEY_EVENT_LONG_PRESS
_1
)
{
{
HMI_Clear_KEY_CONFIRM();
HMI_Clear_KEY_CONFIRM();
}
}
/*确认超长 3S*/
/*确认超长 3S*/
else
if
(
UE_CtrlInfo
.
HMI_KEYInfo
.
u8KEY_CONFIRM
==
KEY_EVENT_SUPER_LONG_PRESS
)
else if (UE_CtrlInfo.HMI_KEYInfo.u8KEY_CONFIRM == KEY_EVENT_LONG_PRESS_2)
{
HMI_Clear_KEY_CONFIRM
();
if
(
BackOdoFlag
==
0
)
{
{
BackOdoFlag
=
1
;
HMI_Clear_KEY_CONFIRM();
HMI_Clear_KEY_CONFIRM();
BackOdoFlagSta
=
1
;
Gui_Display_Test
();
/*TYW总计清零*/
TYW_Data_ODO_Clear
();
}
}
}
/*返回短*/
/*返回短*/
else
if
(
UE_CtrlInfo
.
HMI_KEYInfo
.
u8KEY_CANCEL
==
KEY_EVENT_SHORT_PRESS
)
else if (UE_CtrlInfo.HMI_KEYInfo.u8KEY_CANCEL == KEY_EVENT_SHORT_PRESS
_1
)
{
{
HMI_Clear_KEY_CANCEL();
HMI_Clear_KEY_CANCEL();
}
}
/*返回长*/
/*返回长*/
else
if
(
UE_CtrlInfo
.
HMI_KEYInfo
.
u8KEY_CANCEL
==
KEY_EVENT_LONG_PRESS
)
else if (UE_CtrlInfo.HMI_KEYInfo.u8KEY_CANCEL == KEY_EVENT_LONG_PRESS
_1
)
{
{
HMI_Clear_KEY_CANCEL();
HMI_Clear_KEY_CANCEL();
}
}
/*MENU短*/
/*MENU短*/
else
if
(
UE_CtrlInfo
.
HMI_KEYInfo
.
u8KEY_MENU
==
KEY_EVENT_SHORT_PRESS
)
else if (UE_CtrlInfo.HMI_KEYInfo.u8KEY_MENU == KEY_EVENT_SHORT_PRESS
_1
)
{
{
HMI_Clear_KEY_MENU();
HMI_Clear_KEY_MENU();
}
}
/*MENU长*/
/*MENU长*/
else
if
(
UE_CtrlInfo
.
HMI_KEYInfo
.
u8KEY_MENU
==
KEY_EVENT_LONG_PRESS
)
else if (UE_CtrlInfo.HMI_KEYInfo.u8KEY_MENU == KEY_EVENT_LONG_PRESS
_1
)
{
{
HMI_Clear_KEY_MENU();
HMI_Clear_KEY_MENU();
}
}
...
@@ -225,12 +212,12 @@ void DisplayServices(void)
...
@@ -225,12 +212,12 @@ void DisplayServices(void)
}
}
/*ODOTrip短*/
/*ODOTrip短*/
if
(
UE_CtrlInfo
.
HMI_KEYInfo
.
u8KEY_ODOTRIP
==
KEY_EVENT_SHORT_PRESS
)
if (UE_CtrlInfo.HMI_KEYInfo.u8KEY_ODOTRIP == KEY_EVENT_SHORT_PRESS
_1
)
{
{
HMI_Clear_KEY_ODOTRIP();
HMI_Clear_KEY_ODOTRIP();
}
}
/*ODOTrip长*/
/*ODOTrip长*/
else
if
(
UE_CtrlInfo
.
HMI_KEYInfo
.
u8KEY_ODOTRIP
==
KEY_EVENT_LONG_PRESS
)
else if (UE_CtrlInfo.HMI_KEYInfo.u8KEY_ODOTRIP == KEY_EVENT_LONG_PRESS
_1
)
{
{
HMI_Clear_KEY_ODOTRIP();
HMI_Clear_KEY_ODOTRIP();
}
}
...
@@ -243,6 +230,7 @@ void DisplayServices(void)
...
@@ -243,6 +230,7 @@ void DisplayServices(void)
{
{
; /*do nothing*/
; /*do nothing*/
}
}
#endif
}
}
/*----开机动画----*/
/*----开机动画----*/
...
@@ -250,9 +238,7 @@ void Display_StartAnimationEnter(void)
...
@@ -250,9 +238,7 @@ void Display_StartAnimationEnter(void)
{
{
HMI_StartAnimationFrameCnt
=
0u
;
HMI_StartAnimationFrameCnt
=
0u
;
backgroundOFFFlag
=
0
;
backgroundOFFFlag
=
0
;
MenuFlag
.
Menu_Popup_Flag
=
0u
;
MenuFlag
.
Menu_Popup_Flag
=
0u
;
BackOdoFlagSta
=
0
;
BackOdoFlag
=
0
;
/*硬清空所有缓存数据*/
/*硬清空所有缓存数据*/
loc_free_mem
(
MENU_Sprite
,
MENU_Sprite
);
loc_free_mem
(
MENU_Sprite
,
MENU_Sprite
);
...
...
source/Application/K_BUS/kwp2000_protocol.c
View file @
7728ec5d
...
@@ -37,7 +37,6 @@ unsigned long Kwp2000_ComState_Flag;
...
@@ -37,7 +37,6 @@ unsigned long Kwp2000_ComState_Flag;
*********************************************************************
*********************************************************************
*/
*/
void
Kwp2000_CallService
(
unsigned
char
Sid_u8
);
void
Kwp2000_CallService
(
unsigned
char
Sid_u8
);
unsigned
char
kwp2000_CalcSeriveTabSize
(
void
);
/*-----------------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------------*/
const
Kwp2000_ServiceTab_Entry_t
Kwp2000_ServiceTab
[]
=
const
Kwp2000_ServiceTab_Entry_t
Kwp2000_ServiceTab
[]
=
...
@@ -71,19 +70,7 @@ void Kwp2000_CallService(unsigned char Sid_u8)
...
@@ -71,19 +70,7 @@ void Kwp2000_CallService(unsigned char Sid_u8)
serviceFound
=
0
;
serviceFound
=
0
;
Kwp2000_Negative
.
ResponseCode
=
0
;
Kwp2000_Negative
.
ResponseCode
=
0
;
#if 0
for (index = 0; index < kwp2000_CalcSeriveTabSize(); index++)
{
if (Kwp2000_ServiceTab[index].sId == Sid_u8)
{
serviceFound = 1;
Kwp2000_ComState.Tx_len = Kwp2000_ServiceTab[index].Kwp2000_Servie((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
}
}
#endif
switch
(
Sid_u8
)
switch
(
Sid_u8
)
{
{
case
KWP2000_ECURESET_REQUEST
:
case
KWP2000_ECURESET_REQUEST
:
...
@@ -321,16 +308,3 @@ void Kwp2000_Handle(void)
...
@@ -321,16 +308,3 @@ void Kwp2000_Handle(void)
}
}
}
}
}
}
\ No newline at end of file
/*-------------------------------------------------------------------------
* Function Name : kwp2000_CalcSeriveTabSize
* Description : kwp2000 Calculate Serive Table Size
* Input :
* Output : None
* Return : None
* onther :
--------------------------------------------------------------------------*/
unsigned
char
kwp2000_CalcSeriveTabSize
(
void
)
{
//return (unsigned char)(sizeof(Kwp2000_ServiceTab) / sizeof(Kwp2000_ServiceTab_Entry_t));
}
source/Application/RTE/Common_Interface.c
View file @
7728ec5d
...
@@ -265,35 +265,7 @@ static void Common_Set_Act_E_Speed(uint16_t Val)
...
@@ -265,35 +265,7 @@ static void Common_Set_Act_E_Speed(uint16_t Val)
}
}
static
void
Common_Set_Disp_V_Speed
(
uint16_t
Val
)
static
void
Common_Set_Disp_V_Speed
(
uint16_t
Val
)
{
{
static
uint16_t
Vspeed_ReflashTime
=
0
;
Disp_V_Speed
=
Val
;
static
uint16_t
Vspeed_Val
=
0
;
if
((
Vspeed_ReflashTime
>
0
)
&&
(
Vspeed_Val
!=
Val
))
{
Vspeed_ReflashTime
--
;
}
if
(
Vspeed_ReflashTime
==
0
)
{
if
(
Vspeed_Val
<
Val
)
{
Vspeed_ReflashTime
=
50
/
(
Val
-
Vspeed_Val
);
Vspeed_Val
++
;
}
else
if
(
Vspeed_Val
>
Val
)
{
Vspeed_ReflashTime
=
50
/
(
Vspeed_Val
-
Val
);
Vspeed_Val
--
;
}
else
{
Vspeed_ReflashTime
=
500
;
}
}
Disp_V_Speed
=
Vspeed_Val
;
}
}
static
void
Common_Set_Disp_E_Speed
(
uint16_t
Val
)
static
void
Common_Set_Disp_E_Speed
(
uint16_t
Val
)
{
{
...
...
source/Driver/Memory/Emulated_EEPROM_Access.c
View file @
7728ec5d
#include "stddef.h"
#include "stddef.h"
#include "stdint.h"
#include "
TYW_
stdint.h"
#include "Emulated_EEPROM_Access.h"
#include "Emulated_EEPROM_Access.h"
typedef
union
typedef
union
...
...
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