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
d3fed906
Commit
d3fed906
authored
Jul 31, 2024
by
郑萍
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:水温阻值接口开路接口,以及燃油电源一直拉低
parent
f6ebd86d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
203 deletions
+39
-203
Data_Coolant.c
Firmware/Source/Application/Data_Coolant.c
+30
-199
AMT630H.c
Firmware/Source/Component/AMT630H/AMT630H.c
+1
-1
Components.h
Firmware/Source/Component/Components.h
+0
-1
PowerManag_user.c
Firmware/Source/Component/PowerManagement/PowerManag_user.c
+2
-2
Sys_Task_List.c
Firmware/Source/System/Sys_Task_List.c
+6
-0
No files found.
Firmware/Source/Application/Data_Coolant.c
View file @
d3fed906
#include "Data_Coolant.h"
#include "Components.h"
#define Coolant_DATA_TIME 25u
/*这里填写多长时间采集一个数据,单位ms*/
#define Coolant_DATA_NUM 20u
/*燃油电阻采集数据总数 最大255*/
#define Coolant_CAL_START 5u
/*数据排序后取中间部分计算平均:起始*/
...
...
@@ -65,7 +63,7 @@ void Coolant_R_Cal(uint8_t deltaTime)
uint32_t
temp32
;
static
uint16_t
timeCount
=
0
;
if
(
g_u8CoolantStateInitFlag
)
if
(
g_u8CoolantStateInitFlag
)
{
CoolantR
=
ADC_Read_Signal
(
ADC_CH_COOLANT_TEMP1_R
);
}
...
...
@@ -123,26 +121,26 @@ void Coolant_R_Cal(uint8_t deltaTime)
void
Coolant_State_Check
(
uint8_t
deltaTime
)
{
if
(
CoolantR
<
30
)
{
/*短路3*/
g_u16CoolantSensorOpenTime
=
0
;
g_u16CoolantSensorNormalTime
=
0
;
if
((
g_u16CoolantSensorShortTime
>
3000
)
||
((
g_u8CoolantStateInitFlag
)
&&
(
g_u16CoolantSensorShortTime
>
3000
)))
{
CoolantSensorState
=
CoolantSensorShortCircuit
;
g_u8DesCoolantSetp
=
0
;
g_u8CurCoolantSetp
=
6
;
g_u8CoolantStateInitFlag
=
0
;
g_u8CoolantInitFlag
=
1
;
g_u8CoolantDir
=
Coolant_SEG_UP
;
}
else
{
g_u16CoolantSensorShortTime
+=
deltaTime
;
}
}
else
if
(
CoolantR
>
31
00
)
{
/*开路 3
1
0*/
//
if (CoolantR < 30)
//
{ /*短路3*/
//
g_u16CoolantSensorOpenTime = 0;
//
g_u16CoolantSensorNormalTime = 0;
//
if ((g_u16CoolantSensorShortTime > 3000) || ((g_u8CoolantStateInitFlag) && (g_u16CoolantSensorShortTime > 3000)))
//
{
//
CoolantSensorState = CoolantSensorShortCircuit;
//
g_u8DesCoolantSetp = 0;
//
g_u8CurCoolantSetp = 6;
//
g_u8CoolantStateInitFlag = 0;
//
g_u8CoolantInitFlag = 1;
//
g_u8CoolantDir = Coolant_SEG_UP;
//
}
//
else
//
{
//
g_u16CoolantSensorShortTime += deltaTime;
//
}
//
}
if
(
CoolantR
>
30
00
)
{
/*开路 3
0
0*/
g_u16CoolantSensorShortTime
=
0
;
g_u16CoolantSensorNormalTime
=
0
;
if
((
g_u16CoolantSensorOpenTime
>
3000
)
||
((
g_u8CoolantStateInitFlag
)
&&
(
g_u16CoolantSensorOpenTime
>
3000
)))
...
...
@@ -179,127 +177,15 @@ void Coolant_Gauges_Cal(uint8_t deltaTime)
{
static
uint16_t
time
=
0
;
if
((
CoolantSensorState
==
CoolantSensorNormal
)
&&
(
CoolantR
<=
3100
)
&&
(
CoolantR
>=
30
))
{
/*采集完第一组数据后,开始计算燃油格数*/
if
(
g_u8CoolantADCompleteFlg
)
if
((
CoolantSensorState
==
CoolantSensorNormal
)
&&
(
CoolantR
<=
3000
))
// && (CoolantR >= 30)
{
if
(
CoolantR
<
180
)
{
if
(
g_u8CoolantInitFlag
)
{
CoolantRBak
=
CoolantR
;
}
/*根据回差计算走动方向*/
if
(
g_u8CoolantDir
==
Coolant_SEG_UP
)
{
if
(
CoolantR
>=
CoolantRBak
+
RETURN_DIFFERENCE
)
{
g_u8CoolantDir
=
Coolant_SEG_DOWN
;
CoolantRBak
=
CoolantR
;
}
if
(
CoolantR
<
CoolantRBak
)
{
CoolantRBak
=
CoolantR
;
}
}
else
{
if
(
CoolantRBak
>=
CoolantR
+
RETURN_DIFFERENCE
)
{
g_u8CoolantDir
=
Coolant_SEG_UP
;
CoolantRBak
=
CoolantR
;
}
if
(
CoolantR
>
CoolantRBak
)
{
CoolantRBak
=
CoolantR
;
}
}
/*计算目标格数*/
if
(
g_u8CoolantDir
==
Coolant_SEG_UP
)
{
if
(((
g_u8DesCoolantSetp
==
5
)
||
g_u8CoolantInitFlag
)
&&
(
CoolantR
<
30
))
{
g_u8DesCoolantSetp
=
6
;
}
else
if
(((
g_u8DesCoolantSetp
==
4
)
||
g_u8CoolantInitFlag
)
&&
(
CoolantR
<
160
))
{
g_u8DesCoolantSetp
=
5
;
}
else
if
(((
g_u8DesCoolantSetp
==
3
)
||
g_u8CoolantInitFlag
)
&&
(
CoolantR
<
300
))
{
g_u8DesCoolantSetp
=
4
;
}
else
if
(((
g_u8DesCoolantSetp
==
2
)
||
g_u8CoolantInitFlag
)
&&
(
CoolantR
<
500
))
{
g_u8DesCoolantSetp
=
3
;
}
else
if
(((
g_u8DesCoolantSetp
==
1
)
||
g_u8CoolantInitFlag
)
&&
(
CoolantR
<
790
))
{
g_u8DesCoolantSetp
=
2
;
}
else
if
(((
g_u8DesCoolantSetp
==
0
)
||
g_u8CoolantInitFlag
)
&&
(
CoolantR
<=
3100
))
{
g_u8DesCoolantSetp
=
1
;
}
}
else
if
(
g_u8CoolantDir
==
Coolant_SEG_DOWN
)
{
if
(((
g_u8DesCoolantSetp
==
1
)
||
g_u8CoolantInitFlag
)
&&
(
CoolantR
>
3100
))
{
g_u8DesCoolantSetp
=
0
;
}
else
if
(((
g_u8DesCoolantSetp
==
2
)
||
g_u8CoolantInitFlag
)
&&
(
CoolantR
>=
790
))
{
g_u8DesCoolantSetp
=
1
;
}
else
if
(((
g_u8DesCoolantSetp
==
3
)
||
g_u8CoolantInitFlag
)
&&
(
CoolantR
>=
500
))
{
g_u8DesCoolantSetp
=
2
;
}
else
if
(((
g_u8DesCoolantSetp
==
4
)
||
g_u8CoolantInitFlag
)
&&
(
CoolantR
>=
300
))
{
g_u8DesCoolantSetp
=
3
;
}
else
if
(((
g_u8DesCoolantSetp
==
5
)
||
g_u8CoolantInitFlag
)
&&
(
CoolantR
>=
160
))
{
g_u8DesCoolantSetp
=
4
;
}
else
if
(((
g_u8DesCoolantSetp
==
6
)
||
g_u8CoolantInitFlag
)
&&
(
CoolantR
>=
30
))
{
g_u8DesCoolantSetp
=
5
;
}
}
g_u8DesCoolantSetp
=
1
;
}
/*IGN ON 1秒/故障恢复后,开始走格 立即指向当前格 20220704*/
if
(
Common_GetIgnOnTime
()
>=
3000
)
else
if
(
CoolantR
>
220
)
{
time
+=
deltaTime
;
if
(
g_u8CoolantInitFlag
)
{
g_u8CoolantInitFlag
=
0
;
time
=
0
;
g_u8CurCoolantSetp
=
g_u8DesCoolantSetp
;
}
if
(
time
>=
15000
)
{
/* 15S变化一格 */
time
=
0
;
if
(
g_u8CurCoolantSetp
<
g_u8DesCoolantSetp
)
{
g_u8CurCoolantSetp
++
;
}
else
if
(
g_u8CurCoolantSetp
>
g_u8DesCoolantSetp
)
{
g_u8CurCoolantSetp
--
;
}
}
if
(
g_u8CurCoolantSetp
==
g_u8DesCoolantSetp
)
{
time
=
0
;
}
g_u8DesCoolantSetp
=
0
;
}
}
}
...
...
@@ -313,67 +199,12 @@ void Coolant_Cal_Sevice(uint8_t deltaTime)
Coolant_Gauges_Cal
(
deltaTime
);
}
uint8_t
Get_CurCoolantSetp
(
void
)
uint8_t
Get_CurCoolantSetp
State
(
void
)
{
uint8_t
u8CurCoolantSetp
=
g_u8CurCoolantSetp
;
if
(
CoolantSensorState
==
CoolantSensorOpenCircuit
)
{
if
(
FLASH_SYNC_1Hz
)
{
u8CurCoolantSetp
=
6
;
}
else
{
u8CurCoolantSetp
=
0
;
}
}
else
if
(
CoolantSensorState
==
CoolantSensorShortCircuit
)
{
if
(
FLASH_SYNC_1Hz
)
{
u8CurCoolantSetp
=
7
;
}
else
{
u8CurCoolantSetp
=
0
;
}
}
else
if
(
u8CurCoolantSetp
==
1
)
{
if
(
FLASH_SYNC_1Hz
)
{
u8CurCoolantSetp
=
1
;
}
else
{
u8CurCoolantSetp
=
0
;
}
}
else
{
;
}
return
u8CurCoolantSetp
;
return
g_u8DesCoolantSetp
;
}
CoolantSensorSts_t
Get_Coolant_Sensor_State
(
void
)
{
uint8_t
u8CurCoolantSetp
=
0
;
if
(
CoolantSensorState
==
CoolantSensorOpenCircuit
||
g_u8CurCoolantSetp
==
1u
)
{
if
(
FLASH_SYNC_1Hz
)
{
u8CurCoolantSetp
=
2
;
}
else
{
u8CurCoolantSetp
=
0
;
}
}
else
{
u8CurCoolantSetp
=
1u
;
}
return
u8CurCoolantSetp
;
return
CoolantSensorState
;
}
Firmware/Source/Component/AMT630H/AMT630H.c
View file @
d3fed906
...
...
@@ -160,7 +160,7 @@ void Amt630hInit(void)
LcdSoundParamterData
.
LcdWiringMode
=
LCD_WIRING_MODE_BGR
;
LcdSoundParamterData
.
LcdWiringBitOrder
=
LCD_WIRING_BIT_ORDER_MSB
;
LcdSoundParamterData
.
LcdDotClkReverse
=
0
;
/* NuoMa 50pin TFT */
LcdSoundParamterData
.
LvdsPanelFormat
=
LVDS_PANEL_FORMAT_
NS
;
LcdSoundParamterData
.
LvdsPanelFormat
=
LVDS_PANEL_FORMAT_
TI
;
LcdSoundParamterData
.
LvdsPanelData
=
LVDS_PANEL_DATA_8BIT
;
LcdSoundParamterData
.
LcdTimingVBP
=
12
;
...
...
Firmware/Source/Component/Components.h
View file @
d3fed906
...
...
@@ -28,7 +28,6 @@
#include "Data_VSpeed.h"
#include "Data_Coolant.h"
#include "Data_Fuel.h"
#include "Data_Coolant.h"
#include "Mileage\Services_Mileage_User.h"
#include "BackLight.h"
#include "RTC\RTE_RTC.h"
...
...
Firmware/Source/Component/PowerManagement/PowerManag_user.c
View file @
d3fed906
...
...
@@ -66,7 +66,7 @@ static void Power_KL30_Init(void)
Menu_User_Init
();
Can_Init
();
Protocol_KL30_Wakeup_Init
();
RTE_DEEPSLEEP_GPIO_Interrupt_Enable
(
KL15_AD_IN
,
Trigger_Rising
);
//
RTE_DEEPSLEEP_GPIO_Interrupt_Enable(KL15_AD_IN, Trigger_Rising);
}
static
void
Power_Wakeup_Init
(
void
)
...
...
@@ -90,7 +90,7 @@ static void Power_Wakeup_Init(void)
Menu_User_WAKEUP
();
Can_Init
();
Protocol_KL30_Wakeup_Init
();
RTE_DEEPSLEEP_GPIO_Interrupt_Enable
(
KL15_AD_IN
,
Trigger_Rising
);
//
RTE_DEEPSLEEP_GPIO_Interrupt_Enable(KL15_AD_IN, Trigger_Rising);
}
static
void
Power_LVP_Init
(
void
)
...
...
Firmware/Source/System/Sys_Task_List.c
View file @
d3fed906
...
...
@@ -32,6 +32,7 @@ void Sys_10ms_Tasks(void)
Key_Clear_Time
();
Key_TimeOut_Service
();
Fuel_R_Cal
(
10u
);
Coolant_R_Cal
(
10u
);
}
void
Sys_20ms_Tasks
(
void
)
...
...
@@ -46,12 +47,17 @@ void Sys_50ms_Tasks(void)
g_u8Cursor_Posittion
=
Menu_Get_Current_Cursor_Information
();
}
void
Sys_100ms_Tasks
(
void
)
{
Get_DisTime_Service
();
Fuel_Cal_Sevice
(
100u
);
Coolant_Cal_Sevice
(
100u
);
Services_Mileage_Callback
();
RTE_GPIO_Set_Level
(
Blacklight_PWM
,
1
);
RTE_GPIO_Config
(
RTE_GPIO_PORT05_PIN04
,
GpioOut_High
);
}
static
uint16_t
task_2ms
=
0u
;
void
Sys_Exact_50us_Tasks
(
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