Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
haoJin750TFT
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
时昊
haoJin750TFT
Commits
a216be03
Commit
a216be03
authored
Aug 27, 2024
by
张金硕
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://tyw-server.synology.me:12345/shihao/haojin750tft
into jinshuo
parents
50147235
72efb25c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
108 additions
and
63 deletions
+108
-63
BackLight.c
Firmware/Source/Application/BackLight.c
+48
-41
Key_user.c
Firmware/Source/Component/Key/Key_user.c
+29
-8
Key_user.h
Firmware/Source/Component/Key/Key_user.h
+2
-0
Menu_Interface.c
Firmware/Source/Component/Menu/Menu_Interface.c
+28
-13
Sys_Task_List.c
Firmware/Source/System/Sys_Task_List.c
+1
-1
No files found.
Firmware/Source/Application/BackLight.c
View file @
a216be03
...
...
@@ -138,64 +138,71 @@ void Data_Light_Res_service(Light_uint8_t deltaTime)//获取光感阻值,并
}
}
timeCount
+=
deltaTime
;
if
(
Menu_Item_Select_Get
(
MENU_ITEM_SELECT_AUTO
)
)
if
(
SYS_OPR_STAT_IGN_ON
)
{
if
(
LightADCompleteFlg
)
if
(
Menu_Item_Select_Get
(
MENU_ITEM_SELECT_AUTO
)
)
{
if
(
Light
R
<=
800
)
if
(
Light
ADCompleteFlg
)
{
LightR_Status_Count
++
;
if
(
LightR_Status_Count
>=
150
)
if
(
LightR
<=
800
)
{
LightR_Status_Count
++
;
if
(
LightR_Status_Count
>=
150
)
{
LightR_Status_Count
=
0
;
LightR_Status
=
0
;
}
}
else
if
(
LightR
>
800
)
{
LightR_Status_Count
++
;
if
(
LightR_Status_Count
>=
150
)
{
LightR_Status_Count
=
0
;
LightR_Status
=
1
;
}
}
if
(
LightR_Status
==
0
)
{
TimerM_PWM_set_duty
(
TIMERM_COUNTER1
,
TIMERM_CHB
,
BACK_LIGHT_Val_2
);
}
else
{
LightR_Status_Count
=
0
;
LightR_Status
=
0
;
}
TimerM_PWM_set_duty
(
TIMERM_COUNTER1
,
TIMERM_CHB
,
BACK_LIGHT_Val_5
);
}
}
else
if
(
LightR
>
800
)
}
else
if
(
Menu_Item_Select_Get
(
MENU_ITEM_BACKLIGHT_AUTO
))
{
if
(
Backlight_SetPwmLevel
()
==
1U
)
{
LightR_Status_Count
++
;
if
(
LightR_Status_Count
>=
150
)
{
LightR_Status_Count
=
0
;
LightR_Status
=
1
;
}
TimerM_PWM_set_duty
(
TIMERM_COUNTER1
,
TIMERM_CHB
,
BACK_LIGHT_Val_1
);
}
if
(
LightR_Status
==
0
)
else
if
(
Backlight_SetPwmLevel
()
==
2U
)
{
TimerM_PWM_set_duty
(
TIMERM_COUNTER1
,
TIMERM_CHB
,
BACK_LIGHT_Val_2
);
TimerM_PWM_set_duty
(
TIMERM_COUNTER1
,
TIMERM_CHB
,
BACK_LIGHT_Val_2
);
}
else
else
if
(
Backlight_SetPwmLevel
()
==
3U
)
{
TimerM_PWM_set_duty
(
TIMERM_COUNTER1
,
TIMERM_CHB
,
BACK_LIGHT_Val_5
);
TimerM_PWM_set_duty
(
TIMERM_COUNTER1
,
TIMERM_CHB
,
BACK_LIGHT_Val_3
);
}
else
if
(
Backlight_SetPwmLevel
()
==
4U
)
{
TimerM_PWM_set_duty
(
TIMERM_COUNTER1
,
TIMERM_CHB
,
BACK_LIGHT_Val_4
);
}
else
if
(
Backlight_SetPwmLevel
()
==
5U
)
{
TimerM_PWM_set_duty
(
TIMERM_COUNTER1
,
TIMERM_CHB
,
BACK_LIGHT_Val_5
);
}
}
}
else
if
(
Menu_Item_Select_Get
(
MENU_ITEM_BACKLIGHT_AUTO
))
{
if
(
Backlight_SetPwmLevel
()
==
1U
)
{
TimerM_PWM_set_duty
(
TIMERM_COUNTER1
,
TIMERM_CHB
,
BACK_LIGHT_Val_1
);
}
else
if
(
Backlight_SetPwmLevel
()
==
2U
)
{
TimerM_PWM_set_duty
(
TIMERM_COUNTER1
,
TIMERM_CHB
,
BACK_LIGHT_Val_2
);
}
else
if
(
Backlight_SetPwmLevel
()
==
3U
)
{
TimerM_PWM_set_duty
(
TIMERM_COUNTER1
,
TIMERM_CHB
,
BACK_LIGHT_Val_3
);
}
else
if
(
Backlight_SetPwmLevel
()
==
4U
)
{
TimerM_PWM_set_duty
(
TIMERM_COUNTER1
,
TIMERM_CHB
,
BACK_LIGHT_Val_4
);
}
else
if
(
Backlight_SetPwmLevel
()
==
5U
)
else
{
TimerM_PWM_set_duty
(
TIMERM_COUNTER1
,
TIMERM_CHB
,
BACK_LIGHT_Val_5
);
BackLight_Process
(
);
}
}
else
{
BackLight_Process
(
);
TimerM_PWM_set_duty
(
TIMERM_COUNTER1
,
TIMERM_CHB
,
0
);
}
}
...
...
Firmware/Source/Component/Key/Key_user.c
View file @
a216be03
...
...
@@ -50,6 +50,18 @@ void Key_Operation_Right(Key_Event_en_t enKeyEvent)//确认
switch
(
enKeyEvent
)
{
case
KEY_EVENT_SHORT_PRESS_1
:
/* 在数字闪烁界面的时候,按确认键保存时间 */
if
((
Menu_Get_Current_Cursor_Information
()
==
MENU_ITEM_CLOCK_HOUR_TENB_SET
)
||
(
Menu_Get_Current_Cursor_Information
()
==
MENU_ITEM_CLOCK_HOUR_BIT_SET
)
||
(
Menu_Get_Current_Cursor_Information
()
==
MENU_ITEM_CLOCK_MIN_TENB_SET
)
||
(
Menu_Get_Current_Cursor_Information
()
==
MENU_ITEM_CLOCK_MIN_BIT_SET
)
)
{
// Menu_Logic_Operation_Clock_Hour_Tenb_Set(MENU_KEY_CONFIRM_SHORT);
counter_val
.
time
.
RTC_Hours
=
(
MenuData
.
Dis_Hour_Tenb
*
10
+
MenuData
.
Dis_Hour_Bit
);
counter_val
.
time
.
RTC_Minutes
=
(
MenuData
.
Dis_Minute_Tenb
*
10
+
MenuData
.
Dis_Minute_Bit
);
counter_val
.
time
.
RTC_Seconds
=
0U
;
RTC_SetTime
(
&
counter_val
.
time
);
}
Key_Event_Short_Press_Right
();
break
;
case
KEY_EVENT_SHORT_PRESS_2
:
...
...
@@ -355,23 +367,32 @@ void TYW_RESET_ODO(void)
void
Get_DisTime_Service
(
void
)
{
if
(
1
)
{
RTE_RTC_Get_CounterValue
(
&
counter_val
);
counter_val
.
time
.
RTC_Hours
=
RTC_Bcd2ToByte
(
counter_val
.
time
.
RTC_Hours
);
counter_val
.
time
.
RTC_Minutes
=
RTC_Bcd2ToByte
(
counter_val
.
time
.
RTC_Minutes
);
}
if
((
Menu_Get_Current_Cursor_Information
()
==
MENU_ITEM_CLOCK_HOUR_TENB_SET
)
||
(
Menu_Get_Current_Cursor_Information
()
==
MENU_ITEM_CLOCK_HOUR_BIT_SET
)
||
(
Menu_Get_Current_Cursor_Information
()
==
MENU_ITEM_CLOCK_MIN_TENB_SET
)
||
(
Menu_Get_Current_Cursor_Information
()
==
MENU_ITEM_CLOCK_MIN_BIT_SET
)
)
{
}
else
{
/* 由于需要不保存时间,需要另外一套计时的方式 */
RTE_RTC_Get_CounterValue
(
&
counter_val
);
counter_val
.
time
.
RTC_Hours
=
RTC_Bcd2ToByte
(
counter_val
.
time
.
RTC_Hours
);
MenuData
.
u8Dis_Hour
=
counter_val
.
time
.
RTC_Hours
;
counter_val
.
time
.
RTC_Minutes
=
RTC_Bcd2ToByte
(
counter_val
.
time
.
RTC_Minutes
);
MenuData
.
u8Dis_Minute
=
counter_val
.
time
.
RTC_Minutes
;
}
}
uint8_t
Get_Dis_Hour_Time
(
void
)
{
return
counter_val
.
time
.
RTC_Hours
;
return
MenuData
.
u8Dis_Hour
;
}
uint8_t
Get_Dis_Minute_Time
(
void
)
{
return
counter_val
.
time
.
RTC_Minutes
;
return
MenuData
.
u8Dis_Minute
;
}
uint8_t
Get_Dis_Unit
(
void
)
...
...
Firmware/Source/Component/Key/Key_user.h
View file @
a216be03
...
...
@@ -45,6 +45,8 @@ typedef struct
uint8_t
OdoAndTrip
;
uint8_t
Bluetooth_Open_Close
;
uint8_t
Clock_Flash
;
uint8_t
u8Dis_Hour
;
uint8_t
u8Dis_Minute
;
}
_Menu_Data
;
extern
uint8_t
OTA_Update_Flag
;
...
...
Firmware/Source/Component/Menu/Menu_Interface.c
View file @
a216be03
...
...
@@ -395,13 +395,15 @@ void Menu_Logic_Operation_Clock_Hour_Tenb_Set(Menu_Key_en_t enKeyType)
datmax
=
2u
;
datmin
=
0u
;
Menu_u8Data_Updata_Process
(
updataDir
,
datmax
,
datmin
,
1u
,
(
uint8_t
*
)
&
(
MenuData
.
Dis_Hour_Tenb
));
MenuData
.
u8Dis_Hour
=
(
MenuData
.
Dis_Hour_Tenb
*
10
+
MenuData
.
Dis_Hour_Bit
);
MenuData
.
u8Dis_Minute
=
(
MenuData
.
Dis_Minute_Tenb
*
10
+
MenuData
.
Dis_Minute_Bit
);
}
if
(
MENU_KEY_CONFIRM_SHORT
==
enKeyType
)
{
counter_val
.
time
.
RTC_Hours
=
(
MenuData
.
Dis_Hour_Tenb
*
10
+
MenuData
.
Dis_Hour_Bit
);
counter_val
.
time
.
RTC_Minutes
=
(
MenuData
.
Dis_Minute_Tenb
*
10
+
MenuData
.
Dis_Minute_Bit
);
RTC_SetTime
(
&
counter_val
.
time
);
//
counter_val.time.RTC_Hours = (MenuData.Dis_Hour_Tenb*10 + MenuData.Dis_Hour_Bit);
//
counter_val.time.RTC_Minutes = (MenuData.Dis_Minute_Tenb*10 + MenuData.Dis_Minute_Bit);
//
RTC_SetTime(&counter_val.time);
}
}
void
Menu_Logic_Operation_Clock_Hour_Bit_Set
(
Menu_Key_en_t
enKeyType
)
...
...
@@ -412,16 +414,25 @@ void Menu_Logic_Operation_Clock_Hour_Bit_Set(Menu_Key_en_t enKeyType)
if
(
enKeyType
==
MENU_KEY_DOWN_SHORT
)
{
updataDir
=
1
;
datmax
=
9u
;
if
(
MenuData
.
Dis_Hour_Tenb
==
2
)
{
datmax
=
3u
;
}
else
{
datmax
=
9u
;
}
datmin
=
0u
;
Menu_u8Data_Updata_Process
(
updataDir
,
datmax
,
datmin
,
1u
,
(
uint8_t
*
)
&
(
MenuData
.
Dis_Hour_Bit
));
MenuData
.
u8Dis_Hour
=
(
MenuData
.
Dis_Hour_Tenb
*
10
+
MenuData
.
Dis_Hour_Bit
);
MenuData
.
u8Dis_Minute
=
(
MenuData
.
Dis_Minute_Tenb
*
10
+
MenuData
.
Dis_Minute_Bit
);
}
if
(
MENU_KEY_CONFIRM_SHORT
==
enKeyType
)
{
counter_val
.
time
.
RTC_Hours
=
(
MenuData
.
Dis_Hour_Tenb
*
10
+
MenuData
.
Dis_Hour_Bit
);
counter_val
.
time
.
RTC_Minutes
=
(
MenuData
.
Dis_Minute_Tenb
*
10
+
MenuData
.
Dis_Minute_Bit
);
RTC_SetTime
(
&
counter_val
.
time
);
// MenuData.Dis_Hour
= (MenuData.Dis_Hour_Tenb*10 + MenuData.Dis_Hour_Bit);
// MenuData.Dis_Minute
= (MenuData.Dis_Minute_Tenb*10 + MenuData.Dis_Minute_Bit);
//
RTC_SetTime(&counter_val.time);
}
}
...
...
@@ -436,13 +447,15 @@ void Menu_Logic_Operation_Clock_Min_Tenb_Set(Menu_Key_en_t enKeyType)
datmax
=
5u
;
datmin
=
0u
;
Menu_u8Data_Updata_Process
(
updataDir
,
datmax
,
datmin
,
1u
,
(
uint8_t
*
)
&
(
MenuData
.
Dis_Minute_Tenb
));
MenuData
.
u8Dis_Hour
=
(
MenuData
.
Dis_Hour_Tenb
*
10
+
MenuData
.
Dis_Hour_Bit
);
MenuData
.
u8Dis_Minute
=
(
MenuData
.
Dis_Minute_Tenb
*
10
+
MenuData
.
Dis_Minute_Bit
);
}
if
(
MENU_KEY_CONFIRM_SHORT
==
enKeyType
)
{
counter_val
.
time
.
RTC_Hours
=
(
MenuData
.
Dis_Hour_Tenb
*
10
+
MenuData
.
Dis_Hour_Bit
);
counter_val
.
time
.
RTC_Minutes
=
(
MenuData
.
Dis_Minute_Tenb
*
10
+
MenuData
.
Dis_Minute_Bit
);
RTC_SetTime
(
&
counter_val
.
time
);
//
counter_val.time.RTC_Hours = (MenuData.Dis_Hour_Tenb*10 + MenuData.Dis_Hour_Bit);
//
counter_val.time.RTC_Minutes = (MenuData.Dis_Minute_Tenb*10 + MenuData.Dis_Minute_Bit);
//
RTC_SetTime(&counter_val.time);
}
}
...
...
@@ -457,13 +470,15 @@ void Menu_Logic_Operation_Clock_Min_Bit_Set(Menu_Key_en_t enKeyType)
datmax
=
9u
;
datmin
=
0u
;
Menu_u8Data_Updata_Process
(
updataDir
,
datmax
,
datmin
,
1u
,
(
uint8_t
*
)
&
(
MenuData
.
Dis_Minute_Bit
));
MenuData
.
u8Dis_Hour
=
(
MenuData
.
Dis_Hour_Tenb
*
10
+
MenuData
.
Dis_Hour_Bit
);
MenuData
.
u8Dis_Minute
=
(
MenuData
.
Dis_Minute_Tenb
*
10
+
MenuData
.
Dis_Minute_Bit
);
}
if
(
MENU_KEY_CONFIRM_SHORT
==
enKeyType
)
{
counter_val
.
time
.
RTC_Hours
=
(
MenuData
.
Dis_Hour_Tenb
*
10
+
MenuData
.
Dis_Hour_Bit
);
counter_val
.
time
.
RTC_Minutes
=
(
MenuData
.
Dis_Minute_Tenb
*
10
+
MenuData
.
Dis_Minute_Bit
);
RTC_SetTime
(
&
counter_val
.
time
);
//
counter_val.time.RTC_Hours = (MenuData.Dis_Hour_Tenb*10 + MenuData.Dis_Hour_Bit);
//
counter_val.time.RTC_Minutes = (MenuData.Dis_Minute_Tenb*10 + MenuData.Dis_Minute_Bit);
//
RTC_SetTime(&counter_val.time);
}
}
...
...
Firmware/Source/System/Sys_Task_List.c
View file @
a216be03
...
...
@@ -60,7 +60,7 @@ void Sys_50ms_Tasks(void)
if
((
MenuData
.
Dis_Hour_Tenb
*
10
+
MenuData
.
Dis_Hour_Bit
)
>
23
)
{
MenuData
.
Dis_Hour_Tenb
=
2
;
MenuData
.
Dis_Hour_Bit
=
3
;
MenuData
.
Dis_Hour_Bit
=
0
;
}
if
((
MenuData
.
Dis_Minute_Tenb
*
10
+
MenuData
.
Dis_Minute_Bit
)
>
59
)
...
...
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