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
abd6e7ae
Commit
abd6e7ae
authored
May 06, 2024
by
李俭双
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'lijianshuang' into 'dev'
Lijianshuang See merge request
!4
parents
3458d39c
193bb952
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
434 additions
and
289 deletions
+434
-289
HaoJin.uvprojx
Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/HaoJin.uvprojx
+5
-5
CAN_CH0_CAN_Communication_Matrix.c
...ce/Application/CAN_APP/CAN_CH0_CAN_Communication_Matrix.c
+8
-2
CAN_CH0_CAN_Communication_Matrix.h
...ce/Application/CAN_APP/CAN_CH0_CAN_Communication_Matrix.h
+4
-1
Can_App.c
Firmware/Source/Application/CAN_User/Can_App.c
+1
-1
Can_App.h
Firmware/Source/Application/CAN_User/Can_App.h
+1
-1
GUI_Display.c
Firmware/Source/Application/GUI_Display/GUI_Display.c
+22
-22
SEG_DISPLAY.c
Firmware/Source/Application/SEG_DISPLAY/SEG_DISPLAY.c
+18
-18
Key_user.c
Firmware/Source/Component/Key/Key_user.c
+8
-8
LED_Driver_Interface.h
Firmware/Source/Component/LED_Driver/LED_Driver_Interface.h
+38
-39
Line_In_user.c
Firmware/Source/Component/Line_In/Line_In_user.c
+46
-3
Line_In_user.h
Firmware/Source/Component/Line_In/Line_In_user.h
+9
-3
PowerManag_user.c
Firmware/Source/Component/PowerManagement/PowerManag_user.c
+2
-2
Telltales_user.c
Firmware/Source/Component/Telltales/Telltales_user.c
+250
-175
Telltales_user.h
Firmware/Source/Component/Telltales/Telltales_user.h
+22
-9
No files found.
Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/HaoJin.uvprojx
View file @
abd6e7ae
...
...
@@ -16,7 +16,7 @@
<TargetCommonOption>
<Device>
BAT32A239KK64FB
</Device>
<Vendor>
Cmsemicon
</Vendor>
<PackID>
Cmsemicon.BAT32A239.1.0.
5
</PackID>
<PackID>
Cmsemicon.BAT32A239.1.0.
3
</PackID>
<PackURL>
http://www.mcu.com.cn/pack/
</PackURL>
<Cpu>
IRAM(0x20000000,0x08000) IROM(0x00000000,0x40000) CPUTYPE("Cortex-M0+") CLOCK(12000000) ELITTLE
</Cpu>
<FlashUtilSpec></FlashUtilSpec>
...
...
@@ -1156,7 +1156,7 @@
<file
attr=
"config"
category=
"source"
name=
"Device\Source\isr_BAT32A239.c"
version=
"1.0.0"
>
<instance
index=
"0"
>
RTE\Device\BAT32A239KK64FB\isr_BAT32A239.c
</instance>
<component
Cclass=
"Device"
Cgroup=
"ISR"
Cvendor=
"Cmsemicon"
Cversion=
"1.0.0"
condition=
"BAT32A239 CMSIS-CORE"
/>
<package
name=
"BAT32A239"
schemaVersion=
"1.4"
url=
"http://www.mcu.com.cn/pack/"
vendor=
"Cmsemicon"
version=
"1.0.
5
"
/>
<package
name=
"BAT32A239"
schemaVersion=
"1.4"
url=
"http://www.mcu.com.cn/pack/"
vendor=
"Cmsemicon"
version=
"1.0.
3
"
/>
<targetInfos>
<targetInfo
name=
"HaoJin232"
/>
</targetInfos>
...
...
@@ -1164,7 +1164,7 @@
<file
attr=
"config"
category=
"source"
condition=
"Startup ARM"
name=
"Device\Source\ARM\startup_BAT32A239.s"
version=
"1.0.0"
>
<instance
index=
"0"
>
RTE\Device\BAT32A239KK64FB\startup_BAT32A239.s
</instance>
<component
Cclass=
"Device"
Cgroup=
"Startup"
Cvendor=
"Cmsemicon"
Cversion=
"1.0.0"
condition=
"BAT32A239 CMSIS-CORE"
/>
<package
name=
"BAT32A239"
schemaVersion=
"1.4"
url=
"http://www.mcu.com.cn/pack/"
vendor=
"Cmsemicon"
version=
"1.0.
5
"
/>
<package
name=
"BAT32A239"
schemaVersion=
"1.4"
url=
"http://www.mcu.com.cn/pack/"
vendor=
"Cmsemicon"
version=
"1.0.
3
"
/>
<targetInfos>
<targetInfo
name=
"HaoJin232"
/>
</targetInfos>
...
...
@@ -1172,7 +1172,7 @@
<file
attr=
"config"
category=
"source"
name=
"Device\Source\system_BAT32A239.c"
version=
"1.0.0"
>
<instance
index=
"0"
>
RTE\Device\BAT32A239KK64FB\system_BAT32A239.c
</instance>
<component
Cclass=
"Device"
Cgroup=
"Startup"
Cvendor=
"Cmsemicon"
Cversion=
"1.0.0"
condition=
"BAT32A239 CMSIS-CORE"
/>
<package
name=
"BAT32A239"
schemaVersion=
"1.4"
url=
"http://www.mcu.com.cn/pack/"
vendor=
"Cmsemicon"
version=
"1.0.
5
"
/>
<package
name=
"BAT32A239"
schemaVersion=
"1.4"
url=
"http://www.mcu.com.cn/pack/"
vendor=
"Cmsemicon"
version=
"1.0.
3
"
/>
<targetInfos>
<targetInfo
name=
"HaoJin232"
/>
</targetInfos>
...
...
@@ -1180,7 +1180,7 @@
<file
attr=
"config"
category=
"header"
name=
"Device\Source\userdefine.h"
version=
"1.0.0"
>
<instance
index=
"0"
>
RTE\Device\BAT32A239KK64FB\userdefine.h
</instance>
<component
Cclass=
"Device"
Cgroup=
"Startup"
Cvendor=
"Cmsemicon"
Cversion=
"1.0.0"
condition=
"BAT32A239 CMSIS-CORE"
/>
<package
name=
"BAT32A239"
schemaVersion=
"1.4"
url=
"http://www.mcu.com.cn/pack/"
vendor=
"Cmsemicon"
version=
"1.0.
5
"
/>
<package
name=
"BAT32A239"
schemaVersion=
"1.4"
url=
"http://www.mcu.com.cn/pack/"
vendor=
"Cmsemicon"
version=
"1.0.
3
"
/>
<targetInfos>
<targetInfo
name=
"HaoJin232"
/>
</targetInfos>
...
...
Firmware/Source/Application/CAN_APP/CAN_CH0_CAN_Communication_Matrix.c
View file @
abd6e7ae
#include "CAN_CH0_CAN_Communication_Matrix.h"
#include "Components.h"
#include "Application.h"
/* 2024/04/26 10:01:26 */
st_CanMsgOp
CAN_CH0_CanMsgOp
;
st_CanMsgTxOp
CAN_CH0_CanMsgTxOp
;
...
...
@@ -6,6 +8,10 @@ st_CanMsgTxOp CAN_CH0_CanMsgTxOp;
const
st_CAN_SendAttribute
CAN_CH0_CANSendAttr
[
CAN_CH0_ID_SEND_TOTAL
]
=
{
{
0x220ul
,
8ul
*
1000ul
,
7ul
*
1000ul
,
0u
,
MSG_STD
,
1u
,
8u
,
CAN_MSG_TX_CYCLE
,
Can_Set_Buff_500
,
(
void
*
)
0
},
{
0x6EEul
,
8ul
*
1000ul
,
7ul
*
1000ul
,
0u
,
MSG_STD
,
1u
,
8u
,
CAN_MSG_TX_CYCLE
,
Can_Set_Buff_500
,
(
void
*
)
0
},
{
0x6EFul
,
8ul
*
1000ul
,
7ul
*
1000ul
,
0u
,
MSG_STD
,
1u
,
8u
,
CAN_MSG_TX_CYCLE
,
Can_Set_Buff_500
,
(
void
*
)
0
},
{
0x450ul
,
8ul
*
1000ul
,
7ul
*
1000ul
,
0u
,
MSG_STD
,
1u
,
8u
,
CAN_MSG_TX_CYCLE
,
Can_Set_Buff_500
,
(
void
*
)
0
},
};
const
st_CANMsgAttribute
CAN_CH0_CAN_MSG_CONST_ARRAY
[
CAN_CH0_ID_TOTAL_MAX
]
=
...
...
@@ -54,7 +60,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
5
000ul
,
1
000ul
,
0x120ul
,
((
void
*
)
0
),
((
void
*
)
0
),
...
...
@@ -64,7 +70,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
5
000ul
,
2
000ul
,
0x101ul
,
((
void
*
)
0
),
((
void
*
)
0
),
...
...
Firmware/Source/Application/CAN_APP/CAN_CH0_CAN_Communication_Matrix.h
View file @
abd6e7ae
...
...
@@ -20,7 +20,10 @@ typedef enum
typedef
enum
{
CAN_CH0_ID_CAN_0x220_Msg_Count
,
CAN_CH0_ID_CAN_0x6EE_Msg_Count
,
CAN_CH0_ID_CAN_0x6EF_Msg_Count
,
CAN_CH0_ID_CAN_0x450_Msg_Count
,
CAN_CH0_ID_SEND_TOTAL
,
}
CAN_CH0_CAN_MSG_SEND_ID_t
;
...
...
Firmware/Source/Application/CAN_User/Can_App.c
View file @
abd6e7ae
...
...
@@ -12,7 +12,7 @@ void Can_Set_Buff_500(canlib_uint8_t CopyData[])
p500
=
(
CANMsg500Union
*
)
CopyData
;
if
(
p500
!=
(
void
*
)
0
)
{
p500
->
Sig
.
Key_ISTOP
=
Auto_Start_Stop
;
//
p500->Sig.Key_ISTOP = Auto_Start_Stop;
p500
->
Msg
[
1
]
=
0x00
;
p500
->
Msg
[
2
]
=
0x00
;
p500
->
Msg
[
3
]
=
0x00
;
...
...
Firmware/Source/Application/CAN_User/Can_App.h
View file @
abd6e7ae
...
...
@@ -26,7 +26,7 @@ typedef union
void
Can_Set_Buff_500
(
canlib_uint8_t
CopyData
[]);
#endif
Firmware/Source/Application/GUI_Display/GUI_Display.c
View file @
abd6e7ae
...
...
@@ -31,7 +31,7 @@ void Gauge_Clock_Display(void)
{
PageType_DIS
=
Get_Current_PageType
();
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_06_Screen_Time
,
100
);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_06_Screen_Time, 100);
if
(
PageType_DIS
==
1
)
{
...
...
@@ -64,7 +64,7 @@ void Gauge_Clock_Display(void)
else
{
SEG_SET_Clock
(
0
,
0
,
0
,
0
,
0
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_06_Screen_Time
,
0
);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_06_Screen_Time, 0);
}
}
...
...
@@ -151,16 +151,16 @@ void Gauge_Service(void)
else
{
Clear_Bu98
();
RTE_GPIO_Set_Level
(
VSPEED_TEN_OUT
,
0
);
RTE_GPIO_Set_Level
(
VSPEED_HUNDREDS_OUT
,
0
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_29_MPH
,
0
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_30_KM_H
,
0
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_07_Key_ISTOP
,
0
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_02_Normal_Voltage
,
0
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_03_High_Low_Voltage
,
0
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_04_Fuel_W
,
0
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_05_Fuel_Y
,
0
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_06_Screen_Time
,
0
);
//
RTE_GPIO_Set_Level(VSPEED_TEN_OUT, 0);
//
RTE_GPIO_Set_Level(VSPEED_HUNDREDS_OUT, 0);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_29_MPH, 0);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_30_KM_H, 0);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, 0);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_02_Normal_Voltage, 0);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_03_High_Low_Voltage, 0);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_04_Fuel_W, 0);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_05_Fuel_Y, 0);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_06_Screen_Time, 0);
}
}
else
...
...
@@ -193,16 +193,16 @@ void Gauge_Service(void)
else
{
Clear_Bu98
();
RTE_GPIO_Set_Level
(
VSPEED_TEN_OUT
,
0
);
RTE_GPIO_Set_Level
(
VSPEED_HUNDREDS_OUT
,
0
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_29_MPH
,
0
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_30_KM_H
,
0
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_07_Key_ISTOP
,
0
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_02_Normal_Voltage
,
0
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_03_High_Low_Voltage
,
0
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_04_Fuel_W
,
0
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_05_Fuel_Y
,
0
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_06_Screen_Time
,
0
);
//
RTE_GPIO_Set_Level(VSPEED_TEN_OUT, 0);
//
RTE_GPIO_Set_Level(VSPEED_HUNDREDS_OUT, 0);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_29_MPH, 0);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_30_KM_H, 0);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, 0);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_02_Normal_Voltage, 0);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_03_High_Low_Voltage, 0);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_04_Fuel_W, 0);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_05_Fuel_Y, 0);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_06_Screen_Time, 0);
}
}
...
...
Firmware/Source/Application/SEG_DISPLAY/SEG_DISPLAY.c
View file @
abd6e7ae
...
...
@@ -1618,20 +1618,20 @@ _Fun_Res SEG_SET_VSpeed_NUM(uint8_t m_Flag, uint16_t m_NUM)
uint8_t
m8
;
if
(
m_NUM
>
9
)
{
RTE_GPIO_Set_Level
(
VSPEED_TEN_OUT
,
1
);
//
RTE_GPIO_Set_Level(VSPEED_TEN_OUT, 1);
}
else
{
RTE_GPIO_Set_Level
(
VSPEED_TEN_OUT
,
0
);
//
RTE_GPIO_Set_Level(VSPEED_TEN_OUT, 0);
}
if
(
m_NUM
>
99
)
{
RTE_GPIO_Set_Level
(
VSPEED_HUNDREDS_OUT
,
1
);
//
RTE_GPIO_Set_Level(VSPEED_HUNDREDS_OUT, 1);
}
else
{
RTE_GPIO_Set_Level
(
VSPEED_HUNDREDS_OUT
,
0
);
//
RTE_GPIO_Set_Level(VSPEED_HUNDREDS_OUT, 0);
}
if
((
m_Flag
>
2u
)
||
(
m_NUM
>
299u
))
...
...
@@ -1647,7 +1647,7 @@ _Fun_Res SEG_SET_VSpeed_NUM(uint8_t m_Flag, uint16_t m_NUM)
IC1_SEG059
=
IC_SEG_ON
;
IC1_SEG058
=
IC_SEG_ON
;
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_29_MPH
,
100
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_30_KM_H
,
100
);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_30_KM_H, 100);
}
else
{
...
...
@@ -1656,7 +1656,7 @@ _Fun_Res SEG_SET_VSpeed_NUM(uint8_t m_Flag, uint16_t m_NUM)
IC1_SEG059
=
IC_SEG_ON
;
IC1_SEG058
=
IC_SEG_ON
;
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_29_MPH
,
100
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_30_KM_H
,
100
);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_30_KM_H, 100);
}
else
{
...
...
@@ -1665,14 +1665,14 @@ _Fun_Res SEG_SET_VSpeed_NUM(uint8_t m_Flag, uint16_t m_NUM)
IC1_SEG059
=
IC_SEG_OFF
;
IC1_SEG058
=
IC_SEG_ON
;
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_29_MPH
,
100
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_30_KM_H
,
0
);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_30_KM_H, 0);
}
else
{
IC1_SEG059
=
IC_SEG_ON
;
IC1_SEG058
=
IC_SEG_OFF
;
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_29_MPH
,
0
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_30_KM_H
,
100
);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_30_KM_H, 100);
}
}
}
...
...
@@ -3132,16 +3132,16 @@ void Check_SEG_Display(void)
SEG_SET_LED_STS
(
1
,
1
);
SEG_SET_LED_STS
(
2
,
1
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_07_Key_ISTOP
,
LED_ON
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_02_Normal_Voltage
,
LED_ON
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_03_High_Low_Voltage
,
LED_ON
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_05_Fuel_Y
,
LED_ON
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_04_Fuel_W
,
LED_ON
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_06_Screen_Time
,
LED_ON
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_29_MPH
,
LED_ON
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_30_KM_H
,
LED_ON
);
RTE_GPIO_Set_Level
(
VSPEED_TEN_OUT
,
1
);
RTE_GPIO_Set_Level
(
VSPEED_HUNDREDS_OUT
,
1
);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_ON);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_02_Normal_Voltage, LED_ON);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_03_High_Low_Voltage, LED_ON);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_05_Fuel_Y, LED_ON);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_04_Fuel_W, LED_ON);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_06_Screen_Time, LED_ON);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_29_MPH, LED_ON);
//
LED_Driver_Channel_Set(LampChannel_0, LampCh0_30_KM_H, LED_ON);
//
RTE_GPIO_Set_Level(VSPEED_TEN_OUT, 1);
//
RTE_GPIO_Set_Level(VSPEED_HUNDREDS_OUT, 1);
SEG_Scan_SET_FuelDial
();
SEG_Scan_SET_EspeedDial
();
...
...
Firmware/Source/Component/Key/Key_user.c
View file @
abd6e7ae
...
...
@@ -76,14 +76,14 @@ void Key_Operation_Right(Key_Event_en_t enKeyEvent)//Set
Key_Status_en_t
Key_Status_Read_Left
(
void
)
{
Key_Status_en_t
enKeyReal
=
KEY_REALTIME_LOOSEN
;
if
(
RTE_GPIO_Get_Level
(
MODE_P_IN
))
{
enKeyReal
=
KEY_REALTIME_LOOSEN
;
}
else
{
enKeyReal
=
KEY_REALTIME_PRESS
;
}
//
if (RTE_GPIO_Get_Level(MODE_P_IN))
//
{
//
enKeyReal = KEY_REALTIME_LOOSEN;
//
}
//
else
//
{
//
enKeyReal = KEY_REALTIME_PRESS;
//
}
return
enKeyReal
;
}
Key_Status_en_t
Key_Status_Read_Right
(
void
)
...
...
Firmware/Source/Component/LED_Driver/LED_Driver_Interface.h
View file @
abd6e7ae
...
...
@@ -15,48 +15,47 @@ typedef enum
{
LampCh0_00
=
0
,
LampCh0_01
,
LampCh0_02
_Normal_Voltage
,
LampCh0_03
_High_Low_Voltage
,
LampCh0_04
_Fuel_W
,
LampCh0_05_
Fuel_Y
,
LampCh0_06_
Screen_Time
,
LampCh0_07_
Key_ISTOP
,
LampCh0_08
,
LampCh0_09
,
LampCh0_10
,
LampCh0_11
,
LampCh0_12
,
LampCh0_13
,
LampCh0_14
,
LampCh0_15
,
LampCh0_16
,
LampCh0_17
,
LampCh0_18
,
LampCh0_19
,
LampCh0_20
,
LampCh0_21
,
LampCh0_22
,
LampCh0_23
,
LampCh0_24
,
LampCh0_25
,
LampCh0_26
,
LampCh0_27
,
LampCh0_28
,
LampCh0_02
,
LampCh0_03
,
LampCh0_04
,
LampCh0_05_
Turn_Right
,
LampCh0_06_
Turn_Left
,
LampCh0_07_
Screen_Time
,
LampCh0_08
_KMH
,
LampCh0_09
_MPH
,
LampCh0_10
_Navigator
,
LampCh0_11
_Temp_AlarmR
,
LampCh0_12
_ABS_Alarm
,
LampCh0_13
_Temp_AlarmW
,
LampCh0_14
_Resting_Area
,
LampCh0_15
_Tollbooth
,
LampCh0_16
_Underpass1
,
LampCh0_17
_Length2
,
LampCh0_18
_Length1
,
LampCh0_19
_Underpass2
,
LampCh0_20
_Fuel_Y
,
LampCh0_21
_Fuel_W
,
LampCh0_22
_Oil_Pressure
,
LampCh0_23
_Bluetooth
,
LampCh0_24
_Keys
,
LampCh0_25
_TCS_Alarm
,
LampCh0_26
_Tire_PressureW
,
LampCh0_27
_Tire_PressureY
,
LampCh0_28
_Auto_Star_Stop
,
LampCh0_29_MPH
,
LampCh0_30_High_Beam
,
LampCh0_31_Lateral_Support
,
LampCh0_32_Fault_Diagnosis
,
LampCh0_33_Upkeep
,
LampCh0_34_TRIP
,
LampCh0_30_KM_H
,
LampCh0_31
,
LampCh0_32
,
LampCh0_33
,
LampCh0_34
,
LampCh0_35
,
LampCh0_35_ODO
,
LampCh0_MAX
,
...
...
Firmware/Source/Component/Line_In/Line_In_user.c
View file @
abd6e7ae
...
...
@@ -8,7 +8,10 @@ const Line_In_Attribute_st g_stLineInAttribute[LINE_IN_MAX] =
{
{
LEVEL_LOW
,
LEVEL_HIGH
,
LINE_IN_IG_ON
,
20U
,
20U
,
Get_LINE_IN_TurnLeft
,
},
{
LEVEL_LOW
,
LEVEL_HIGH
,
LINE_IN_IG_ON
,
20U
,
20U
,
Get_LINE_IN_TurnRight
,
},
{
LEVEL_HIGH
,
LEVEL_LOW
,
LINE_IN_IG_ON
,
60U
,
20U
,
Get_LINE_IN_HighBeam
,
},
{
LEVEL_LOW
,
LEVEL_HIGH
,
LINE_IN_IG_ON
,
60U
,
20U
,
Get_LINE_IN_HighBeam
,
},
{
LEVEL_HIGH
,
LEVEL_LOW
,
LINE_IN_IG_ON
,
100U
,
20U
,
Get_LINE_IN_FAULT_ELECTROSPRAY
,
},
{
LEVEL_HIGH
,
LEVEL_LOW
,
LINE_IN_IG_ON
,
100U
,
20U
,
Get_LINE_IN_Fault_ABS
,
},
{
LEVEL_HIGH
,
LEVEL_LOW
,
LINE_IN_IG_ON
,
100U
,
20U
,
Get_LINE_IN_Oil_Pressure
,
},
{
LEVEL_HIGH
,
LEVEL_LOW
,
LINE_IN_IG_ON
,
100U
,
20U
,
Get_LINE_IN_Auto_Start_Stop
,
},
};
...
...
@@ -55,10 +58,50 @@ Linelib_uint8_t Get_LINE_IN_HighBeam(void)
return
ret
;
}
Linelib_uint8_t
Get_LINE_IN_FAULT_ELECTROSPRAY
(
void
)
{
Linelib_uint8_t
ret
=
0
;
if
(
RTE_GPIO_Get_Level
(
Fault_Diagnosis_IN
))
{
ret
=
1
;
}
else
{
ret
=
0
;
}
}
Linelib_uint8_t
Get_LINE_IN_Fault_ABS
(
void
)
{
Linelib_uint8_t
ret
=
0
;
if
(
RTE_GPIO_Get_Level
(
Fault_ABS_IN
))
{
ret
=
1
;
}
else
{
ret
=
0
;
}
}
Linelib_uint8_t
Get_LINE_IN_Oil_Pressure
(
void
)
{
Linelib_uint8_t
ret
=
0
;
if
(
RTE_GPIO_Get_Level
(
Oil_Pressure_IN
))
{
ret
=
1
;
}
else
{
ret
=
0
;
}
}
Linelib_uint8_t
Get_LINE_IN_Auto_Start_Stop
(
void
)
{
Linelib_uint8_t
ret
=
0U
;
if
(
RTE_GPIO_Get_Level
(
START_STOP_P
_IN
))
if
(
RTE_GPIO_Get_Level
(
Auto_StartStop
_IN
))
{
ret
=
1u
;
}
...
...
Firmware/Source/Component/Line_In/Line_In_user.h
View file @
abd6e7ae
...
...
@@ -8,7 +8,11 @@ typedef enum
LINE_IN_TurnLeft
=
0
,
LINE_IN_TurnRight
,
LINE_IN_HighBeam
,
LINE_IN_FAULT_ELECTROSPRAY
,
LINE_IN_Fault_ABS
,
LINE_IN_Oil_Pressure
,
LINE_IN_Auto_Start_Stop
,
LINE_IN_MAX
,
}
LINE_IN_Enum_t
;
...
...
@@ -17,7 +21,9 @@ extern void LINE_IN_Init(void);
Linelib_uint8_t
Get_LINE_IN_TurnLeft
(
void
);
Linelib_uint8_t
Get_LINE_IN_TurnRight
(
void
);
Linelib_uint8_t
Get_LINE_IN_HighBeam
(
void
);
Linelib_uint8_t
Get_LINE_IN_FAULT_ELECTROSPRAY
(
void
);
Linelib_uint8_t
Get_LINE_IN_Fault_ABS
(
void
);
Linelib_uint8_t
Get_LINE_IN_Oil_Pressure
(
void
);
Linelib_uint8_t
Get_LINE_IN_Auto_Start_Stop
(
void
);
#endif
Firmware/Source/Component/PowerManagement/PowerManag_user.c
View file @
abd6e7ae
...
...
@@ -69,7 +69,7 @@ static void Power_KL30_Init(void)
TimerM_PWM_CH_Output_init
(
TIMERM_COUNTER0
,
TIMERM_CHC
,
ActiveLevel_High
);
TimerM_PWM_CH_Output_init
(
TIMERM_COUNTER0
,
TIMERM_CHD
,
ActiveLevel_High
);
TimerM_PWM_CH_Output_init
(
TIMERM_COUNTER1
,
TIMERM_CHB
,
ActiveLevel_High
);
Telltales_Auto_Start_Stop
();
Telltales_Init
();
MenuData_Unit_Init
();
g_stRTCInformation
.
u8RTCSecond
=
0
;
...
...
@@ -139,7 +139,7 @@ static void Power_IG_ON_Init(void)
Line_In_KL15_ON_Init
();
Telltales_KL15_Init
();
Fuel_KL15_Init
();
Telltales_Auto_Start_Stop
();
}
static
void
Power_Sleep_Init
(
void
)
...
...
Firmware/Source/Component/Telltales/Telltales_user.c
View file @
abd6e7ae
...
...
@@ -6,31 +6,61 @@
#include "Application.h"
#include "CAN_APP\CAN_CH0_CAN_Communication_Matrix.h"
#include "Components.h"
#include "LED_Driver_Interface.h"
static
Tellib_uint16_t
LED_High_Beam_Judgement
(
void
);
static
void
LED_High_Beam_Execution
(
Tellib_uint16_t
led_status
);
static
Tellib_uint16_t
LED_Efi_Fault_Judgement
(
void
);
static
void
LED_Efi_Fault_Execution
(
Tellib_uint16_t
led_status
);
static
Tellib_uint16_t
LED_Auto_Start_Stop_Judgement
(
void
);
static
void
LED_Auto_Start_Stop_Execution
(
Tellib_uint16_t
led_status
);
static
Tellib_uint16_t
LED_Voltage_Judgement
(
void
);
static
void
LED_Voltage_Execution
(
Tellib_uint16_t
led_status
);
static
Tellib_uint16_t
LED_FAULT_ELECTROSPRAY_Judgement
(
void
);
static
void
LED_FAULT_ELECTROSPRAY_Execution
(
Tellib_uint16_t
led_status
);
static
Tellib_uint16_t
LED_ABS_Judgement
(
void
);
static
void
LED_ABS_Execution
(
Tellib_uint16_t
led_status
);
static
Tellib_uint16_t
LED_Oil_Pressure_Judgement
(
void
);
static
void
LED_Oil_Pressure_Execution
(
Tellib_uint16_t
led_status
);
static
Tellib_uint16_t
LED_Fuel_Judgement
(
void
);
static
void
LED_Fuel_Execution
(
Tellib_uint16_t
led_status
);
static
Tellib_uint16_t
LED_Coolant_Judgement
(
void
);
static
void
LED_Coolant_Execution
(
Tellib_uint16_t
led_status
);
static
Tellib_uint16_t
LED_Bluetooth_Judgement
(
void
);
static
void
LED_Bluetooth_Execution
(
Tellib_uint16_t
led_status
);
static
Tellib_uint16_t
LED_TCS_Judgement
(
void
);
static
void
LED_TCS_Execution
(
Tellib_uint16_t
led_status
);
static
Tellib_uint16_t
LED_Auto_Start_Judgement
(
void
);
static
void
LED_Auto_Start_Execution
(
Tellib_uint16_t
led_status
);
static
Tellib_uint16_t
LED_Keys_Judgement
(
void
);
static
void
LED_Keys_Execution
(
Tellib_uint16_t
led_status
);
static
Tellib_uint16_t
LED_Maintain_Judgement
(
void
);
static
void
LED_Maintain_Execution
(
Tellib_uint16_t
led_status
);
static
Tellib_uint16_t
LED_Low_Batt_Judgement
(
void
);
static
void
LED_Low_Batt_Execution
(
Tellib_uint16_t
led_status
);
static
Tellib_uint16_t
LED_Lateral_Strut_Judgement
(
void
);
static
void
LED_Lateral_Strut_Execution
(
Tellib_uint16_t
led_status
);
static
Tellib_uint16_t
LED_Tire_Pressure_Judgement
(
void
);
static
void
LED_Tire_Pressure_Execution
(
Tellib_uint16_t
led_status
);
static
Tellib_uint16_t
LED_Navigato_Judgement
(
void
);
static
void
LED_Navigato_Execution
(
Tellib_uint16_t
led_status
);
static
Tellib_uint16_t
LED_Atmosphere_Judgement
(
void
);
static
void
LED_Atmosphere_Execution
(
Tellib_uint16_t
led_status
);
uint8_t
u8CanId401Flag
=
0
;
Led_HighBeam_Count
HighBeam_Timer
;
const
LED_Attribute_st
LED_Attribute
[
LED_Max
]
=
{
/* 指示灯索引 是否自检 外部信号自检 工作电源状态 自检开始时间 自检持续时间 指示灯点亮条件 指示灯执行函数 */
{
em_LED_High_Beam
,
SelfCheck
,
NoExterNalCheck
,
LED_IGN_ON
,
0u
,
3000ul
,
LED_High_Beam_Judgement
,
LED_High_Beam_Execution
},
{
em_LED_Efi_Fault
,
SelfCheck
,
NoExterNalCheck
,
LED_IGN_ON
,
0u
,
3000ul
,
LED_Efi_Fault_Judgement
,
LED_Efi_Fault_Execution
},
{
em_LED_Auto_Start_Stop
,
SelfCheck
,
NoExterNalCheck
,
LED_IGN_ON
,
0u
,
3000ul
,
LED_Auto_Start_Stop_Judgement
,
LED_Auto_Start_Stop_Execution
},
{
em_LED_Voltage
,
SelfCheck
,
NoExterNalCheck
,
LED_IGN_ON
,
0u
,
3000ul
,
LED_Voltage_Judgement
,
LED_Voltage_Execution
},
{
em_LED_Fuel
,
SelfCheck
,
NoExterNalCheck
,
LED_IGN_ON
,
0u
,
3000ul
,
LED_Fuel_Judgement
,
LED_Fuel_Execution
},
{
em_LED_Atmosphere
,
SelfCheck
,
NoExterNalCheck
,
LED_IGN_ON
,
0u
,
3000ul
,
LED_Atmosphere_Judgement
,
LED_Atmosphere_Execution
},
{
em_LED_High_Beam
,
SelfCheck
,
NoExterNalCheck
,
LED_IGN_ON
,
0u
,
3000ul
,
LED_High_Beam_Judgement
,
LED_High_Beam_Execution
},
{
em_LED_FAULT_ELECTROSPRAY
,
SelfCheck
,
NoExterNalCheck
,
LED_IGN_ON
,
0u
,
3000ul
,
LED_FAULT_ELECTROSPRAY_Judgement
,
LED_FAULT_ELECTROSPRAY_Execution
},
{
em_LED_ABS
,
SelfCheck
,
NoExterNalCheck
,
LED_IGN_ON
,
0u
,
3000ul
,
LED_ABS_Judgement
,
LED_ABS_Execution
},
{
em_LED_Oil_Pressure
,
SelfCheck
,
NoExterNalCheck
,
LED_IGN_ON
,
0u
,
3000ul
,
LED_Oil_Pressure_Judgement
,
LED_Oil_Pressure_Execution
},
{
em_LED_Fuel
,
SelfCheck
,
NoExterNalCheck
,
LED_IGN_ON
,
0u
,
3000ul
,
LED_Fuel_Judgement
,
LED_Fuel_Execution
},
{
em_LED_Coolant
,
SelfCheck
,
NoExterNalCheck
,
LED_IGN_ON
,
0u
,
3000ul
,
LED_Coolant_Judgement
,
LED_Coolant_Execution
},
{
em_LED_Bluetooth
,
SelfCheck
,
NoExterNalCheck
,
LED_IGN_ON
,
0u
,
3000ul
,
LED_Bluetooth_Judgement
,
LED_Bluetooth_Execution
},
{
em_LED_TCS
,
SelfCheck
,
NoExterNalCheck
,
LED_IGN_ON
,
0u
,
3000ul
,
LED_TCS_Judgement
,
LED_TCS_Execution
},
{
em_LED_Auto_Start_Stop
,
SelfCheck
,
NoExterNalCheck
,
LED_IGN_ON
,
0u
,
3000ul
,
LED_Auto_Start_Judgement
,
LED_Auto_Start_Execution
},
{
em_LED_Keys
,
SelfCheck
,
NoExterNalCheck
,
LED_IGN_ON
,
0u
,
3000ul
,
LED_Keys_Judgement
,
LED_Keys_Execution
},
{
em_LED_Maintain
,
SelfCheck
,
NoExterNalCheck
,
LED_IGN_ON
,
0u
,
3000ul
,
LED_Maintain_Judgement
,
LED_Maintain_Execution
},
{
em_LED_Low_Batt_Vol
,
SelfCheck
,
NoExterNalCheck
,
LED_IGN_ON
,
0u
,
3000ul
,
LED_Low_Batt_Judgement
,
LED_Low_Batt_Execution
},
{
em_LED_Lateral_Strut
,
SelfCheck
,
NoExterNalCheck
,
LED_IGN_ON
,
0u
,
3000ul
,
LED_Lateral_Strut_Judgement
,
LED_Lateral_Strut_Execution
},
{
em_LED_Tire_Pressure_Alarm
,
SelfCheck
,
NoExterNalCheck
,
LED_IGN_ON
,
0u
,
3000ul
,
LED_Tire_Pressure_Judgement
,
LED_Tire_Pressure_Execution
},
{
em_LED_Navigator
,
SelfCheck
,
NoExterNalCheck
,
LED_IGN_ON
,
0u
,
3000ul
,
LED_Navigato_Judgement
,
LED_Navigato_Execution
},
};
...
...
@@ -43,27 +73,41 @@ void Telltales_Init(void)
m_ExtPara
.
LED_PowerOFF_TimerCbk
=
Common_GetIgnOffTime
;
m_ExtPara
.
LED_PowerON_TimerCbk
=
Common_GetIgnOnTime
;
m_ExtPara
.
LED_PowerCbk
=
Common_Get_IG_Sts
;
u8CanId401Flag
=
0
;
Telltales_KL30_Wakeup_Init
(
Tel_Mem
,
LED_Attribute
,
&
m_ExtPara
);
HighBeam_Timer
.
LED_Turnon
=
0
;
HighBeam_Timer
.
LED_Turnoff
=
0
;
}
void
Can_ID_401
(
uint8_t
CopyData
[])
{
u8CanId401Flag
=
1
;
}
static
Tellib_uint16_t
LED_High_Beam_Judgement
(
void
)
{
Tellib_uint16_t
LED_STATE
=
0u
;
if
(
Line_In_Get_Status
(
LINE_IN_HighBeam
))
{
LED_STATE
=
1
;
if
(
HighBeam_Timer
.
LED_Turnon
<
5
)
{
HighBeam_Timer
.
LED_Turnon
++
;
}
else
{
HighBeam_Timer
.
LED_Turnon
=
5
;
HighBeam_Timer
.
LED_Turnoff
=
0
;
}
}
else
{
LED_STATE
=
0
;
if
(
HighBeam_Timer
.
LED_Turnoff
<
5
)
{
HighBeam_Timer
.
LED_Turnoff
++
;
}
else
{
HighBeam_Timer
.
LED_Turnoff
=
5
;
HighBeam_Timer
.
LED_Turnon
=
0
;
}
}
return
LED_STATE
;
}
...
...
@@ -71,154 +115,111 @@ static void LED_High_Beam_Execution(Tellib_uint16_t led_status)
{
if
(
led_status
==
1u
)
{
RTE_GPIO_Set_Level
(
HighBeam_MUC_OUT
,
LED_LINEOUT_High
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_30_High_Beam
,
LED_ON
);
}
else
{
RTE_GPIO_Set_Level
(
HighBeam_MUC_OUT
,
LED_LINEOUT_Low
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_30_High_Beam
,
LED_OFF
);
}
}
static
Tellib_uint16_t
LED_
Efi_Fault
_Judgement
(
void
)
static
Tellib_uint16_t
LED_
FAULT_ELECTROSPRAY
_Judgement
(
void
)
{
Tellib_uint16_t
LED_STATE
=
0u
;
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
CAN_CH0_ID_CAN_0x402_Msg_Count
)
==
CAN_SIG_LOST
)
if
(
Line_In_Get_Status
(
LINE_IN_FAULT_ELECTROSPRAY
)
)
{
LED_STATE
=
0u
;
LED_STATE
=
1
;
}
else
{
if
(
Get_CAN_CH0_ID_402_Sig_ECU_Warning_Lamp
()
==
1
)
LED_STATE
=
0
;
}
return
LED_STATE
;
}
static
void
LED_FAULT_ELECTROSPRAY_Execution
(
Tellib_uint16_t
led_status
)
{
if
(
led_status
==
1u
)
{
LED_STATE
=
1u
;
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_32_Fault_Diagnosis
,
LED_ON
)
;
}
else
{
LED_STATE
=
0u
;
}
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_32_Fault_Diagnosis
,
LED_OFF
);
}
return
LED_STATE
;
}
static
void
LED_Efi_Fault_Execution
(
Tellib_uint16_t
led_status
)
static
Tellib_uint16_t
LED_ABS_Judgement
(
void
)
{
if
(
led_status
==
1u
)
Tellib_uint16_t
LED_STATE
=
0u
;
if
(
Line_In_Get_Status
(
LINE_IN_Fault_ABS
))
{
RTE_GPIO_Set_Level
(
EFI_FAULT_OUT
,
LED_LINEOUT_High
)
;
LED_STATE
=
0
;
}
else
{
RTE_GPIO_Set_Level
(
EFI_FAULT_OUT
,
LED_LINEOUT_Low
);
if
((
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
CAN_CH0_ID_CAN_0x120_Msg_Count
)
==
CAN_SIG_LOST
)
||
(
Get_CAN_CH0_ID_120_Sig_ABS_Warning_lamp
()
==
1
)
||
(
Get_CAN_CH0_ID_120_Sig_ABS_Warning_lamp
()
==
3
))
{
LED_STATE
=
1
;
}
}
Tellib_uint8_t
Auto_Start_Stop
=
0u
;
Tellib_uint8_t
Key_ISTOP
=
0u
;
void
Telltales_Auto_Start_Stop
(
void
)
{
Auto_Start_Stop
=
0
;
}
void
Telltales_Auto_Start_Stop_Setting
(
void
)
{
if
(
Auto_Start_Stop
==
0
)
else
if
(
Get_CAN_CH0_ID_120_Sig_ABS_Warning_lamp
()
==
2
)
{
Auto_Start_Stop
=
1
;
LED_STATE
=
2
;
}
else
if
(
Auto_Start_Stop
==
1
)
else
if
(
Get_CAN_CH0_ID_120_Sig_ABS_Warning_lamp
()
==
0
)
{
Auto_Start_Stop
=
0
;
LED_STATE
=
0
;
}
else
{
;
}
}
return
LED_STATE
;
}
static
Tellib_uint16_t
LED_Auto_Start_Stop_Judgement
(
void
)
static
void
LED_ABS_Execution
(
Tellib_uint16_t
led_status
)
{
Tellib_uint16_t
LED_STATE
=
0u
;
if
(
Auto_Start_Stop
==
1
)
{
if
(
Line_In_Get_Status
(
LINE_IN_Auto_Start_Stop
))
if
(
led_status
==
1u
)
{
LED_STATE
=
1
;
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_12_ABS_Alarm
,
LED_ON
);
}
else
else
if
(
led_status
==
2u
)
{
LED_STATE
=
0
;
}
if
(
FLASH_SYNC_1Hz
)
{
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_12_ABS_Alarm
,
LED_ON
);
}
else
{
LED_STATE
=
0
;
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_12_ABS_Alarm
,
LED_OFF
);
}
return
LED_STATE
;
}
static
void
LED_Auto_Start_Stop_Execution
(
Tellib_uint16_t
led_status
)
{
if
(
led_status
==
1u
)
{
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_07_Key_ISTOP
,
LED_ON
);
SEG_SET_LED_STS
(
1
,
1
);
}
else
{
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_07_Key_ISTOP
,
LED_OFF
);
SEG_SET_LED_STS
(
1
,
0
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_12_ABS_Alarm
,
LED_OFF
);
}
}
Tellib_uint8_t
Telltales_Voltage_Date
(
void
)
{
Tellib_uint8_t
Voltage
=
0
;
Voltage
=
Get_CAN_CH0_ID_401_Sig_ECU_Battery_Voltage
();
return
Voltage
;
}
static
Tellib_uint16_t
LED_Voltage_Judgement
(
void
)
static
Tellib_uint16_t
LED_Oil_Pressure_Judgement
(
void
)
{
Tellib_uint16_t
LED_STATE
=
0u
;
Tellib_uint16_t
Voltage
=
0u
;
Voltage
=
Telltales_Voltage_Date
();
if
((
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
CAN_CH0_ID_CAN_0x401_Msg_Count
)
==
CAN_SIG_LOST
)
||
(
u8CanId401Flag
!=
1
))
{
u8CanId401Flag
=
0
;
LED_STATE
=
0u
;
}
else
if
(
Line_In_Get_Status
(
LINE_IN_Oil_Pressure
))
{
if
((
Voltage
<
120
)
||
(
Voltage
>
150
))
{
LED_STATE
=
1u
;
LED_STATE
=
1
;
}
else
{
LED_STATE
=
2u
;
}
LED_STATE
=
0
;
}
return
LED_STATE
;
}
static
void
LED_
Voltag
e_Execution
(
Tellib_uint16_t
led_status
)
static
void
LED_
Oil_Pressur
e_Execution
(
Tellib_uint16_t
led_status
)
{
if
(
led_status
==
1u
)
if
(
led_status
==
1u
)
{
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_03_High_Low_Voltage
,
LED_ON
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_02_Normal_Voltage
,
LED_OFF
);
SEG_SET_LED_STS
(
0
,
1
);
}
else
if
(
led_status
==
2u
)
{
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_02_Normal_Voltage
,
LED_ON
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_03_High_Low_Voltage
,
LED_OFF
);
SEG_SET_LED_STS
(
0
,
1
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_22_Oil_Pressure
,
LED_ON
);
}
else
{
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_03_High_Low_Voltage
,
LED_OFF
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_02_Normal_Voltage
,
LED_OFF
);
SEG_SET_LED_STS
(
0
,
0
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_22_Oil_Pressure
,
LED_OFF
);
}
}
static
Tellib_uint16_t
LED_Fuel_Judgement
(
void
)
{
Tellib_uint16_t
LED_STATE
=
0u
;
...
...
@@ -232,7 +233,7 @@ static Tellib_uint16_t LED_Fuel_Judgement(void)
}
else
{
LED_STATE
=
2
;
//格小于等于1
LED_STATE
=
2
;
//格小于等于1
,黄灯闪
}
}
else
...
...
@@ -242,7 +243,7 @@ static Tellib_uint16_t LED_Fuel_Judgement(void)
}
else
{
LED_STATE
=
1
;
//自检只亮黄
LED_STATE
=
1
;
//黄灯
}
return
LED_STATE
;
}
...
...
@@ -250,89 +251,163 @@ static void LED_Fuel_Execution(Tellib_uint16_t led_status)
{
if
(
led_status
==
3u
)
{
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_
04
_Fuel_W
,
LED_ON
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_
05
_Fuel_Y
,
LED_OFF
);
SEG_SET_LED_STS
(
2
,
1
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_
21
_Fuel_W
,
LED_ON
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_
20
_Fuel_Y
,
LED_OFF
);
//
SEG_SET_LED_STS(2,1);
}
else
if
(
led_status
==
2u
)
{
if
(
FLASH_SYNC_1Hz
)
{
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_
05
_Fuel_Y
,
LED_ON
);
SEG_SET_LED_STS
(
2
,
1
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_
20
_Fuel_Y
,
LED_ON
);
//
SEG_SET_LED_STS(2,1);
}
else
{
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_
05
_Fuel_Y
,
LED_OFF
);
SEG_SET_LED_STS
(
2
,
0
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_
20
_Fuel_Y
,
LED_OFF
);
//
SEG_SET_LED_STS(2,0);
}
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_
04
_Fuel_W
,
LED_OFF
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_
21
_Fuel_W
,
LED_OFF
);
}
else
if
(
led_status
==
1u
)
{
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_
05
_Fuel_Y
,
LED_ON
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_
20
_Fuel_Y
,
LED_ON
);
SEG_SET_LED_STS
(
2
,
1
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_
04
_Fuel_W
,
LED_OFF
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_
21
_Fuel_W
,
LED_OFF
);
}
else
{
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_
04
_Fuel_W
,
LED_OFF
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_
05
_Fuel_Y
,
LED_OFF
);
SEG_SET_LED_STS
(
2
,
0
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_
21
_Fuel_W
,
LED_OFF
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_
20
_Fuel_Y
,
LED_OFF
);
//
SEG_SET_LED_STS(2,0);
}
}
static
Tellib_uint16_t
LED_Atmosphere_Judgement
(
void
)
static
Tellib_uint16_t
LED_Coolant_Judgement
(
void
)
{
Tellib_uint16_t
LED_STATE
=
0u
;
LED_STATE
=
1
;
return
LED_STATE
;
}
static
void
LED_
Atmosphere
_Execution
(
Tellib_uint16_t
led_status
)
static
void
LED_
Coolant
_Execution
(
Tellib_uint16_t
led_status
)
{
if
(
led_status
==
1
)
{
RTE_GPIO_Set_Level
(
AMBIENT_LIGHT_B
,
LED_LINEOUT_High
);
}
else
{
RTE_GPIO_Set_Level
(
AMBIENT_LIGHT_B
,
LED_LINEOUT_Low
);
}
;
}
static
Tellib_uint16_t
LED_Bluetooth_Judgement
(
void
)
{
Tellib_uint16_t
LED_STATE
=
0u
;
return
LED_STATE
;
}
static
void
LED_Bluetooth_Execution
(
Tellib_uint16_t
led_status
)
{
;
}
static
Tellib_uint16_t
LED_TCS_Judgement
(
void
)
{
Tellib_uint16_t
LED_STATE
=
0u
;
return
LED_STATE
;
}
static
void
LED_TCS_Execution
(
Tellib_uint16_t
led_status
)
{
;
}
static
Tellib_uint16_t
LED_Auto_Start_Judgement
(
void
)
{
Tellib_uint16_t
LED_STATE
=
0u
;
return
LED_STATE
;
}
static
void
LED_Auto_Start_Execution
(
Tellib_uint16_t
led_status
)
{
;
}
static
Tellib_uint16_t
LED_Keys_Judgement
(
void
)
{
Tellib_uint16_t
LED_STATE
=
0u
;
return
LED_STATE
;
}
static
void
LED_Keys_Execution
(
Tellib_uint16_t
led_status
)
{
;
}
static
Tellib_uint16_t
LED_Maintain_Judgement
(
void
)
{
Tellib_uint16_t
LED_STATE
=
0u
;
return
LED_STATE
;
}
static
void
LED_Maintain_Execution
(
Tellib_uint16_t
led_status
)
{
;
}
static
Tellib_uint16_t
LED_Low_Batt_Judgement
(
void
)
{
Tellib_uint16_t
LED_STATE
=
0u
;
return
LED_STATE
;
}
static
void
LED_Low_Batt_Execution
(
Tellib_uint16_t
led_status
)
{
;
}
static
Tellib_uint16_t
LED_Lateral_Strut_Judgement
(
void
)
{
Tellib_uint16_t
LED_STATE
=
0u
;
return
LED_STATE
;
}
static
void
LED_Lateral_Strut_Execution
(
Tellib_uint16_t
led_status
)
{
;
}
static
Tellib_uint16_t
LED_Tire_Pressure_Judgement
(
void
)
{
Tellib_uint16_t
LED_STATE
=
0u
;
return
LED_STATE
;
}
static
void
LED_Tire_Pressure_Execution
(
Tellib_uint16_t
led_status
)
{
;
}
static
Tellib_uint16_t
LED_Navigato_Judgement
(
void
)
{
Tellib_uint16_t
LED_STATE
=
0u
;
return
LED_STATE
;
}
static
void
LED_Navigato_Execution
(
Tellib_uint16_t
led_status
)
{
;
}
void
Turn_Left_Right_Lamp
(
void
)
{
if
(
SYS_OPR_STAT_IGN_ON
)
{
if
(
Common_GetIgnOnTime
()
>=
3000
)
{
if
(
Line_In_Get_Status
(
LINE_IN_TurnLeft
))
{
RTE_GPIO_Set_Level
(
LeftTurn_MUC_OUT
,
LED_LINEOUT_High
);
}
else
{
RTE_GPIO_Set_Level
(
LeftTurn_MUC_OUT
,
LED_LINEOUT_Low
);
}
if
(
Line_In_Get_Status
(
LINE_IN_TurnRight
))
{
RTE_GPIO_Set_Level
(
RightTurn_MUC_OUT
,
LED_LINEOUT_High
);
}
else
{
RTE_GPIO_Set_Level
(
RightTurn_MUC_OUT
,
LED_LINEOUT_Low
);
}
}
else
{
RTE_GPIO_Set_Level
(
RightTurn_MUC_OUT
,
LED_LINEOUT_High
);
RTE_GPIO_Set_Level
(
LeftTurn_MUC_OUT
,
LED_LINEOUT_High
);
}
}
else
{
RTE_GPIO_Set_Level
(
RightTurn_MUC_OUT
,
LED_LINEOUT_Low
);
RTE_GPIO_Set_Level
(
LeftTurn_MUC_OUT
,
LED_LINEOUT_Low
);
}
//
if ( SYS_OPR_STAT_IGN_ON )
//
{
//
if (Common_GetIgnOnTime() >= 3000)
//
{
//
if (Line_In_Get_Status(LINE_IN_TurnLeft))
//
{
//
RTE_GPIO_Set_Level(LeftTurn_MUC_OUT, LED_LINEOUT_High);
//
}
//
else
//
{
//
RTE_GPIO_Set_Level(LeftTurn_MUC_OUT, LED_LINEOUT_Low);
//
}
//
if (Line_In_Get_Status(LINE_IN_TurnRight))
//
{
//
RTE_GPIO_Set_Level(RightTurn_MUC_OUT, LED_LINEOUT_High);
//
}
//
else
//
{
//
RTE_GPIO_Set_Level(RightTurn_MUC_OUT, LED_LINEOUT_Low);
//
}
//
}
//
else
//
{
//
RTE_GPIO_Set_Level(RightTurn_MUC_OUT, LED_LINEOUT_High);
//
RTE_GPIO_Set_Level(LeftTurn_MUC_OUT, LED_LINEOUT_High);
//
}
//
}
//
else
//
{
//
RTE_GPIO_Set_Level(RightTurn_MUC_OUT, LED_LINEOUT_Low);
//
RTE_GPIO_Set_Level(LeftTurn_MUC_OUT, LED_LINEOUT_Low);
//
}
}
Firmware/Source/Component/Telltales/Telltales_user.h
View file @
abd6e7ae
...
...
@@ -5,20 +5,33 @@
typedef
enum
{
em_LED_High_Beam
,
em_LED_
Efi_Fault
,
em_LED_A
uto_Start_Stop
,
em_LED_
Voltage
,
em_LED_
FAULT_ELECTROSPRAY
,
em_LED_A
BS
,
em_LED_
Oil_Pressure
,
em_LED_Fuel
,
em_LED_Atmosphere
,
em_LED_Coolant
,
em_LED_Bluetooth
,
em_LED_TCS
,
em_LED_Auto_Start_Stop
,
em_LED_Keys
,
em_LED_Maintain
,
em_LED_Low_Batt_Vol
,
em_LED_Lateral_Strut
,
em_LED_Tire_Pressure_Alarm
,
em_LED_Navigator
,
LED_Max
,
}
LED_Idx_t
;
extern
Tellib_uint8_t
Auto_Start_Stop
;
typedef
struct
{
Tellib_uint8_t
LED_Turnon
;
Tellib_uint8_t
LED_Turnoff
;
}
Led_HighBeam_Count
;
extern
Led_HighBeam_Count
HighBeam_Timer
;
void
Telltales_Init
(
void
);
void
Telltales_Auto_Start_Stop
(
void
);
void
Telltales_Auto_Start_Stop_Setting
(
void
);
Tellib_uint8_t
Telltales_Voltage_Date
(
void
);
#endif
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