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
767570c5
Commit
767570c5
authored
Sep 10, 2024
by
李俭双
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix:代码评审问题:按键无操作超时时,秒清零存储操作由主循环更改放到按键动作里执行
parent
ca574cc1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
27 deletions
+48
-27
Key_user.c
Firmware/Source/Component/Key/Key_user.c
+47
-26
Sys_Task_List.c
Firmware/Source/System/Sys_Task_List.c
+1
-1
No files found.
Firmware/Source/Component/Key/Key_user.c
View file @
767570c5
...
@@ -216,7 +216,28 @@ void KEY_LEFT_EVENT_NONE_Service(void)
...
@@ -216,7 +216,28 @@ void KEY_LEFT_EVENT_NONE_Service(void)
if
((
MenuInfor
.
Back_Time_Left
>
BACK_MENU_TIME
)
&&
(
PageType
!=
Page_Menu
))
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;
if
(
PageType
==
Page_Time_Hour
)
{
if
(
Hour_Set
==
1
)
{
counter_val
.
time
.
RTC_Seconds
=
0
;
RTC_SetTime
(
&
counter_val
.
time
);
Hour_Set
=
0
;
}
}
if
(
PageType
==
Page_Time_Minute
)
{
if
(
Minute_Set
==
1
)
{
counter_val
.
time
.
RTC_Seconds
=
0
;
RTC_SetTime
(
&
counter_val
.
time
);
Minute_Set
=
0
;
}
}
PageType
=
Page_Menu
;
}
}
}
}
...
@@ -227,7 +248,7 @@ void Key_Clear_Time(void)
...
@@ -227,7 +248,7 @@ void Key_Clear_Time(void)
//if(Key_Status_Read_Left() == KEY_REALTIME_PRESS)
//if(Key_Status_Read_Left() == KEY_REALTIME_PRESS)
{
{
MenuInfor
.
Back_Time_Left
=
0
;
MenuInfor
.
Back_Time_Left
=
0
;
MenuInfor
.
Back_Time_Left_Flag
=
0
;
//
MenuInfor.Back_Time_Left_Flag = 0;
}
}
}
}
...
@@ -330,30 +351,30 @@ void Key_Left_Short_Press(void)
...
@@ -330,30 +351,30 @@ void Key_Left_Short_Press(void)
void
Key_Auto_Save
(
void
)
void
Key_Auto_Save
(
void
)
{
{
if
((
MenuInfor
.
Back_Time_Left_Flag
==
1
))
//
if((MenuInfor.Back_Time_Left_Flag == 1))
{
//
{
if
(
PageType
==
Page_Time_Hour
)
//
if(PageType == Page_Time_Hour)
{
//
{
if
(
Hour_Set
==
1
)
//
if (Hour_Set == 1)
{
//
{
counter_val
.
time
.
RTC_Seconds
=
0
;
//
counter_val.time.RTC_Seconds = 0;
RTC_SetTime
(
&
counter_val
.
time
);
//
RTC_SetTime(&counter_val.time);
Hour_Set
=
0
;
//
Hour_Set = 0;
}
//
}
}
//
}
//
if
(
PageType
==
Page_Time_Minute
)
//
if(PageType == Page_Time_Minute)
{
//
{
if
(
Minute_Set
==
1
)
//
if(Minute_Set == 1)
{
//
{
counter_val
.
time
.
RTC_Seconds
=
0
;
//
counter_val.time.RTC_Seconds = 0;
RTC_SetTime
(
&
counter_val
.
time
);
//
RTC_SetTime(&counter_val.time);
Minute_Set
=
0
;
//
Minute_Set = 0;
}
//
}
//
}
//
}
PageType
=
Page_Menu
;
//
PageType = Page_Menu ;
}
//
}
}
}
...
...
Firmware/Source/System/Sys_Task_List.c
View file @
767570c5
...
@@ -63,7 +63,7 @@ void Sys_10ms_Tasks(void)
...
@@ -63,7 +63,7 @@ void Sys_10ms_Tasks(void)
void
Sys_20ms_Tasks
(
void
)
void
Sys_20ms_Tasks
(
void
)
{
{
//Key_Clear_Time();
//Key_Clear_Time();
Key_Auto_Save
();
//
Key_Auto_Save();
Data_Vehicle_Speed_Processing_Service
();
Data_Vehicle_Speed_Processing_Service
();
Data_Engine_Speed_Processing_Service
();
Data_Engine_Speed_Processing_Service
();
Data_Coolant_Temp_Processing_Service
();
Data_Coolant_Temp_Processing_Service
();
...
...
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