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
5cc101bc
Commit
5cc101bc
authored
Apr 07, 2023
by
hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整NTC功能
parent
f3107d95
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
55 additions
and
60 deletions
+55
-60
BackGroundLight.c
source/Application/APP/BackLight/BackGroundLight.c
+41
-52
BackLight_APP.c
source/Application/APP/BackLight/BackLight_APP.c
+3
-2
BackgroundLight.h
source/Application/APP/BackLight/BackgroundLight.h
+3
-3
ADC.h
source/Driver/Analog_Signals/ADC.h
+1
-1
Analog_Signals.c
source/Driver/Analog_Signals/Analog_Signals.c
+5
-0
Analog_Signals.h
source/Driver/Analog_Signals/Analog_Signals.h
+1
-1
tasks.c
source/System/tasks.c
+1
-1
No files found.
source/Application/APP/BackLight/BackGroundLight.c
View file @
5cc101bc
...
@@ -192,65 +192,53 @@ void BackLightDamp(uint8_t TimeX)
...
@@ -192,65 +192,53 @@ void BackLightDamp(uint8_t TimeX)
}
}
/*-------------------------------------------------------------------------
/*-------------------------------------------------------------------------
* Function Name :
App_SwapShort
* Function Name :
calculate_Thermistor
* Description
: ½»»»Êý¾Ý
* Description
:
* Input : None
* Input : None
* Output : None
* Output : None
* Return : None
* Return : None
* onther : qitiancun 2018-9-10
* onther : qitiancun 2018-9-10
--------------------------------------------------------------------------*/
--------------------------------------------------------------------------*/
void
AD_SwapShort
(
uint16_t
*
pData1
,
uint16_t
*
pData2
)
uint32_t
Calculate_Thermistor
(
BL_STATE_PARA
BLFunStatePara
)
{
{
uint16_t
psw
;
uint32_t
resistance
=
0
;
if
((
*
pData1
)
>
(
*
pData2
))
uint32_t
ThermistorADValue
=
0
;
uint8_t
i
=
0
;
uint16_t
AdValue
=
0
;
AdValue
=
BLFunStatePara
.
BL_User_NTC_AD
;
if
(
ThermistorIndex
==
0
)
{
{
psw
=
(
*
pData2
);
ThermistorList
[
ThermistorIndex
++
]
=
AdValue
;
(
*
pData2
)
=
(
*
pData1
);
(
*
pData1
)
=
psw
;
}
}
}
else
{
/*-------------------------------------------------------------------------
for
(
i
=
0
;
i
<
ThermistorIndex
;
i
++
)
* Function Name : App_SortShort
* Description :
* Input : None
* Output : None
* Return : None
* onther : qitiancun 2018-9-10
--------------------------------------------------------------------------*/
void
AD_SortShort
(
uint16_t
SortData
[],
uint8_t
len
)
{
uint8_t
n
=
0u
,
m
;
for
(;
n
<
len
-
1u
;
n
++
)
{
{
for
(
m
=
n
+
1u
;
m
<
len
;
m
++
)
if
(
AdValue
<
ThermistorList
[
i
]
)
{
{
AD_SwapShort
(
&
SortData
[
n
],
&
SortData
[
m
]);
memmove
((
uint8_t
*
)
&
ThermistorList
[
i
+
1
],
(
uint8_t
*
)
&
ThermistorList
[
i
],
(
ThermistorIndex
-
i
)
*
sizeof
(
ThermistorList
[
i
]));
ThermistorList
[
i
]
=
AdValue
;
ThermistorIndex
++
;
break
;
}
}
if
(
i
==
ThermistorIndex
)
{
ThermistorList
[
ThermistorIndex
++
]
=
AdValue
;
}
}
}
}
}
/*-------------------------------------------------------------------------
* Function Name : calculate_Thermistor
* Description :
* Input : None
* Output : None
* Return : None
* onther : qitiancun 2018-9-10
--------------------------------------------------------------------------*/
uint16_t
Calculate_Thermistor
(
BL_STATE_PARA
BLFunStatePara
)
{
uint32_t
resistance
=
0u
;
uint32_t
TmpNTCADMax
=
0u
;
ThermistorList
[
ThermistorIndex
]
=
BLFunStatePara
.
BL_User_NTC_AD
;
TmpNTCADMax
=
BLFunStatePara
.
BL_User_NTC_AD_MAX
*
10u
;
ThermistorIndex
++
;
ThermistorIndex
=
(
ThermistorIndex
+
1u
)
%
5u
;
AD_SortShort
(
ThermistorList
,
5u
);
if
((
ThermistorCurValue
>
(
ThermistorList
[
2u
]
+
3u
))
||
((
ThermistorCurValue
+
3u
)
<
ThermistorList
[
2
]))
if
(
ThermistorIndex
>
THERMISTLISTCN
)
{
ThermistorIndex
=
0
;
ThermistorADValue
=
(
ThermistorList
[
0
]
+
ThermistorList
[
1
]
+
ThermistorList
[
2
]
\
+
ThermistorList
[
3
]
+
ThermistorList
[
4
]
+
ThermistorList
[
5
])
/
6
;
if
((
ThermistorCurValue
>
(
ThermistorADValue
+
3
))
||
((
ThermistorCurValue
+
3
)
<
ThermistorADValue
))
{
{
ThermistorCurValue
=
ThermistorList
[
2
];
ThermistorCurValue
=
ThermistorADValue
;
}
}
}
/*
/*
ad 10K
ad 10K
...
@@ -264,23 +252,24 @@ uint16_t Calculate_Thermistor(BL_STATE_PARA BLFunStatePara)
...
@@ -264,23 +252,24 @@ uint16_t Calculate_Thermistor(BL_STATE_PARA BLFunStatePara)
*/
*/
if
(
ThermistorCurValue
)
if
(
ThermistorCurValue
)
{
{
resistance
=
((
TmpNTCADMax
-
(
10u
*
ThermistorCurValue
))
*
100u
)
/
ThermistorCurValue
;
resistance
=
((
40960
-
(
10u
*
ThermistorCurValue
))
*
100u
)
/
ThermistorCurValue
;
}
}
else
else
{
{
resistance
=
7851u
;
resistance
=
7851u
;
}
}
return
(
uint16_t
)
resistance
;
return
resistance
;
}
}
void
BackLightDeal_NTC
(
BL_USER_PARA
BL_FunPara
,
BL_STATE_PARA
BLFunStatePara
)
void
BackLightDeal_NTC
(
BL_USER_PARA
BL_FunPara
,
BL_STATE_PARA
BLFunStatePara
)
{
{
uint16_t
tmpval
;
uint16_t
tmpval
;
uint
16
_t
NTCresistance
;
uint
32
_t
NTCresistance
;
uint16_t
BacklightTftDestVal
;
uint16_t
BacklightTftDestVal
;
uint32_t
tmpDestVal
;
uint32_t
tmpDestVal
;
NTCresistance
=
Calculate_Thermistor
(
BLFunStatePara
);
NTCresistance
=
Calculate_Thermistor
(
BLFunStatePara
);
/* high temprature TFT decrease brightness*/
/* high temprature TFT decrease brightness*/
if
((
NTCresistance
>=
1
607u
)
&&
(
NTCresistance
<=
1712u
))
if
((
NTCresistance
>=
1
507
)
&&
(
NTCresistance
<=
1712u
))
{
{
CurBacklightLv
=
BACKLIGHT_LV80
;
CurBacklightLv
=
BACKLIGHT_LV80
;
BackLightDerating
=
1u
;
BackLightDerating
=
1u
;
...
...
source/Application/APP/BackLight/BackLight_APP.c
View file @
5cc101bc
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
#include "Data_Fuel_User.h"
#include "Data_Fuel_User.h"
#include "Menu.h"
#include "Menu.h"
#include "GUI.h"
#include "GUI.h"
#include "Analog_Signals.h"
typedef
struct
typedef
struct
{
{
...
@@ -148,8 +149,8 @@ void BL_Management_service(void)
...
@@ -148,8 +149,8 @@ void BL_Management_service(void)
/*得到背光等级 可自己在枚举中定义 在BackGroundLight.c里填表*/
/*得到背光等级 可自己在枚举中定义 在BackGroundLight.c里填表*/
GetBGLLvl
((
BackLightVLv
-
1
),
LED_Pos
);
GetBGLLvl
((
BackLightVLv
-
1
),
LED_Pos
);
/*得到热敏电阻电压参数为
100倍电压
值*/
/*得到热敏电阻电压参数为
AD数
值*/
//DNC_NumValue = RTE_Read_NTC_R_Valid
();
DNC_NumValue
=
Common_Get_NTCAD
();
GetBGLNTCVol
((
uint16_t
)
DNC_NumValue
);
GetBGLNTCVol
((
uint16_t
)
DNC_NumValue
);
/*主函数中调用第一个参数电源状态 1是 ON档 2 off 第二个参数 唤醒条件 1是TTF唤醒 2 是表盘唤醒 3 是表盘和屏都有唤醒,0无唤醒*/
/*主函数中调用第一个参数电源状态 1是 ON档 2 off 第二个参数 唤醒条件 1是TTF唤醒 2 是表盘唤醒 3 是表盘和屏都有唤醒,0无唤醒*/
...
...
source/Application/APP/BackLight/BackgroundLight.h
View file @
5cc101bc
...
@@ -11,6 +11,8 @@
...
@@ -11,6 +11,8 @@
#define BACKLIGHT_LV100 0u
#define BACKLIGHT_LV100 0u
#define BACKLIGHT_LV80 1u
#define BACKLIGHT_LV80 1u
#define BACKLIGHT_LV40 2u
#define BACKLIGHT_LV40 2u
#define THERMISTLISTCN 120
extern
void
SetBackLightOutput
(
uint8_t
n
,
uint16_t
val
);
extern
void
SetBackLightOutput
(
uint8_t
n
,
uint16_t
val
);
extern
void
SetBacklightDestVal
(
uint8_t
n
,
const
uint16_t
val
);
extern
void
SetBacklightDestVal
(
uint8_t
n
,
const
uint16_t
val
);
extern
void
SetBacklightCurVal
(
uint8_t
n
,
uint16_t
val
);
extern
void
SetBacklightCurVal
(
uint8_t
n
,
uint16_t
val
);
...
@@ -20,7 +22,5 @@ extern void BackLightDeal(BL_USER_PARA BL_FunPara, BL_STATE_PARA BLFunStatePara
...
@@ -20,7 +22,5 @@ extern void BackLightDeal(BL_USER_PARA BL_FunPara, BL_STATE_PARA BLFunStatePara
extern
void
SetBacklightMinVal
(
uint8_t
n
,
uint16_t
val
);
extern
void
SetBacklightMinVal
(
uint8_t
n
,
uint16_t
val
);
/*TFT高温处理函数*/
/*TFT高温处理函数*/
extern
void
BackLightDeal_NTC
(
BL_USER_PARA
BL_FunPara
,
BL_STATE_PARA
BLFunStatePara
);
extern
void
BackLightDeal_NTC
(
BL_USER_PARA
BL_FunPara
,
BL_STATE_PARA
BLFunStatePara
);
extern
void
AD_SwapShort
(
uint16_t
*
pData1
,
uint16_t
*
pData2
);
extern
uint32_t
Calculate_Thermistor
(
BL_STATE_PARA
BLFunStatePara
);
extern
void
AD_SortShort
(
uint16_t
SortData
[],
uint8_t
len
);
extern
uint16_t
Calculate_Thermistor
(
BL_STATE_PARA
BLFunStatePara
);
#endif
#endif
\ No newline at end of file
source/Driver/Analog_Signals/ADC.h
View file @
5cc101bc
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
#include "r_typedefs.h"
#include "r_typedefs.h"
#define ADC_RESOLUTION (409
6
U)
/* 12bit ADC */
#define ADC_RESOLUTION (409
5
U)
/* 12bit ADC */
...
...
source/Driver/Analog_Signals/Analog_Signals.c
View file @
5cc101bc
...
@@ -400,3 +400,8 @@ uint16_t ADC_Conv_Single_Channel(uint8_t u8ADCCh)
...
@@ -400,3 +400,8 @@ uint16_t ADC_Conv_Single_Channel(uint8_t u8ADCCh)
return
u16Result
;
return
u16Result
;
}
}
uint16_t
Common_Get_NTCAD
(
void
)
{
return
u16ADCSample
[
ADC_CH_NTC_R
];
}
\ No newline at end of file
source/Driver/Analog_Signals/Analog_Signals.h
View file @
5cc101bc
...
@@ -54,7 +54,7 @@ extern void Analog_Signal_Conv_Service(void);
...
@@ -54,7 +54,7 @@ extern void Analog_Signal_Conv_Service(void);
extern
uint16_t
ADC_Read_Signal
(
uint8_t
u8ADCCh
);
extern
uint16_t
ADC_Read_Signal
(
uint8_t
u8ADCCh
);
extern
uint8_t
ADC_Read_Signal_Valid
(
uint8_t
u8ADCCh
);
extern
uint8_t
ADC_Read_Signal_Valid
(
uint8_t
u8ADCCh
);
extern
uint16_t
ADC_Conv_Single_Channel
(
uint8_t
u8ADCCh
);
extern
uint16_t
ADC_Conv_Single_Channel
(
uint8_t
u8ADCCh
);
uint16_t
Common_Get_NTCAD
(
void
);
/*! @} */
/*! @} */
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
source/System/tasks.c
View file @
5cc101bc
...
@@ -238,6 +238,7 @@ void Sys_Run_Mode_50ms_Tasks(void)
...
@@ -238,6 +238,7 @@ void Sys_Run_Mode_50ms_Tasks(void)
Speed_PPK_Processing
();
Speed_PPK_Processing
();
Sound_Scheduling_Service
();
Sound_Scheduling_Service
();
// BGTask();
// BGTask();
BL_Management_service
();
LED_Driver_Scan_Refresh
();
LED_Driver_Scan_Refresh
();
Drive_Info_IC1_STATUS_Rx
();
Drive_Info_IC1_STATUS_Rx
();
...
@@ -252,7 +253,6 @@ void Sys_Run_Mode_50ms_Tasks(void)
...
@@ -252,7 +253,6 @@ void Sys_Run_Mode_50ms_Tasks(void)
//uint32_t YZHD_Count = 0;
//uint32_t YZHD_Count = 0;
void
Sys_Run_Mode_100ms_Tasks
(
void
)
void
Sys_Run_Mode_100ms_Tasks
(
void
)
{
{
BL_Management_service
();
RTE_RTC_Services_100Ms_Cbk
();
RTE_RTC_Services_100Ms_Cbk
();
Data_ODO_Processing
();
Data_ODO_Processing
();
Data_Trip_Processing
();
Data_Trip_Processing
();
...
...
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