Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
IVECO_NS216
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
时昊
IVECO_NS216
Commits
8ec07281
Commit
8ec07281
authored
Oct 10, 2024
by
梁百峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:修改背光逻辑,白天黑夜模式亮度分开显示
parent
a52e3ddb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
19 deletions
+61
-19
DataProcess.c
source/Appliciation/DataProcess.c
+36
-17
DataProcess.h
source/Appliciation/DataProcess.h
+1
-0
Menu_Interface.c
source/Appliciation/Menu_Interface.c
+24
-2
No files found.
source/Appliciation/DataProcess.c
View file @
8ec07281
...
@@ -9,6 +9,7 @@ uint8_t DataESpeedValid ;
...
@@ -9,6 +9,7 @@ uint8_t DataESpeedValid ;
#pragma ghs section bss = ".myNonInitArea"
#pragma ghs section bss = ".myNonInitArea"
_Light
g_Light
;
_Light
g_Light
;
_Light
g_nightLight
;
uint32_t
PowerIgnOnTimeLine
=
0
;
uint32_t
PowerIgnOnTimeLine
=
0
;
uint32_t
PowerIgnOffTimeLine
=
0
;
uint32_t
PowerIgnOffTimeLine
=
0
;
#pragma ghs section bss = default
#pragma ghs section bss = default
...
@@ -1192,6 +1193,7 @@ void GUI_Sound_Init(void)
...
@@ -1192,6 +1193,7 @@ void GUI_Sound_Init(void)
void
GUI_Light_Init
(
void
)
void
GUI_Light_Init
(
void
)
{
{
g_Light
.
Duty
=
450
;
g_Light
.
Duty
=
450
;
g_nightLight
.
Duty
=
100
;
}
}
void
Gui_LightProc
(
void
)
void
Gui_LightProc
(
void
)
...
@@ -1255,25 +1257,26 @@ void Gui_LightProc(void)
...
@@ -1255,25 +1257,26 @@ void Gui_LightProc(void)
}
}
else
else
{
{
if
(
Get_TelltalesLedSts
(
m_LED_Park_Lamp
)
==
1
)
if
(
(
Get_TelltalesLedSts
(
m_LED_Park_Lamp
)
==
1
)
||
(
Get_TelltalesLedSts
(
m_LED_High_Lamp
)
==
1
)
)
{
{
PWM_Channel_Set_Duty
(
1
,
g_Light
.
Duty
);
//表盘
PWM_Channel_Set_Duty
(
1
,
g_nightLight
.
Duty
);
//表盘
PWM_Channel_Set_Duty
(
3
,
g_Light
.
Duty
);
//指针
PWM_Channel_Set_Duty
(
3
,
g_nightLight
.
Duty
);
//指针
PWM_Channel_Set_Duty
(
5
,
200
);
//3.5
PWM_Channel_Set_Duty
(
5
,
g_nightLight
.
Duty
);
//3.5
}
}
else
//close lamp
else
//close lamp
{
{
PWM_Channel_Set_Duty
(
5
,
500
);
//3.5
PWM_Channel_Set_Duty
(
5
,
g_Light
.
Duty
);
//3.5
if
(
Menu_Get_Current_Cursor_Information
()
==
MENU_ITEM_SET_Backlight
)
//
if(Menu_Get_Current_Cursor_Information() == MENU_ITEM_SET_Backlight)
{
//
{
PWM_Channel_Set_Duty
(
1
,
g_Light
.
Duty
);
//表盘
PWM_Channel_Set_Duty
(
1
,
g_Light
.
Duty
);
//表盘
PWM_Channel_Set_Duty
(
3
,
g_Light
.
Duty
);
//指针
PWM_Channel_Set_Duty
(
3
,
g_Light
.
Duty
);
//指针
}
//
}
else
//
else
{
//
{
PWM_Channel_Set_Duty
(
1
,
0
);
//表盘
//
PWM_Channel_Set_Duty(1, 0);//表盘
PWM_Channel_Set_Duty
(
3
,
0
);
//指针
//
PWM_Channel_Set_Duty(3, 0);//指针
}
//
}
}
}
}
}
}
}
...
@@ -1281,7 +1284,15 @@ void Gui_LightProc(void)
...
@@ -1281,7 +1284,15 @@ void Gui_LightProc(void)
{
{
if
((
Pop_Alarm_Get_Current
()
==
POP_ALARM_POSITION_LIGHT
)
||
(
Pop_Alarm_Get_Current
()
==
POP_ALARM_KEY
))
if
((
Pop_Alarm_Get_Current
()
==
POP_ALARM_POSITION_LIGHT
)
||
(
Pop_Alarm_Get_Current
()
==
POP_ALARM_KEY
))
{
{
PWM_Channel_Set_Duty
(
5
,
500
);
//3.5
if
((
Get_TelltalesLedSts
(
m_LED_Park_Lamp
)
==
1
)
||
(
Get_TelltalesLedSts
(
m_LED_High_Lamp
)
==
1
))
{
PWM_Channel_Set_Duty
(
5
,
g_nightLight
.
Duty
);
//3.5
}
else
{
PWM_Channel_Set_Duty
(
5
,
g_Light
.
Duty
);
//3.5
}
}
}
else
else
{
{
...
@@ -1291,7 +1302,15 @@ void Gui_LightProc(void)
...
@@ -1291,7 +1302,15 @@ void Gui_LightProc(void)
}
}
else
else
{
{
PWM_Channel_Set_Duty
(
5
,
500
);
//3.5
if
((
Get_TelltalesLedSts
(
m_LED_Park_Lamp
)
==
1
)
||
(
Get_TelltalesLedSts
(
m_LED_High_Lamp
)
==
1
))
{
PWM_Channel_Set_Duty
(
5
,
g_nightLight
.
Duty
);
//3.5
}
else
{
PWM_Channel_Set_Duty
(
5
,
g_Light
.
Duty
);
//3.5
}
}
}
}
}
PWM_Channel_Set_Duty
(
1
,
0
);
//表盘
PWM_Channel_Set_Duty
(
1
,
0
);
//表盘
...
...
source/Appliciation/DataProcess.h
View file @
8ec07281
...
@@ -270,6 +270,7 @@ typedef struct
...
@@ -270,6 +270,7 @@ typedef struct
uint8_t
LightCn
;
uint8_t
LightCn
;
}
_Light
;
}
_Light
;
extern
_Light
g_nightLight
;
extern
_Light
g_Light
;
extern
_Light
g_Light
;
typedef
struct
typedef
struct
...
...
source/Appliciation/Menu_Interface.c
View file @
8ec07281
...
@@ -304,8 +304,30 @@ void Menu_Logic_Operation_SET_Backlight(Menu_Key_en_t enKeyType)
...
@@ -304,8 +304,30 @@ void Menu_Logic_Operation_SET_Backlight(Menu_Key_en_t enKeyType)
{
{
updataDir
=
1
;
updataDir
=
1
;
datmax
=
500u
;
datmax
=
500u
;
datmin
=
150u
;
datmin
=
100u
;
Menu_u16Data_Updata_Process
(
updataDir
,
datmax
,
datmin
,
50u
,
(
uint16_t
*
)
&
(
g_Light
.
Duty
));
if
((
Get_TelltalesLedSts
(
m_LED_Park_Lamp
)
==
1
)
||
(
Get_TelltalesLedSts
(
m_LED_High_Lamp
)
==
1
))
{
if
(
g_nightLight
.
Duty
==
100u
)
{
Menu_u16Data_Updata_Process
(
updataDir
,
datmax
,
datmin
,
100u
,
(
uint16_t
*
)
&
(
g_nightLight
.
Duty
));
}
else
{
Menu_u16Data_Updata_Process
(
updataDir
,
datmax
,
datmin
,
50u
,
(
uint16_t
*
)
&
(
g_nightLight
.
Duty
));
}
}
else
{
if
(
g_Light
.
Duty
==
100u
)
{
Menu_u16Data_Updata_Process
(
updataDir
,
datmax
,
datmin
,
100u
,
(
uint16_t
*
)
&
(
g_Light
.
Duty
));
}
else
{
Menu_u16Data_Updata_Process
(
updataDir
,
datmax
,
datmin
,
50u
,
(
uint16_t
*
)
&
(
g_Light
.
Duty
));
}
}
}
}
else
if
(
enKeyType
==
MENU_KEY_TIMEOUT
)
else
if
(
enKeyType
==
MENU_KEY_TIMEOUT
)
{
{
...
...
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