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
82e0e965
Commit
82e0e965
authored
May 09, 2024
by
李俭双
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:增加胎压相关处理,包括数据,外发,指示灯等
parent
33bc1913
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
264 additions
and
36 deletions
+264
-36
TianYing200.BAT
Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/TianYing200.BAT
+3
-0
Can_App.c
Firmware/Source/Application/CAN_User/Can_App.c
+2
-0
Data_TPMS.c
Firmware/Source/Application/Data_TPMS/Data_TPMS.c
+186
-1
Data_TPMS.h
Firmware/Source/Application/Data_TPMS/Data_TPMS.h
+20
-0
Key_user.c
Firmware/Source/Component/Key/Key_user.c
+1
-1
Telltales_user.c
Firmware/Source/Component/Telltales/Telltales_user.c
+51
-33
Telltales_user.h
Firmware/Source/Component/Telltales/Telltales_user.h
+1
-1
No files found.
Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/TianYing200.BAT
View file @
82e0e965
SET PATH=C:\Keil_v5\ARM\ARMCC\Bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Users\tyw05\AppData\Local\Microsoft\WindowsApps;
SET ARMCC5_ASMOPT=--diag_suppress=9931
SET ARMCC5_CCOPT=--diag_suppress=9931
SET ARMCC5_LINKOPT=--diag_suppress=9931
SET CPU_TYPE=BAT32G139GK64FB
SET CPU_VENDOR=Cmsemicon
SET UV2_TARGET=TianYing200
...
...
Firmware/Source/Application/CAN_User/Can_App.c
View file @
82e0e965
...
...
@@ -89,5 +89,7 @@ void Can_Set_Buff_450(canlib_uint8_t CopyData[])
p450
->
Msg
[
i
]
=
0xFFu
;
}
}
p450
->
Sig
.
Front_Pressure_TX
=
Get_Front_TPMS_TX
();
p450
->
Sig
.
Rear_Pressure_TX
=
Get_Rear_TPMS_TX
();
}
Firmware/Source/Application/Data_TPMS/Data_TPMS.c
View file @
82e0e965
#include "Application.h"
#include "Data_TPMS\Data_TPMS.h"
\ No newline at end of file
#include "Data_TPMS\Data_TPMS.h"
_TPMS_Display
TPMS
;
void
Data_TPMS_KL30_Init
(
void
)
{
TPMS
.
Front_Press_Value
=
0
;
TPMS
.
Rear_Press_Value
=
0
;
TPMS
.
Front_TPMS_Valid
=
0
;
TPMS
.
Rear_TPMS_Valid
=
0
;
TPMS
.
TPMS_Warning
=
0
;
TPMS
.
TPMS_Unit
=
Get_Dis_Tpms_Unit
();
}
void
Data_TPMS_Processing_Service
(
void
)
{
uint16_t
Front_TPMS
=
0
;
uint16_t
Rear_TPMS
=
0
;
TPMS
.
TPMS_Unit
=
Get_Dis_Tpms_Unit
();
Front_TPMS
=
Get_CAN_CH0_ID_341_Sig_Front_Pressure
();
Rear_TPMS
=
Get_CAN_CH0_ID_341_Sig_Rear_Pressure
();
if
(
Common_Get_IG_Sts
()
==
COMMON_POWER_ON
)
{
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
CAN_CH0_ID_CAN_0x341_Msg_Count
)
==
CAN_SIG_LOST
)
{
TPMS
.
Front_TPMS_Valid
=
0
;
//信号掉线,显示--
TPMS
.
Rear_TPMS_Valid
=
0
;
//信号掉线,显示--
TPMS
.
Front_Press_Value
=
0
;
TPMS
.
Rear_Press_Value
=
0
;
TPMS
.
TPMS_Warning
=
0
;
//白灯
}
else
{
if
((
Front_TPMS
==
0xFF
)
||
(
Rear_TPMS
==
0xFF
))
{
if
((
Front_TPMS
==
0xFF
)
&&
(
Rear_TPMS
!=
0xFF
))
{
TPMS
.
Front_TPMS_Valid
=
0
;
TPMS
.
Rear_TPMS_Valid
=
1
;
TPMS
.
Front_Press_Value
=
99
;
TPMS
.
Rear_Press_Value
*=
Rear_TPMS
;
TPMS
.
Rear_Press_Value
/=
10
;
if
(
TPMS
.
Rear_Press_Value
>
99
)
{
TPMS
.
Rear_Press_Value
=
99
;
}
if
((
TPMS
.
Rear_Press_Value
<
17
)
||
(
TPMS
.
Rear_Press_Value
>
25
))
{
TPMS
.
TPMS_Warning
=
1
;
}
else
{
TPMS
.
TPMS_Warning
=
0
;
}
}
else
if
((
Front_TPMS
!=
0xFF
)
||
(
Rear_TPMS
==
0xFF
))
{
TPMS
.
Front_TPMS_Valid
=
1
;
TPMS
.
Rear_TPMS_Valid
=
0
;
TPMS
.
Rear_Press_Value
=
99
;
TPMS
.
Front_Press_Value
*=
Front_TPMS
;
TPMS
.
Front_Press_Value
/=
10
;
if
(
TPMS
.
Front_Press_Value
>
99
)
{
TPMS
.
Front_Press_Value
=
99
;
}
if
((
TPMS
.
Front_Press_Value
<
17
)
||
(
TPMS
.
Front_Press_Value
>
23
))
{
TPMS
.
TPMS_Warning
=
1
;
}
else
{
TPMS
.
TPMS_Warning
=
0
;
}
}
else
{
TPMS
.
Front_Press_Value
=
99
;
TPMS
.
Rear_Press_Value
=
99
;
TPMS
.
TPMS_Warning
=
0
;
TPMS
.
Front_TPMS_Valid
=
0
;
TPMS
.
Rear_TPMS_Valid
=
0
;
}
}
else
{
TPMS
.
Front_TPMS_Valid
=
1
;
TPMS
.
Rear_TPMS_Valid
=
1
;
TPMS
.
Front_Press_Value
*=
Front_TPMS
;
TPMS
.
Front_Press_Value
/=
10
;
if
(
TPMS
.
Front_Press_Value
>
99
)
{
TPMS
.
Front_Press_Value
=
99
;
}
TPMS
.
Rear_Press_Value
*=
Rear_TPMS
;
TPMS
.
Rear_Press_Value
/=
10
;
if
(
TPMS
.
Rear_Press_Value
>
99
)
{
TPMS
.
Rear_Press_Value
=
99
;
}
if
((
TPMS
.
Front_Press_Value
<
17
)
||
(
TPMS
.
Front_Press_Value
>
23
)
||
(
TPMS
.
Rear_Press_Value
<
17
)
||
(
TPMS
.
Rear_Press_Value
>
25
))
{
TPMS
.
TPMS_Warning
=
1
;
}
else
{
TPMS
.
TPMS_Warning
=
0
;
}
}
}
}
else
{
TPMS
.
Front_TPMS_Valid
=
0
;
TPMS
.
Rear_TPMS_Valid
=
0
;
TPMS
.
Front_Press_Value
=
0
;
TPMS
.
Rear_Press_Value
=
0
;
TPMS
.
TPMS_Warning
=
0
;
}
}
uint16_t
Data_Bar_To_Psi
(
uint16_t
bar
)
{
bar
*=
145
;
bar
/=
10
;
if
((
bar
%
5
)
>=
5
)
{
bar
+=
5
;
}
return
bar
;
}
uint8_t
Get_Led_TPMS_Waring
(
void
)
{
return
TPMS
.
TPMS_Warning
;
}
uint8_t
Get_Front_TPMS_Sig_Vaild
(
void
)
{
return
TPMS
.
Front_TPMS_Valid
;
}
uint8_t
Get_Rear_TPMS_Sig_Vaild
(
void
)
{
return
TPMS
.
Rear_TPMS_Valid
;
}
uint16_t
Get_Front_TPMS_Sig_Value
(
void
)
{
uint16_t
value
=
0
;
if
(
TPMS
.
TPMS_Unit
==
1
)
{
value
=
Data_Bar_To_Psi
(
TPMS
.
Front_Press_Value
);
if
(
value
>
99
)
{
value
=
99
;
}
}
else
{
value
=
TPMS
.
Front_Press_Value
;
}
return
value
;
}
uint16_t
Get_Rear_TPMS_Sig_Value
(
void
)
{
uint16_t
value
=
0
;
if
(
TPMS
.
TPMS_Unit
==
1
)
{
if
(
value
>
99
)
{
value
=
99
;
}
value
=
Data_Bar_To_Psi
(
TPMS
.
Rear_Press_Value
);
}
else
{
value
=
TPMS
.
Rear_Press_Value
;
}
return
value
;
}
uint16_t
Get_Rear_TPMS_TX
(
void
)
{
return
TPMS
.
Rear_Press_Value
;
}
uint16_t
Get_Front_TPMS_TX
(
void
)
{
return
TPMS
.
Front_Press_Value
;
}
\ No newline at end of file
Firmware/Source/Application/Data_TPMS/Data_TPMS.h
View file @
82e0e965
...
...
@@ -2,4 +2,24 @@
#define _DATA_TPMS_H_
#include "common.h"
typedef
struct
{
uint16_t
Front_Press_Value
;
uint16_t
Rear_Press_Value
;
uint8_t
Front_TPMS_Valid
;
uint8_t
Rear_TPMS_Valid
;
uint8_t
TPMS_Warning
;
uint8_t
TPMS_Unit
;
}
_TPMS_Display
;
void
Data_TPMS_KL30_Init
(
void
);
void
Data_TPMS_Processing_Service
(
void
);
uint16_t
Data_Bar_To_Psi
(
uint16_t
bar
);
uint8_t
Get_Led_TPMS_Waring
(
void
);
uint8_t
Get_Front_TPMS_Sig_Vaild
(
void
);
uint8_t
Get_Rear_TPMS_Sig_Vaild
(
void
);
uint16_t
Get_Front_TPMS_Sig_Value
(
void
);
uint16_t
Get_Rear_TPMS_Sig_Value
(
void
);
uint16_t
Get_Rear_TPMS_TX
(
void
);
uint16_t
Get_Front_TPMS_TX
(
void
);
#endif
Firmware/Source/Component/Key/Key_user.c
View file @
82e0e965
...
...
@@ -407,7 +407,7 @@ uint8_t Get_Dis_KM_Unit(void)
uint8_t
Get_Dis_Tpms_Unit
(
void
)
{
return
MenuData
.
Tpms_Unit
;
//0
km,1mile
return
MenuData
.
Tpms_Unit
;
//0
bar,1psi
}
uint8_t
Get_Dis_Tcs_Val
(
void
)
...
...
Firmware/Source/Component/Telltales/Telltales_user.c
View file @
82e0e965
...
...
@@ -484,11 +484,29 @@ 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
;
if
(
Get_Led_TPMS_Waring
()
==
1
)
{
LED_STATE
=
1
;
}
else
{
LED_STATE
=
0
;
}
return
LED_STATE
;
}
static
void
LED_Tire_Pressure_Execution
(
Tellib_uint16_t
led_status
)
{
;
if
(
led_status
==
1u
)
{
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_27_Tire_PressureY
,
LED_ON
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_26_Tire_PressureW
,
LED_OFF
);
}
else
{
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_26_Tire_PressureW
,
LED_ON
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_27_Tire_PressureY
,
LED_OFF
);
}
}
static
Tellib_uint16_t
LED_Navigato_Judgement
(
void
)
{
...
...
@@ -504,36 +522,36 @@ 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
))
{
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_06_Turn_Left
,
LED_ON
);
}
else
{
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_06_Turn_Left
,
LED_OFF
);
}
if
(
Line_In_Get_Status
(
LINE_IN_TurnRight
))
{
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_05_Turn_Right
,
LED_ON
);
}
else
{
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_05_Turn_Right
,
LED_OFF
);
}
}
else
{
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_06_Turn_Left
,
LED_ON
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_05_Turn_Right
,
LED_ON
);
}
}
else
{
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_06_Turn_Left
,
LED_OFF
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_05_Turn_Right
,
LED_OFF
);
}
}
Firmware/Source/Component/Telltales/Telltales_user.h
View file @
82e0e965
...
...
@@ -33,6 +33,6 @@ extern Led_HighBeam_Count HighBeam_Timer;
void
Telltales_Init
(
void
);
void
Telltales_UserInit
(
void
);
void
Turn_Left_Right_Lamp
(
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