Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
TianYing_ty100
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TY
TianYing_ty100
Commits
58e1184d
Commit
58e1184d
authored
May 17, 2024
by
李俭双
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix:规范菜单逻辑变更,相应更改软件
parent
8d3802ea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
86 additions
and
48 deletions
+86
-48
SEG_DISPLAY.c
Firmware/Source/Application/SEG_DISPLAY/SEG_DISPLAY.c
+26
-7
Key_user.c
Firmware/Source/Component/Key/Key_user.c
+50
-38
Key_user.h
Firmware/Source/Component/Key/Key_user.h
+10
-3
No files found.
Firmware/Source/Application/SEG_DISPLAY/SEG_DISPLAY.c
View file @
58e1184d
...
@@ -875,6 +875,23 @@ void SEG_SET_VSpeed_NUM(uint8_t m_Flag, uint16_t m_NUM, uint8_t m_Unit)
...
@@ -875,6 +875,23 @@ void SEG_SET_VSpeed_NUM(uint8_t m_Flag, uint16_t m_NUM, uint8_t m_Unit)
if
(
m_Flag
==
1
)
if
(
m_Flag
==
1
)
{
{
if
(
m_NUM
>
99
)
{
RTE_GPIO_Set_Level
(
VSpeed_Tens
,
1
);
RTE_GPIO_Set_Level
(
VSpeed_Hundreds
,
1
);
}
else
if
(
m_NUM
>
9
)
{
RTE_GPIO_Set_Level
(
VSpeed_Tens
,
1
);
RTE_GPIO_Set_Level
(
VSpeed_Hundreds
,
0
);
}
else
{
RTE_GPIO_Set_Level
(
VSpeed_Tens
,
0
);
RTE_GPIO_Set_Level
(
VSpeed_Hundreds
,
0
);
}
if
((
ClearODO_Flag
!=
1
)
&&
(
Common_GetIgnOnTime
()
>=
3000
))
if
((
ClearODO_Flag
!=
1
)
&&
(
Common_GetIgnOnTime
()
>=
3000
))
{
{
if
(
Get_Current_PageType
()
==
Page_Km_Unit
)
if
(
Get_Current_PageType
()
==
Page_Km_Unit
)
...
@@ -1672,6 +1689,8 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
...
@@ -1672,6 +1689,8 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
uint32_t
Num
;
uint32_t
Num
;
uint8_t
m8
;
uint8_t
m8
;
RTE_GPIO_Set_Level
(
ODO_TenThousand
,
1
);
RTE_GPIO_Set_Level
(
ODO_Thousand
,
1
);
if
((
ClearODO_Flag
!=
1
)
&&
(
Common_GetIgnOnTime
()
>=
3000
))
if
((
ClearODO_Flag
!=
1
)
&&
(
Common_GetIgnOnTime
()
>=
3000
))
{
{
if
(
Get_Current_PageType
()
==
Page_Km_Unit
)
if
(
Get_Current_PageType
()
==
Page_Km_Unit
)
...
@@ -1689,7 +1708,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
...
@@ -1689,7 +1708,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
}
}
else
else
{
{
if
((
Get_Current_Page
Type
()
==
Page_Odo
)
||
(
Get_Current_PageType
()
==
Page_Trip
))
if
((
Get_Current_Page
Menu
()
==
Page_Odo
)
||
(
Get_Current_PageMenu
()
==
Page_Trip
))
{
{
if
(
m_Uint
==
0
)
if
(
m_Uint
==
0
)
{
{
...
@@ -1702,7 +1721,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
...
@@ -1702,7 +1721,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
IC1_SEG037
=
IC_SEG_OFF
;
IC1_SEG037
=
IC_SEG_OFF
;
}
}
if
(
Get_Current_Page
Type
()
==
Page_Odo
)
if
(
Get_Current_Page
Menu
()
==
Page_Odo
)
{
{
IC1_SEG072
=
IC_SEG_ON
;
IC1_SEG072
=
IC_SEG_ON
;
IC1_SEG045
=
IC_SEG_OFF
;
IC1_SEG045
=
IC_SEG_OFF
;
...
@@ -1710,7 +1729,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
...
@@ -1710,7 +1729,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_35_ODO
,
LED_ON
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_35_ODO
,
LED_ON
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_34_TRIP
,
LED_OFF
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_34_TRIP
,
LED_OFF
);
}
}
else
if
(
Get_Current_Page
Type
()
==
Page_Trip
)
else
if
(
Get_Current_Page
Menu
()
==
Page_Trip
)
{
{
IC1_SEG072
=
IC_SEG_OFF
;
IC1_SEG072
=
IC_SEG_OFF
;
IC1_SEG045
=
IC_SEG_ON
;
IC1_SEG045
=
IC_SEG_ON
;
...
@@ -1748,7 +1767,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
...
@@ -1748,7 +1767,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_34_TRIP
,
LED_ON
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_34_TRIP
,
LED_ON
);
}
}
if
((
Get_Current_Page
Type
()
==
Page_Odo
)
||
(
ClearODO_Flag
==
1
)
||
(
Common_GetIgnOnTime
()
<
3000
))
if
((
Get_Current_Page
Menu
()
==
Page_Odo
)
||
(
ClearODO_Flag
==
1
)
||
(
Common_GetIgnOnTime
()
<
3000
))
{
{
if
(
m_NUM_ODO
>
99999
)
if
(
m_NUM_ODO
>
99999
)
{
{
...
@@ -2078,7 +2097,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
...
@@ -2078,7 +2097,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
IC1_SEG040
=
IC_SEG_OFF
;
IC1_SEG040
=
IC_SEG_OFF
;
}
}
}
}
else
if
(
Get_Current_Page
Type
()
==
Page_Trip
)
else
if
(
Get_Current_Page
Menu
()
==
Page_Trip
)
{
{
IC1_SEG076
=
IC_SEG_OFF
;
IC1_SEG076
=
IC_SEG_OFF
;
IC1_SEG071
=
IC_SEG_OFF
;
IC1_SEG071
=
IC_SEG_OFF
;
...
@@ -2338,7 +2357,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
...
@@ -2338,7 +2357,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
IC1_SEG040
=
IC_SEG_OFF
;
IC1_SEG040
=
IC_SEG_OFF
;
}
}
}
}
else
if
(
Get_Current_Page
Type
()
==
Page_DTC
)
else
if
(
Get_Current_Page
Menu
()
==
Page_DTC
)
{
{
IC1_SEG076
=
IC_SEG_OFF
;
IC1_SEG076
=
IC_SEG_OFF
;
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
CAN_CH0_ID_CAN_0x402_Msg_Count
)
==
CAN_SIG_LOST
)
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
CAN_CH0_ID_CAN_0x402_Msg_Count
)
==
CAN_SIG_LOST
)
...
@@ -2396,7 +2415,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
...
@@ -2396,7 +2415,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
}
}
}
}
}
}
else
if
(
Get_Current_Page
Type
()
==
Page_TCS
)
else
if
(
Get_Current_Page
Menu
()
==
Page_TCS
)
{
{
IC1_SEG076
=
IC_SEG_OFF
;
IC1_SEG076
=
IC_SEG_OFF
;
...
...
Firmware/Source/Component/Key/Key_user.c
View file @
58e1184d
...
@@ -8,6 +8,7 @@ __align(4)
...
@@ -8,6 +8,7 @@ __align(4)
_Menu_Infor
MenuInfor
;
_Menu_Infor
MenuInfor
;
_Menu_Data
MenuData
;
_Menu_Data
MenuData
;
uint8_t
PageType
=
0
;
uint8_t
PageType
=
0
;
uint8_t
PageMenu
=
0
;
RTC_TimeTypeDef
RTC_TimeStruct
;
RTC_TimeTypeDef
RTC_TimeStruct
;
RTC_DateTypeDef
RTC_DateStruct
;
RTC_DateTypeDef
RTC_DateStruct
;
...
@@ -31,6 +32,24 @@ void Key_Operation_Left(Key_Event_en_t enKeyEvent)//Mode
...
@@ -31,6 +32,24 @@ void Key_Operation_Left(Key_Event_en_t enKeyEvent)//Mode
break
;
break
;
case
KEY_EVENT_LONG_PRESS_4
:
//10s
case
KEY_EVENT_LONG_PRESS_4
:
//10s
Maintain_Reset_Service
();
Maintain_Reset_Service
();
if
((
PageMenu
==
Page_TCS
)
&&
(
PageType
==
Page_Menu
))
{
if
(
Get_Dis_Tcs_Val
()
==
0
)
{
MenuData
.
Tcs_Val
=
1
;
//on
}
else
{
MenuData
.
Tcs_Val
=
0
;
//off
}
}
if
((
PageMenu
==
Page_Trip
)
&&
(
PageType
==
Page_Menu
))
{
Data_Clear_Trip_All
();
}
TYW_RESET_ODO
();
TYW_RESET_ODO
();
break
;
break
;
case
KEY_EVENT_OFF_TO_ON
:
case
KEY_EVENT_OFF_TO_ON
:
...
@@ -132,9 +151,9 @@ void Key_KL30_Init_EXample(void)
...
@@ -132,9 +151,9 @@ void Key_KL30_Init_EXample(void)
Key_Parameter_Set_Short_Press_1_Time
(
50U
,
1000U
);
Key_Parameter_Set_Short_Press_1_Time
(
50U
,
1000U
);
Key_Parameter_Set_Short_Press_2_Time
(
3000U
,
9000U
);
Key_Parameter_Set_Short_Press_2_Time
(
3000U
,
9000U
);
//Key_Parameter_Set_Long_Press_1_Time(70
00U);
Key_Parameter_Set_Long_Press_1_Time
(
91
00U
);
//Key_Parameter_Set_Long_Press_2_Time(80
00U);
Key_Parameter_Set_Long_Press_2_Time
(
92
00U
);
//Key_Parameter_Set_Long_Press_3_Time(90
00U);
Key_Parameter_Set_Long_Press_3_Time
(
93
00U
);
Key_Parameter_Set_Long_Press_4_Time
(
10000U
);
Key_Parameter_Set_Long_Press_4_Time
(
10000U
);
}
}
void
Key_Wakeup_Init_EXample
(
void
)
void
Key_Wakeup_Init_EXample
(
void
)
...
@@ -158,7 +177,7 @@ void Key_Wakeup_Init_EXample(void)
...
@@ -158,7 +177,7 @@ void Key_Wakeup_Init_EXample(void)
void
KEY_LEFT_EVENT_NONE_Service
(
void
)
void
KEY_LEFT_EVENT_NONE_Service
(
void
)
{
{
MenuInfor
.
Back_Time_Left
++
;
MenuInfor
.
Back_Time_Left
++
;
if
((
MenuInfor
.
Back_Time_Left
>
BACK_MENU_TIME
)
&&
(
PageType
!=
Page_
DTC
))
if
((
MenuInfor
.
Back_Time_Left
>
BACK_MENU_TIME
)
&&
(
PageType
!=
Page_
Menu
))
{
{
MenuInfor
.
Back_Time_Left
=
BACK_MENU_TIME
;
MenuInfor
.
Back_Time_Left
=
BACK_MENU_TIME
;
MenuInfor
.
Back_Time_Left_Flag
=
1
;
MenuInfor
.
Back_Time_Left_Flag
=
1
;
...
@@ -188,22 +207,26 @@ void Key_Left_Short_Press(void)
...
@@ -188,22 +207,26 @@ void Key_Left_Short_Press(void)
uint8_t
datmin
=
0u
;
uint8_t
datmin
=
0u
;
if
(
PageType
==
Page_
Odo
)
if
(
PageType
==
Page_
Menu
)
{
{
PageType
=
Page_Trip
;
if
(
PageMenu
==
Page_Odo
)
}
{
else
if
(
PageType
==
Page_Trip
)
PageMenu
=
Page_Trip
;
{
}
PageType
=
Page_DTC
;
else
if
(
PageMenu
==
Page_Trip
)
}
{
else
if
(
PageType
==
Page_DTC
)
PageMenu
=
Page_DTC
;
{
}
PageType
=
Page_TCS
;
else
if
(
PageMenu
==
Page_DTC
)
}
{
else
if
(
PageType
==
Page_TCS
)
PageMenu
=
Page_TCS
;
{
}
PageType
=
Page_Odo
;
else
if
(
PageMenu
==
Page_TCS
)
{
PageMenu
=
Page_Odo
;
}
}
}
if
(
PageType
==
Page_Time_Hour
)
if
(
PageType
==
Page_Time_Hour
)
{
{
...
@@ -262,14 +285,14 @@ void Key_Auto_Save(void)
...
@@ -262,14 +285,14 @@ void Key_Auto_Save(void)
{
{
RTC_SetTime
(
&
counter_val
.
time
);
RTC_SetTime
(
&
counter_val
.
time
);
}
}
PageType
=
Page_
Odo
;
PageType
=
Page_
Menu
;
}
}
}
}
void
Key_Left_Long_Press
(
void
)
void
Key_Left_Long_Press
(
void
)
{
{
if
(
PageType
==
Page_Odo
)
if
(
(
PageType
==
Page_Menu
)
)
{
{
PageType
=
Page_Time_Hour
;
PageType
=
Page_Time_Hour
;
}
}
...
@@ -287,29 +310,14 @@ void Key_Left_Long_Press(void)
...
@@ -287,29 +310,14 @@ void Key_Left_Long_Press(void)
}
}
else
if
(
PageType
==
Page_Tpms_Unit
)
else
if
(
PageType
==
Page_Tpms_Unit
)
{
{
PageType
=
Page_
Odo
;
PageType
=
Page_
Menu
;
}
}
else
else
{
{
;
;
}
}
if
(
PageType
==
Page_TCS
)
{
if
(
Get_Dis_Tcs_Val
()
==
0
)
{
MenuData
.
Tcs_Val
=
1
;
//on
}
else
{
MenuData
.
Tcs_Val
=
0
;
//off
}
}
if
(
PageType
==
Page_Trip
)
{
Data_Clear_Trip_All
();
}
}
}
...
@@ -397,7 +405,7 @@ void TYW_RESET_ODO(void)
...
@@ -397,7 +405,7 @@ void TYW_RESET_ODO(void)
void
Maintain_Reset_Service
(
void
)
void
Maintain_Reset_Service
(
void
)
{
{
if
(
Get_Data_Maintenace_Interval_Processing
()
==
0
)
if
(
(
Get_Data_Maintenace_Interval_Processing
()
==
0
)
&&
(
PageMenu
==
Page_TCS
)
&&
(
PageType
==
Page_Menu
)
)
{
{
Data_Maintenance_Interval_Reset
();
Data_Maintenance_Interval_Reset
();
}
}
...
@@ -417,6 +425,10 @@ uint8_t Get_Current_PageType(void)
...
@@ -417,6 +425,10 @@ uint8_t Get_Current_PageType(void)
{
{
return
PageType
;
return
PageType
;
}
}
uint8_t
Get_Current_PageMenu
(
void
)
{
return
PageMenu
;
}
uint8_t
Get_Dis_KM_Unit
(
void
)
uint8_t
Get_Dis_KM_Unit
(
void
)
{
{
...
...
Firmware/Source/Component/Key/Key_user.h
View file @
58e1184d
...
@@ -24,18 +24,24 @@ typedef struct
...
@@ -24,18 +24,24 @@ typedef struct
typedef
enum
typedef
enum
{
{
Page_
Odo
=
0
,
Page_
Menu
=
0
,
Page_Time_Hour
,
Page_Time_Hour
,
Page_Time_Minute
,
Page_Time_Minute
,
Page_Km_Unit
,
Page_Km_Unit
,
Page_Tpms_Unit
,
Page_Tpms_Unit
,
Page_Max
,
}
_Page_Type
;
typedef
enum
{
Page_Odo
=
0
,
Page_Trip
,
Page_Trip
,
Page_DTC
,
Page_DTC
,
Page_TCS
,
Page_TCS
,
Page_Max
,
Page_M
enu_M
ax
,
}
_Page_Type
;
}
_Page_
Menu_
Type
;
extern
uint8_t
PageType
;
extern
uint8_t
PageType
;
...
@@ -56,6 +62,7 @@ void Key_Auto_Save(void);
...
@@ -56,6 +62,7 @@ void Key_Auto_Save(void);
uint8_t
Get_Dis_Hour_Time
(
void
);
uint8_t
Get_Dis_Hour_Time
(
void
);
uint8_t
Get_Dis_Minute_Time
(
void
);
uint8_t
Get_Dis_Minute_Time
(
void
);
uint8_t
Get_Current_PageType
(
void
);
uint8_t
Get_Current_PageType
(
void
);
uint8_t
Get_Current_PageMenu
(
void
);
void
TYW_RESET_ODO
(
void
);
void
TYW_RESET_ODO
(
void
);
uint8_t
Get_Dis_KM_Unit
(
void
);
uint8_t
Get_Dis_KM_Unit
(
void
);
uint8_t
Get_Dis_Tpms_Unit
(
void
);
uint8_t
Get_Dis_Tpms_Unit
(
void
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment