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
4dfebd4a
Commit
4dfebd4a
authored
Aug 14, 2024
by
高士达
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'CHENJIALE' into 'dev'
Chenjiale See merge request
!62
parents
dbc36701
54e556c4
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
265 additions
and
175 deletions
+265
-175
system_BAT32G139.c
...239/MDK_ARM/RTE/Device/BAT32G139GK64FB/system_BAT32G139.c
+1
-1
TianYing.uvprojx
...ware/Project/Cmsemicon/BAT32A239/MDK_ARM/TianYing.uvprojx
+4
-4
CAN_CH0_CAN_Communication_Matrix.c
...ce/Application/CAN_APP/CAN_CH0_CAN_Communication_Matrix.c
+4
-4
Can_App.c
Firmware/Source/Application/CAN_User/Can_App.c
+30
-6
Can_App.h
Firmware/Source/Application/CAN_User/Can_App.h
+45
-38
Can_User.c
Firmware/Source/Application/CAN_User/Can_User.c
+79
-60
Can_User.h
Firmware/Source/Application/CAN_User/Can_User.h
+1
-1
Data_Coolant.c
Firmware/Source/Application/Data_Coolant/Data_Coolant.c
+1
-1
Data_TPMS.c
Firmware/Source/Application/Data_TPMS/Data_TPMS.c
+85
-56
Data_TPMS.h
Firmware/Source/Application/Data_TPMS/Data_TPMS.h
+2
-0
GUI_Display.c
Firmware/Source/Application/GUI_Display/GUI_Display.c
+8
-1
BU98R10.c
Firmware/Source/Component/BU98R10/BU98R10.c
+2
-0
Line_In_user.c
Firmware/Source/Component/Line_In/Line_In_user.c
+1
-1
cgc.c
...ource/Device/Cmsemicon/BAT32A239/Library/Driver/src/cgc.c
+2
-2
软件变更记录(天鹰项目139).xlsx
Firmware/utility/程序释放/软件变更记录(天鹰项目139).xlsx
+0
-0
天鹰代码评审文件240802.xlsx
Firmware/utility/评审记录/天鹰代码评审文件240802.xlsx
+0
-0
天鹰摩托功能规范V2.2_240725.docx
Firmware/utility/评审记录/天鹰摩托功能规范V2.2_240725.docx
+0
-0
No files found.
Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/RTE/Device/BAT32G139GK64FB/system_BAT32G139.c
View file @
4dfebd4a
...
@@ -136,7 +136,7 @@ const uint8_t user_opt_data[4] __attribute__((used)) __attribute__((section(".AR
...
@@ -136,7 +136,7 @@ const uint8_t user_opt_data[4] __attribute__((used)) __attribute__((section(".AR
// <0x72=> VLVDH = 4.06V/3.98V, VLVDL = 2.75V ( interrupt & reset mode )
// <0x72=> VLVDH = 4.06V/3.98V, VLVDL = 2.75V ( interrupt & reset mode )
// <i> Please setting the item for interrupt & reset mode
// <i> Please setting the item for interrupt & reset mode
// </h>
// </h>
0x
3F
,
0x
72
,
/**
/**
* @brief HOCO Control BYTE (FRQSEL)
* @brief HOCO Control BYTE (FRQSEL)
...
...
Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/TianYing.uvprojx
View file @
4dfebd4a
...
@@ -275,7 +275,7 @@
...
@@ -275,7 +275,7 @@
</OCR_RVCT3>
</OCR_RVCT3>
<OCR_RVCT4>
<OCR_RVCT4>
<Type>
1
</Type>
<Type>
1
</Type>
<StartAddress>
0x
800
0
</StartAddress>
<StartAddress>
0x0
</StartAddress>
<Size>
0x40000
</Size>
<Size>
0x40000
</Size>
</OCR_RVCT4>
</OCR_RVCT4>
<OCR_RVCT5>
<OCR_RVCT5>
...
@@ -361,8 +361,8 @@
...
@@ -361,8 +361,8 @@
</VariousControls>
</VariousControls>
</Aads>
</Aads>
<LDads>
<LDads>
<umfTarg>
1
</umfTarg>
<umfTarg>
0
</umfTarg>
<Ropi>
0
</Ropi>
<Ropi>
1
</Ropi>
<Rwpi>
0
</Rwpi>
<Rwpi>
0
</Rwpi>
<noStLib>
0
</noStLib>
<noStLib>
0
</noStLib>
<RepFail>
1
</RepFail>
<RepFail>
1
</RepFail>
...
@@ -370,7 +370,7 @@
...
@@ -370,7 +370,7 @@
<TextAddressRange>
0x00000000
</TextAddressRange>
<TextAddressRange>
0x00000000
</TextAddressRange>
<DataAddressRange>
0x20000000
</DataAddressRange>
<DataAddressRange>
0x20000000
</DataAddressRange>
<pXoBase></pXoBase>
<pXoBase></pXoBase>
<ScatterFile></ScatterFile>
<ScatterFile>
.\Objects\TianYing.sct
</ScatterFile>
<IncludeLibs></IncludeLibs>
<IncludeLibs></IncludeLibs>
<IncludeLibsPath></IncludeLibsPath>
<IncludeLibsPath></IncludeLibsPath>
<Misc></Misc>
<Misc></Misc>
...
...
Firmware/Source/Application/CAN_APP/CAN_CH0_CAN_Communication_Matrix.c
View file @
4dfebd4a
...
@@ -8,10 +8,10 @@ st_CanMsgTxOp CAN_CH0_CanMsgTxOp;
...
@@ -8,10 +8,10 @@ st_CanMsgTxOp CAN_CH0_CanMsgTxOp;
const
st_CAN_SendAttribute
CAN_CH0_CANSendAttr
[
CAN_CH0_ID_SEND_TOTAL
]
=
const
st_CAN_SendAttribute
CAN_CH0_CANSendAttr
[
CAN_CH0_ID_SEND_TOTAL
]
=
{
{
{
0x220ul
,
50ul
*
1000ul
,
7
ul
*
1000ul
,
0u
,
MSG_STD
,
1u
,
8u
,
CAN_MSG_TX_CYCLE
,
Can_Set_Buff_220
,
(
void
*
)
0
},
{
0x220ul
,
50ul
*
1000ul
,
49
ul
*
1000ul
,
0u
,
MSG_STD
,
1u
,
8u
,
CAN_MSG_TX_CYCLE
,
Can_Set_Buff_220
,
(
void
*
)
0
},
{
0x6EEul
,
100ul
*
1000ul
,
8ul
*
1000ul
,
0u
,
MSG_STD
,
2u
,
8u
,
CAN_MSG_TX_CYCLE
,
Can_Set_Buff_6EE
,
(
void
*
)
0
},
{
0x6EEul
,
100ul
*
1000ul
,
9
8ul
*
1000ul
,
0u
,
MSG_STD
,
2u
,
8u
,
CAN_MSG_TX_CYCLE
,
Can_Set_Buff_6EE
,
(
void
*
)
0
},
{
0x6EFul
,
100ul
*
1000ul
,
9ul
*
1000ul
,
0u
,
MSG_STD
,
3u
,
8u
,
CAN_MSG_TX_CYCLE
,
Can_Set_Buff_6EF
,
(
void
*
)
0
},
{
0x6EFul
,
100ul
*
1000ul
,
9
7
ul
*
1000ul
,
0u
,
MSG_STD
,
3u
,
8u
,
CAN_MSG_TX_CYCLE
,
Can_Set_Buff_6EF
,
(
void
*
)
0
},
{
0x450ul
,
100ul
*
1000ul
,
10
ul
*
1000ul
,
0u
,
MSG_STD
,
4u
,
8u
,
CAN_MSG_TX_CYCLE
,
Can_Set_Buff_450
,
(
void
*
)
0
},
{
0x450ul
,
100ul
*
1000ul
,
96
ul
*
1000ul
,
0u
,
MSG_STD
,
4u
,
8u
,
CAN_MSG_TX_CYCLE
,
Can_Set_Buff_450
,
(
void
*
)
0
},
#if (IC_Current == TY200_080000b_ty)
#if (IC_Current == TY200_080000b_ty)
{
0x580ul
,
8ul
*
1000ul
,
0ul
*
1000ul
,
0u
,
MSG_STD
,
1u
,
8u
,
CAN_MSG_TX_CYCLE
,
Can_Set_Buff_580
,
(
void
*
)
0
},
{
0x580ul
,
8ul
*
1000ul
,
0ul
*
1000ul
,
0u
,
MSG_STD
,
1u
,
8u
,
CAN_MSG_TX_CYCLE
,
Can_Set_Buff_580
,
(
void
*
)
0
},
#endif
#endif
...
...
Firmware/Source/Application/CAN_User/Can_App.c
View file @
4dfebd4a
...
@@ -102,6 +102,8 @@ void Can_Set_Buff_450(canlib_uint8_t CopyData[])
...
@@ -102,6 +102,8 @@ void Can_Set_Buff_450(canlib_uint8_t CopyData[])
{
{
CANMsg450Union
*
p450
;
CANMsg450Union
*
p450
;
uint8_t
i
=
0
;
uint8_t
i
=
0
;
uint16_t
u16FrontTpms
=
0
;
uint16_t
u16RearTpms
=
0
;
p450
=
(
CANMsg450Union
*
)
CopyData
;
p450
=
(
CANMsg450Union
*
)
CopyData
;
if
(
p450
!=
(
void
*
)
0
)
if
(
p450
!=
(
void
*
)
0
)
...
@@ -110,25 +112,47 @@ void Can_Set_Buff_450(canlib_uint8_t CopyData[])
...
@@ -110,25 +112,47 @@ void Can_Set_Buff_450(canlib_uint8_t CopyData[])
{
{
p450
->
Msg
[
i
]
=
0x0u
;
p450
->
Msg
[
i
]
=
0x0u
;
}
}
if
(
MenuData
.
TPMS_Front_Learn
!=
2
)
if
(
Get_Front_TPMS_Sig_Vaild
()
==
0
\
||
Get_TPMS_Front_Learn
()
!=
2
||
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
CAN_CH0_ID_CAN_0x373_Msg_Count
)
==
CAN_SIG_LOST
\
||
Get_Front_TPMS_ID_Vaild
()
==
0
)
{
{
p450
->
Sig
.
Front_Pressure_TX_H
=
0
;
p450
->
Sig
.
Front_Pressure_TX_H
=
0
;
p450
->
Sig
.
Front_Pressure_TX_L
=
0
;
p450
->
Sig
.
Front_Pressure_TX_L
=
0
;
}
}
else
else
{
{
p450
->
Sig
.
Front_Pressure_TX_H
=
((
Get_Front_TPMS_TX
()
+
146
)
>>
8
)
&
0xFF
;
if
((
Get_Front_TPMS_TX
()
+
146
)
<=
1000U
)
p450
->
Sig
.
Front_Pressure_TX_L
=
(
Get_Front_TPMS_TX
()
+
146
)
&
0xFF
;
{
u16FrontTpms
=
(
Get_Front_TPMS_TX
()
+
146
);
}
else
{
u16FrontTpms
=
1000U
;
}
p450
->
Sig
.
Front_Pressure_TX_H
=
(
u16FrontTpms
>>
8
)
&
0xFF
;
p450
->
Sig
.
Front_Pressure_TX_L
=
(
u16FrontTpms
)
&
0xFF
;
}
}
if
(
MenuData
.
TPMS_Rear_Learn
!=
2
)
if
(
Get_Rear_TPMS_Sig_Vaild
()
==
0
\
||
Get_TPMS_Rear_Learn
()
!=
2
||
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
CAN_CH0_ID_CAN_0x373_Msg_Count
)
==
CAN_SIG_LOST
\
||
Get_Rear_TPMS_ID_Vaild
()
==
0
)
{
{
p450
->
Sig
.
Rear_Pressure_TX_H
=
0
;
p450
->
Sig
.
Rear_Pressure_TX_H
=
0
;
p450
->
Sig
.
Rear_Pressure_TX_L
=
0
;
p450
->
Sig
.
Rear_Pressure_TX_L
=
0
;
}
}
else
else
{
{
p450
->
Sig
.
Rear_Pressure_TX_H
=
((
Get_Rear_TPMS_TX
()
+
146
)
>>
8
)
&
0xFF
;
if
((
Get_Rear_TPMS_TX
()
+
146
)
<=
1000U
)
p450
->
Sig
.
Rear_Pressure_TX_L
=
(
Get_Rear_TPMS_TX
()
+
146
)
&
0xFF
;
{
u16RearTpms
=
(
Get_Rear_TPMS_TX
()
+
146
);
}
else
{
u16RearTpms
=
1000U
;
}
p450
->
Sig
.
Rear_Pressure_TX_H
=
(
u16RearTpms
>>
8
)
&
0xFF
;
p450
->
Sig
.
Rear_Pressure_TX_L
=
(
u16RearTpms
)
&
0xFF
;
}
}
}
}
...
...
Firmware/Source/Application/CAN_User/Can_App.h
View file @
4dfebd4a
...
@@ -12,17 +12,19 @@ typedef union
...
@@ -12,17 +12,19 @@ typedef union
uint8_t
Msg
[
8
];
uint8_t
Msg
[
8
];
struct
struct
{
{
uint32_t
Res0
:
3
;
uint8_t
Res0
:
3
;
uint32_t
TCS_TX
:
1
;
uint8_t
TCS_TX
:
1
;
uint32_t
Res1
:
4
;
uint8_t
Res1
:
4
;
uint32_t
Res2
:
8
;
uint8_t
Res2
:
8
;
uint32_t
Res3
:
16
;
uint8_t
Res3
:
8
;
uint32_t
Res4
:
16
;
uint8_t
Res6
:
8
;
uint32_t
Res5
:
8
;
uint8_t
Res4
:
8
;
uint8_t
Res7
:
8
;
uint32_t
CheckSum
:
5
;
uint8_t
Res5
:
8
;
uint32_t
AliveCounter
:
3
;
uint8_t
CheckSum
:
5
;
uint8_t
AliveCounter
:
3
;
}
Sig
;
}
Sig
;
}
CANMsg220Union
;
}
CANMsg220Union
;
...
@@ -31,24 +33,24 @@ typedef union
...
@@ -31,24 +33,24 @@ typedef union
uint8_t
Msg
[
8
];
uint8_t
Msg
[
8
];
struct
struct
{
{
uint
32
_t
Coolant_Seg_TX
:
4
;
uint
8
_t
Coolant_Seg_TX
:
4
;
uint
32
_t
Fuel_Seg_TX
:
4
;
uint
8
_t
Fuel_Seg_TX
:
4
;
uint
32
_t
Res0
:
8
;
uint
8
_t
Res0
:
8
;
uint
32
_t
Fuel_Res_TX
:
8
;
uint
8
_t
Fuel_Res_TX
:
8
;
uint
32
_t
Vsppe_H3_TX
:
3
;
uint
8
_t
Vsppe_H3_TX
:
3
;
uint
32
_t
Res1
:
1
;
uint
8
_t
Res1
:
1
;
uint
32
_t
Coolant_Warn_TX
:
1
;
uint
8
_t
Coolant_Warn_TX
:
1
;
uint
32
_t
Res2
:
2
;
uint
8
_t
Res2
:
2
;
uint
32
_t
Uint_TX
:
1
;
uint
8
_t
Uint_TX
:
1
;
uint
32
_t
Vsppe_L8_TX
:
8
;
uint
8
_t
Vsppe_L8_TX
:
8
;
uint
32
_t
ODO_TX_H
:
8
;
uint
8
_t
ODO_TX_H
:
8
;
uint
32
_t
ODO_TX_M
:
8
;
uint
8
_t
ODO_TX_M
:
8
;
uint
32
_t
ODO_TX_L
:
8
;
uint
8
_t
ODO_TX_L
:
8
;
}
Sig
;
}
Sig
;
}
CANMsg6EEUnion
;
}
CANMsg6EEUnion
;
...
@@ -58,16 +60,17 @@ typedef union
...
@@ -58,16 +60,17 @@ typedef union
uint8_t
Msg
[
8
];
uint8_t
Msg
[
8
];
struct
struct
{
{
uint32_t
Espeed_TX
:
8
;
uint8_t
Espeed_TX
:
8
;
uint32_t
Coolant_TX
:
8
;
uint32_t
TripA_H
:
8
;
uint8_t
Coolant_TX
:
8
;
uint32_t
TripA_L
:
8
;
uint32_t
TripB
:
16
;
uint8_t
TripA_H
:
8
;
uint8_t
TripA_L
:
8
;
uint32_t
Res1
:
16
;
uint8_t
TripB
:
8
;
uint8_t
Res2
:
8
;
uint8_t
Res1
:
8
;
uint8_t
Res3
:
8
;
}
Sig
;
}
Sig
;
}
CANMsg6EFUnion
;
}
CANMsg6EFUnion
;
...
@@ -77,10 +80,10 @@ typedef union
...
@@ -77,10 +80,10 @@ typedef union
uint8_t
Msg
[
8
];
uint8_t
Msg
[
8
];
struct
struct
{
{
uint
16
_t
Front_Pressure_TX_H
:
8
;
uint
8
_t
Front_Pressure_TX_H
:
8
;
uint
16
_t
Front_Pressure_TX_L
:
8
;
uint
8
_t
Front_Pressure_TX_L
:
8
;
uint
16
_t
Rear_Pressure_TX_H
:
8
;
uint
8
_t
Rear_Pressure_TX_H
:
8
;
uint
16
_t
Rear_Pressure_TX_L
:
8
;
uint
8
_t
Rear_Pressure_TX_L
:
8
;
//uint32_t Front_Air_Leakage_TX : 1;
//uint32_t Front_Air_Leakage_TX : 1;
//uint32_t Rear_Air_Leakage_TX : 1;
//uint32_t Rear_Air_Leakage_TX : 1;
//uint32_t Front_Low_Voltage_TX : 1;
//uint32_t Front_Low_Voltage_TX : 1;
...
@@ -89,7 +92,10 @@ typedef union
...
@@ -89,7 +92,10 @@ typedef union
//uint32_t Rear_High_Temp_TX : 1;
//uint32_t Rear_High_Temp_TX : 1;
//uint32_t Res0 : 2;
//uint32_t Res0 : 2;
uint32_t
Res1
:
32
;
uint8_t
Res1
:
8
;
uint8_t
Res2
:
8
;
uint8_t
Res3
:
8
;
uint8_t
Res4
:
8
;
}
Sig
;
}
Sig
;
}
CANMsg450Union
;
}
CANMsg450Union
;
...
@@ -104,8 +110,9 @@ typedef union
...
@@ -104,8 +110,9 @@ typedef union
uint8_t
TPMS_LEARN_CND_BYTE2
:
8
;
uint8_t
TPMS_LEARN_CND_BYTE2
:
8
;
uint8_t
TPMS_LEARN_CND_BYTE3
:
8
;
uint8_t
TPMS_LEARN_CND_BYTE3
:
8
;
uint8_t
TPMS_LEARN_CND_BYTE4
:
8
;
uint8_t
TPMS_LEARN_CND_BYTE4
:
8
;
uint32_t
Res1
:
24
;
uint8_t
Res1
:
8
;
uint8_t
Res2
:
8
;
uint8_t
Res13
:
8
;
}
Sig
;
}
Sig
;
}
CANMsg580Union
;
}
CANMsg580Union
;
...
...
Firmware/Source/Application/CAN_User/Can_User.c
View file @
4dfebd4a
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
#include "RTE.h"
#include "RTE.h"
__align
(
4
)
__align
(
4
)
uint32_t
pRXBuff
[
CAN_RX_MSG_Block
*
CAN_CH0_ID_TOTAL_MAX
];
uint32_t
pRXBuff
[
CAN_RX_MSG_Block
*
CAN_CH0_ID_TOTAL_MAX
];
uint32_t
pTXBuff
[
CAN_TX_MSG_Block
*
CAN_CH0_ID_SEND_TOTAL
];
uint32_t
pTXBuff
[
CAN_TX_MSG_Block
*
CAN_CH0_ID_SEND_TOTAL
];
static
RSCAN0BusoffMonitorStruct
RSCAN0Busoff
;
static
RSCAN0BusoffMonitorStruct
RSCAN0Busoff
;
...
@@ -26,8 +26,7 @@ void Can_Init(void)
...
@@ -26,8 +26,7 @@ void Can_Init(void)
Can_Tx_Apply_Buff
();
Can_Tx_Apply_Buff
();
Can_RX_Apply_Buff
();
Can_RX_Apply_Buff
();
RTE_GPIO_Set_Level
(
RTE_GPIO_PORT05_PIN02
,
RTE_GPIO_LEVEL_LOW
);
RTE_GPIO_Set_Level
(
RTE_GPIO_PORT05_PIN02
,
RTE_GPIO_LEVEL_LOW
);
}
}
/**
/**
...
@@ -79,7 +78,7 @@ void Can_RX_Apply_Buff(void)
...
@@ -79,7 +78,7 @@ void Can_RX_Apply_Buff(void)
CAN_RecvMsg
.
Interrupt
=
ENABLE
;
CAN_RecvMsg
.
Interrupt
=
ENABLE
;
CAN_MessageCache_DeInit
(
CAN0MSG07
);
CAN_MessageCache_DeInit
(
CAN0MSG07
);
CAN_MessageCache_Init
(
CAN0MSG07
,
&
CAN_RecvMsg
);
CAN_MessageCache_Init
(
CAN0MSG07
,
&
CAN_RecvMsg
);
CAN_MessageCache_OverWriteConfig
(
CAN0MSG07
,
ENABLE
);
CAN_MessageCache_OverWriteConfig
(
CAN0MSG07
,
ENABLE
);
CAN_RecvMsg
.
Id
=
0x120
;
CAN_RecvMsg
.
Id
=
0x120
;
CAN_RecvMsg
.
IDE
=
CAN_Id_Standard
;
CAN_RecvMsg
.
IDE
=
CAN_Id_Standard
;
...
@@ -126,12 +125,12 @@ void Can_Tx_Apply_Buff(void)
...
@@ -126,12 +125,12 @@ void Can_Tx_Apply_Buff(void)
{
{
CanTxRxMsg
CAN_SendMsg
;
CanTxRxMsg
CAN_SendMsg
;
CanTxRxMsg
CAN_SendMsg_Diag_Tx
;
CanTxRxMsg
CAN_SendMsg_Diag_Tx
;
CAN_SendMsg
.
Id
=
0x6EE
;
CAN_SendMsg
.
Id
=
0x6EE
;
CAN_SendMsg
.
IDE
=
CAN_Id_Standard
;
CAN_SendMsg
.
IDE
=
CAN_Id_Standard
;
CAN_SendMsg
.
CacheType
=
CAN_CacheType_Tx
;
CAN_SendMsg
.
CacheType
=
CAN_CacheType_Tx
;
CAN_SendMsg
.
RTR
=
CAN_RTR_Data
;
CAN_SendMsg
.
RTR
=
CAN_RTR_Data
;
CAN_RecvMsg
.
Interrupt
=
DISABLE
;
CAN_RecvMsg
.
Interrupt
=
DISABLE
;
CAN_SendMsg
.
DLC
=
8
;
CAN_SendMsg
.
DLC
=
8
;
for
(
uint8_t
i
=
0
;
i
<
CAN_SendMsg
.
DLC
;
i
++
)
for
(
uint8_t
i
=
0
;
i
<
CAN_SendMsg
.
DLC
;
i
++
)
{
{
CAN_SendMsg
.
Data
[
i
]
=
0
;
CAN_SendMsg
.
Data
[
i
]
=
0
;
...
@@ -141,11 +140,11 @@ void Can_Tx_Apply_Buff(void)
...
@@ -141,11 +140,11 @@ void Can_Tx_Apply_Buff(void)
CAN_MessageCache_Init
(
CAN0MSG08
,
&
CAN_SendMsg
);
CAN_MessageCache_Init
(
CAN0MSG08
,
&
CAN_SendMsg
);
CAN_SendMsg
.
Id
=
0x6EF
;
CAN_SendMsg
.
Id
=
0x6EF
;
CAN_SendMsg
.
IDE
=
CAN_Id_Standard
;
CAN_SendMsg
.
IDE
=
CAN_Id_Standard
;
CAN_SendMsg
.
CacheType
=
CAN_CacheType_Tx
;
CAN_SendMsg
.
CacheType
=
CAN_CacheType_Tx
;
CAN_SendMsg
.
RTR
=
CAN_RTR_Data
;
CAN_SendMsg
.
RTR
=
CAN_RTR_Data
;
CAN_RecvMsg
.
Interrupt
=
DISABLE
;
CAN_RecvMsg
.
Interrupt
=
DISABLE
;
CAN_SendMsg
.
DLC
=
8
;
CAN_SendMsg
.
DLC
=
8
;
for
(
uint8_t
i
=
0
;
i
<
CAN_SendMsg
.
DLC
;
i
++
)
for
(
uint8_t
i
=
0
;
i
<
CAN_SendMsg
.
DLC
;
i
++
)
{
{
CAN_SendMsg
.
Data
[
i
]
=
0
;
CAN_SendMsg
.
Data
[
i
]
=
0
;
...
@@ -155,11 +154,11 @@ void Can_Tx_Apply_Buff(void)
...
@@ -155,11 +154,11 @@ void Can_Tx_Apply_Buff(void)
CAN_MessageCache_Init
(
CAN0MSG12
,
&
CAN_SendMsg
);
CAN_MessageCache_Init
(
CAN0MSG12
,
&
CAN_SendMsg
);
CAN_SendMsg
.
Id
=
0x450
;
CAN_SendMsg
.
Id
=
0x450
;
CAN_SendMsg
.
IDE
=
CAN_Id_Standard
;
CAN_SendMsg
.
IDE
=
CAN_Id_Standard
;
CAN_SendMsg
.
CacheType
=
CAN_CacheType_Tx
;
CAN_SendMsg
.
CacheType
=
CAN_CacheType_Tx
;
CAN_SendMsg
.
RTR
=
CAN_RTR_Data
;
CAN_SendMsg
.
RTR
=
CAN_RTR_Data
;
CAN_RecvMsg
.
Interrupt
=
DISABLE
;
CAN_RecvMsg
.
Interrupt
=
DISABLE
;
CAN_SendMsg
.
DLC
=
8
;
CAN_SendMsg
.
DLC
=
8
;
for
(
uint8_t
i
=
0
;
i
<
CAN_SendMsg
.
DLC
;
i
++
)
for
(
uint8_t
i
=
0
;
i
<
CAN_SendMsg
.
DLC
;
i
++
)
{
{
CAN_SendMsg
.
Data
[
i
]
=
0
;
CAN_SendMsg
.
Data
[
i
]
=
0
;
...
@@ -169,11 +168,11 @@ void Can_Tx_Apply_Buff(void)
...
@@ -169,11 +168,11 @@ void Can_Tx_Apply_Buff(void)
CAN_MessageCache_Init
(
CAN0MSG13
,
&
CAN_SendMsg
);
CAN_MessageCache_Init
(
CAN0MSG13
,
&
CAN_SendMsg
);
CAN_SendMsg
.
Id
=
0x220
;
CAN_SendMsg
.
Id
=
0x220
;
CAN_SendMsg
.
IDE
=
CAN_Id_Standard
;
CAN_SendMsg
.
IDE
=
CAN_Id_Standard
;
CAN_SendMsg
.
CacheType
=
CAN_CacheType_Tx
;
CAN_SendMsg
.
CacheType
=
CAN_CacheType_Tx
;
CAN_SendMsg
.
RTR
=
CAN_RTR_Data
;
CAN_SendMsg
.
RTR
=
CAN_RTR_Data
;
CAN_RecvMsg
.
Interrupt
=
DISABLE
;
CAN_RecvMsg
.
Interrupt
=
DISABLE
;
CAN_SendMsg
.
DLC
=
8
;
CAN_SendMsg
.
DLC
=
8
;
for
(
uint8_t
i
=
0
;
i
<
CAN_SendMsg
.
DLC
;
i
++
)
for
(
uint8_t
i
=
0
;
i
<
CAN_SendMsg
.
DLC
;
i
++
)
{
{
CAN_SendMsg
.
Data
[
i
]
=
0
;
CAN_SendMsg
.
Data
[
i
]
=
0
;
...
@@ -183,11 +182,11 @@ void Can_Tx_Apply_Buff(void)
...
@@ -183,11 +182,11 @@ void Can_Tx_Apply_Buff(void)
CAN_MessageCache_Init
(
CAN0MSG10
,
&
CAN_SendMsg
);
CAN_MessageCache_Init
(
CAN0MSG10
,
&
CAN_SendMsg
);
CAN_SendMsg
.
Id
=
0x580
;
CAN_SendMsg
.
Id
=
0x580
;
CAN_SendMsg
.
IDE
=
CAN_Id_Standard
;
CAN_SendMsg
.
IDE
=
CAN_Id_Standard
;
CAN_SendMsg
.
CacheType
=
CAN_CacheType_Tx
;
CAN_SendMsg
.
CacheType
=
CAN_CacheType_Tx
;
CAN_SendMsg
.
RTR
=
CAN_RTR_Data
;
CAN_SendMsg
.
RTR
=
CAN_RTR_Data
;
CAN_RecvMsg
.
Interrupt
=
DISABLE
;
CAN_RecvMsg
.
Interrupt
=
DISABLE
;
CAN_SendMsg
.
DLC
=
8
;
CAN_SendMsg
.
DLC
=
8
;
for
(
uint8_t
i
=
0
;
i
<
CAN_SendMsg
.
DLC
;
i
++
)
for
(
uint8_t
i
=
0
;
i
<
CAN_SendMsg
.
DLC
;
i
++
)
{
{
CAN_SendMsg
.
Data
[
i
]
=
0
;
CAN_SendMsg
.
Data
[
i
]
=
0
;
...
@@ -196,14 +195,12 @@ void Can_Tx_Apply_Buff(void)
...
@@ -196,14 +195,12 @@ void Can_Tx_Apply_Buff(void)
CAN_MessageCache_DeInit
(
CAN0MSG14
);
CAN_MessageCache_DeInit
(
CAN0MSG14
);
CAN_MessageCache_Init
(
CAN0MSG14
,
&
CAN_SendMsg
);
CAN_MessageCache_Init
(
CAN0MSG14
,
&
CAN_SendMsg
);
CAN_SendMsg_Diag_Tx
.
Id
=
DIAG_ID_Tx
;
CAN_SendMsg_Diag_Tx
.
IDE
=
CAN_Id_Standard
;
CAN_SendMsg_Diag_Tx
.
Id
=
DIAG_ID_Tx
;
CAN_SendMsg_Diag_Tx
.
CacheType
=
CAN_CacheType_Tx
;
CAN_SendMsg_Diag_Tx
.
IDE
=
CAN_Id_Standard
;
CAN_SendMsg_Diag_Tx
.
RTR
=
CAN_RTR_Data
;
CAN_SendMsg_Diag_Tx
.
CacheType
=
CAN_CacheType_Tx
;
CAN_SendMsg_Diag_Tx
.
Interrupt
=
DISABLE
;
CAN_SendMsg_Diag_Tx
.
RTR
=
CAN_RTR_Data
;
CAN_SendMsg_Diag_Tx
.
DLC
=
8
;
CAN_SendMsg_Diag_Tx
.
Interrupt
=
DISABLE
;
CAN_SendMsg_Diag_Tx
.
DLC
=
8
;
for
(
uint8_t
i
=
0
;
i
<
CAN_SendMsg_Diag_Tx
.
DLC
;
i
++
)
for
(
uint8_t
i
=
0
;
i
<
CAN_SendMsg_Diag_Tx
.
DLC
;
i
++
)
{
{
CAN_SendMsg_Diag_Tx
.
Data
[
i
]
=
0
;
CAN_SendMsg_Diag_Tx
.
Data
[
i
]
=
0
;
...
@@ -222,7 +219,7 @@ void Can_Rx_Cak(CanTxRxMsg *Msg)
...
@@ -222,7 +219,7 @@ void Can_Rx_Cak(CanTxRxMsg *Msg)
if
((
Msg
->
Id
==
DIAG_ID_Rx_FUN
)
||
(
Msg
->
Id
==
DIAG_ID_Rx_PHY
))
if
((
Msg
->
Id
==
DIAG_ID_Rx_FUN
)
||
(
Msg
->
Id
==
DIAG_ID_Rx_PHY
))
{
{
DoCAN_L_Data_Indication
(
Msg
->
Id
,
Msg
->
DLC
,
Msg
->
Data
);
DoCAN_L_Data_Indication
(
Msg
->
Id
,
Msg
->
DLC
,
Msg
->
Data
);
}
}
}
}
/**
/**
...
@@ -244,7 +241,14 @@ void COM_CAN_Init(void)
...
@@ -244,7 +241,14 @@ void COM_CAN_Init(void)
Can_TX_BuffInit
(
&
CAN_CH0_CanMsgTxOp
,
CAN_CH0_CANSendAttr
,
CAN_CH0_ID_SEND_TOTAL
,
COM_APP_Process
);
Can_TX_BuffInit
(
&
CAN_CH0_CanMsgTxOp
,
CAN_CH0_CANSendAttr
,
CAN_CH0_ID_SEND_TOTAL
,
COM_APP_Process
);
CAN_TX_SetEnable
(
&
CAN_CH0_CanMsgTxOp
,
CAN_N_TX_Disable
);
CAN_TX_SetEnable
(
&
CAN_CH0_CanMsgTxOp
,
CAN_N_TX_Disable
);
}
}
void
Can_QuickTimer_Init
(
void
)
{
uint32_t
i
=
0u
;
for
(
i
=
0u
;
i
<
CAN_CH0_ID_SEND_TOTAL
;
i
++
)
{
Can_Msg_TX_FastInitCycle
(
&
CAN_CH0_CanMsgTxOp
,
i
,
CAN_CH0_CANSendAttr
[
i
].
u32MsgCycleOffset
);
}
}
/**
/**
* @brief Buff恢复函数
* @brief Buff恢复函数
...
@@ -254,6 +258,7 @@ void Can_BusOff_Recover(uint8_t deltaTime)
...
@@ -254,6 +258,7 @@ void Can_BusOff_Recover(uint8_t deltaTime)
{
{
if
(
get_can_busoff
(
CAN_CH_0
)
==
2
)
if
(
get_can_busoff
(
CAN_CH_0
)
==
2
)
{
{
CAN_TX_Count_Init
();
if
(
RSCAN0Busoff
.
Status
==
RSCAN0_BUS_STABLE
)
if
(
RSCAN0Busoff
.
Status
==
RSCAN0_BUS_STABLE
)
{
{
RSCAN0Busoff
.
Status
=
RSCAN0_BUS_OFF_LV1
;
RSCAN0Busoff
.
Status
=
RSCAN0_BUS_OFF_LV1
;
...
@@ -262,18 +267,21 @@ void Can_BusOff_Recover(uint8_t deltaTime)
...
@@ -262,18 +267,21 @@ void Can_BusOff_Recover(uint8_t deltaTime)
if
(
RSCAN0Busoff
.
Status
==
RSCAN0_BUS_OFF_LV1
)
if
(
RSCAN0Busoff
.
Status
==
RSCAN0_BUS_OFF_LV1
)
{
{
RSCAN0Busoff
.
Timer
++
;
RSCAN0Busoff
.
Timer
++
;
if
(
RSCAN0Busoff
.
Timer
>=
RSCAN0_BUS_OFF_LV1_RECOVERY_TIME
/
deltaTime
)
if
(
RSCAN0Busoff
.
Timer
>=
RSCAN0_BUS_OFF_LV1_RECOVERY_TIME
/
deltaTime
)
/**/
{
{
RSCAN0Busoff
.
Timer
=
0U
;
RSCAN0Busoff
.
Timer
=
0U
;
RSCAN0Busoff
.
Cnt
++
;
RSCAN0Busoff
.
Cnt
++
;
if
(
RSCAN0Busoff
.
Cnt
>=
10U
)
if
(
RSCAN0Busoff
.
Cnt
>=
10U
)
/**/
{
{
RSCAN0Busoff
.
Cnt
=
0U
;
RSCAN0Busoff
.
Cnt
=
0U
;
RSCAN0Busoff
.
Status
=
RSCAN0_BUS_OFF_LV2
;
RSCAN0Busoff
.
Status
=
RSCAN0_BUS_OFF_LV2
;
}
}
//需调用CAN中止函数,中止所有硬件buf内要发送的数据
CAN_TX_Count_Init
();
Can_QuickTimer_Init
();
reset_busoff
(
CAN_CH_0
);
reset_busoff
(
CAN_CH_0
);
}
}
}
}
...
@@ -281,9 +289,12 @@ void Can_BusOff_Recover(uint8_t deltaTime)
...
@@ -281,9 +289,12 @@ void Can_BusOff_Recover(uint8_t deltaTime)
{
{
RSCAN0Busoff
.
Timer
++
;
RSCAN0Busoff
.
Timer
++
;
if
(
RSCAN0Busoff
.
Timer
>=
RSCAN0_BUS_OFF_LV2_RECOVERY_TIME
/
deltaTime
)
if
(
RSCAN0Busoff
.
Timer
>=
RSCAN0_BUS_OFF_LV2_RECOVERY_TIME
/
deltaTime
)
/**/
{
{
RSCAN0Busoff
.
Timer
=
0U
;
RSCAN0Busoff
.
Timer
=
0U
;
//需调用CAN中止函数,中止所有硬件buf内要发送的数据
CAN_TX_Count_Init
();
Can_QuickTimer_Init
();
reset_busoff
(
CAN_CH_0
);
reset_busoff
(
CAN_CH_0
);
}
}
}
}
...
@@ -293,7 +304,15 @@ void Can_BusOff_Recover(uint8_t deltaTime)
...
@@ -293,7 +304,15 @@ void Can_BusOff_Recover(uint8_t deltaTime)
}
}
else
/* 总线正常,没有Bus-off发生*/
else
/* 总线正常,没有Bus-off发生*/
{
{
RSCAN0Busoff
.
RecoverTimer
++
;
if
(
RSCAN0Busoff
.
RecoverTimer
>=
4
)
{
RSCAN0Busoff
.
RecoverTimer
=
0
;
RSCAN0Busoff
.
Status
=
RSCAN0_BUS_STABLE
;
RSCAN0Busoff
.
Timer
=
0
;
RSCAN0Busoff
.
Cnt
=
0
;
}
}
}
}
}
...
@@ -310,12 +329,12 @@ uint8_t Get_Busoff_Status(void)
...
@@ -310,12 +329,12 @@ uint8_t Get_Busoff_Status(void)
extern
uint8_t
Can_341_Flg
;
extern
uint8_t
Can_341_Flg
;
uint8_t
COM_APP_Process
(
st_CAN_Msg
*
Msg
)
uint8_t
COM_APP_Process
(
st_CAN_Msg
*
Msg
)
{
{
// Can_Write((st_CAN_Msg *)Msg);
// Can_Write((st_CAN_Msg *)Msg);
// return 0;
// return 0;
// }
// }
// void Can_Write(st_CAN_Msg *Msg)
// void Can_Write(st_CAN_Msg *Msg)
// {
// {
uint32_t
i
=
0
;
uint32_t
i
=
0
;
CanTxRxMsg
CAN_SendMsg
;
CanTxRxMsg
CAN_SendMsg
;
uint8_t
CAN_result
=
0
;
uint8_t
CAN_result
=
0
;
...
@@ -341,15 +360,15 @@ uint8_t COM_APP_Process(st_CAN_Msg *Msg)
...
@@ -341,15 +360,15 @@ uint8_t COM_APP_Process(st_CAN_Msg *Msg)
break
;
break
;
case
0x450
:
case
0x450
:
//
if(Can_341_Flg == 1 || Common_GetIgnOnTime() > 2000)
//
if(Can_341_Flg == 1 || Common_GetIgnOnTime() > 2000)
{
{
CAN_result
=
CAN_Transmit
(
CAN0MSG13
,
&
CAN_SendMsg
);
CAN_result
=
CAN_Transmit
(
CAN0MSG13
,
&
CAN_SendMsg
);
}
}
break
;
break
;
case
0x220
:
case
0x220
:
CAN_result
=
CAN_Transmit
(
CAN0MSG10
,
&
CAN_SendMsg
);
CAN_result
=
CAN_Transmit
(
CAN0MSG10
,
&
CAN_SendMsg
);
if
(
AliveCountTimer
<
7
)
if
(
AliveCountTimer
<
7
)
{
{
AliveCountTimer
++
;
AliveCountTimer
++
;
}
}
...
@@ -360,11 +379,11 @@ uint8_t COM_APP_Process(st_CAN_Msg *Msg)
...
@@ -360,11 +379,11 @@ uint8_t COM_APP_Process(st_CAN_Msg *Msg)
break
;
break
;
#if (IC_Current == TY200_080000b_ty)
#if (IC_Current == TY200_080000b_ty)
case
0x580
:
case
0x580
:
if
(
Get_Tpms_TX_Flag
()
!=
0
)
if
(
Get_Tpms_TX_Flag
()
!=
0
)
{
{
CAN_result
=
CAN_Transmit
(
CAN0MSG14
,
&
CAN_SendMsg
);
CAN_result
=
CAN_Transmit
(
CAN0MSG14
,
&
CAN_SendMsg
);
}
}
break
;
break
;
#endif
#endif
default:
default:
...
...
Firmware/Source/Application/CAN_User/Can_User.h
View file @
4dfebd4a
...
@@ -27,7 +27,7 @@ typedef struct
...
@@ -27,7 +27,7 @@ typedef struct
uint8_t
Status
;
uint8_t
Status
;
uint8_t
Timer
;
uint8_t
Timer
;
uint8_t
Cnt
;
uint8_t
Cnt
;
uint8_t
ReportDTCCnt
;
uint8_t
RecoverTimer
;
}
RSCAN0BusoffMonitorStruct
;
}
RSCAN0BusoffMonitorStruct
;
...
...
Firmware/Source/Application/Data_Coolant/Data_Coolant.c
View file @
4dfebd4a
...
@@ -224,7 +224,7 @@ void Data_Coolant_Temp_Display ( void )
...
@@ -224,7 +224,7 @@ void Data_Coolant_Temp_Display ( void )
void
Get_Coolant_Temp_Seg
(
uint16_t
Temp_Value
)
void
Get_Coolant_Temp_Seg
(
uint16_t
Temp_Value
)
{
{
uint8_t
TempSeg
;
//
uint8_t TempSeg;
//uint8_t CurTempSeg;
//uint8_t CurTempSeg;
if
(
Temp_Value
<
50
)
if
(
Temp_Value
<
50
)
...
...
Firmware/Source/Application/Data_TPMS/Data_TPMS.c
View file @
4dfebd4a
...
@@ -2,8 +2,10 @@
...
@@ -2,8 +2,10 @@
#include "Data_TPMS\Data_TPMS.h"
#include "Data_TPMS\Data_TPMS.h"
_TPMS_Display
TPMS
;
_TPMS_Display
TPMS
;
uint32_t
LearnTime_Count
=
0
;
uint32_t
Front_LearnTime_Count0
=
0
;
uint32_t
LearnTime_Count1
=
0
;
uint32_t
Front_LearnTime_Count1
=
0
;
uint32_t
Rear_LearnTime_Count0
=
0
;
uint32_t
Rear_LearnTime_Count1
=
0
;
uint8_t
Can_341_Flg
=
0
;
uint8_t
Can_341_Flg
=
0
;
void
Data_TPMS_KL30_Init
(
void
)
void
Data_TPMS_KL30_Init
(
void
)
{
{
...
@@ -26,8 +28,10 @@ void Data_TPMS_KL30_Init ( void )
...
@@ -26,8 +28,10 @@ void Data_TPMS_KL30_Init ( void )
TPMS
.
TPMS_Rear_FirstLearn_Flag
=
MenuData
.
TPMS_Rear_FirstLearn_Flag
;
TPMS
.
TPMS_Rear_FirstLearn_Flag
=
MenuData
.
TPMS_Rear_FirstLearn_Flag
;
TPMS
.
TPMS_LOST
=
0
;
TPMS
.
TPMS_LOST
=
0
;
LearnTime_Count
=
0
;
//6001;
Front_LearnTime_Count0
=
0
;
LearnTime_Count1
=
0
;
//6001;
Front_LearnTime_Count1
=
0
;
Rear_LearnTime_Count0
=
0
;
Rear_LearnTime_Count1
=
0
;
Can_341_Flg
=
0
;
Can_341_Flg
=
0
;
}
}
...
@@ -45,10 +49,13 @@ void Data_TPMS_KL15_WAKE_UP_Init ( void )
...
@@ -45,10 +49,13 @@ void Data_TPMS_KL15_WAKE_UP_Init ( void )
TPMS
.
TPMS_Rear_FirstLearn_Flag
=
MenuData
.
TPMS_Rear_FirstLearn_Flag
;
TPMS
.
TPMS_Rear_FirstLearn_Flag
=
MenuData
.
TPMS_Rear_FirstLearn_Flag
;
TPMS
.
TPMS_LOST
=
0
;
TPMS
.
TPMS_LOST
=
0
;
LearnTime_Count
=
0
;
//6001;
LearnTime_Count1
=
0
;
//6001;
Front_LearnTime_Count0
=
0
;
Front_LearnTime_Count1
=
0
;
Can_341_Flg
=
0
;
Rear_LearnTime_Count0
=
0
;
Rear_LearnTime_Count1
=
0
;
Can_341_Flg
=
0
;
}
}
void
Can_341_Receive
(
void
)
void
Can_341_Receive
(
void
)
...
@@ -88,15 +95,25 @@ void Data_TPMS_Processing_Service ( void )
...
@@ -88,15 +95,25 @@ void Data_TPMS_Processing_Service ( void )
TPMS
.
TPMS_Rear_ID_Value
=
0
;
TPMS
.
TPMS_Rear_ID_Value
=
0
;
}
}
if
((
Get_CAN_CH0_ID_373_Sig_Front_id
()
!=
0
)
&&
(
Get_CAN_CH0_ID_373_Sig_Front_id
()
!=
0xFFFFFFFF
))
if
((
Get_CAN_CH0_ID_373_Sig_Front_id
()
!=
0
)
&&
(
Get_CAN_CH0_ID_373_Sig_Front_id
()
!=
0xFFFFFFFF
))
{
{
TPMS
.
TPMS_Front_ID_Value
=
1
;
TPMS
.
TPMS_Front_ID_Value
=
1
;
//TPMS.TPMS_Front_Learn = LearningCompletion;
}
}
else
else
{
{
TPMS
.
TPMS_Front_ID_Value
=
0
;
TPMS
.
TPMS_Front_ID_Value
=
0
;
}
}
if
((
Get_CAN_CH0_ID_373_Sig_Rear_id
()
!=
0
)
&&
(
Get_CAN_CH0_ID_373_Sig_Rear_id
()
!=
0xFFFFFFFF
))
{
TPMS
.
TPMS_Rear_ID_Value
=
1
;
}
else
{
TPMS
.
TPMS_Rear_ID_Value
=
0
;
}
}
}
else
else
{
{
...
@@ -107,20 +124,22 @@ void Data_TPMS_Processing_Service ( void )
...
@@ -107,20 +124,22 @@ void Data_TPMS_Processing_Service ( void )
if
(
TPMS
.
TPMS_Front_Learn
==
0x0
)
if
(
TPMS
.
TPMS_Front_Learn
==
0x0
)
{
{
if
(
LearnTime_Count
<=
6000
)
{
LearnTime_Count
++
;
TPMS
.
TPMS_Front_Learn
=
Unstudied
;
//if(TPMS.TPMS_Front_Timeclean == 0)
//{
// LearnTime_Count = 0;
//}
//TPMS.TPMS_Front_Timeclean = 1;
Front_LearnTime_Count1
=
0
;
if
(
Front_LearnTime_Count0
<=
6000
)
{
Front_LearnTime_Count0
++
;
TPMS
.
TPMS_Front_Learn
=
Unstudied
;
//LearnTime_Count = 0;
//LearnTime_Count = 0;
}
}
else
else
{
{
if
(
TPMS
.
TPMS_Front_Timeclean
==
1
)
{
LearnTime_Count
=
0
;
}
TPMS
.
TPMS_Front_Timeclean
=
0
;
if
((
MenuData
.
TPMS_Front_Learn
!=
0x2
)
&&
(
MenuData
.
TPMS_Front_Learn
!=
0x3
)
)
if
((
MenuData
.
TPMS_Front_Learn
!=
0x2
)
&&
(
MenuData
.
TPMS_Front_Learn
!=
0x3
)
)
{
{
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
CAN_CH0_ID_CAN_0x341_Msg_Count
)
!=
CAN_SIG_LOST
)
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
CAN_CH0_ID_CAN_0x341_Msg_Count
)
!=
CAN_SIG_LOST
)
...
@@ -151,14 +170,15 @@ void Data_TPMS_Processing_Service ( void )
...
@@ -151,14 +170,15 @@ void Data_TPMS_Processing_Service ( void )
// TPMS.TPMS_Front_ID_Value = 0;
// TPMS.TPMS_Front_ID_Value = 0;
//}
//}
if
(
TPMS
.
TPMS_Front_Timeclean
==
0
)
//if(TPMS.TPMS_Front_Timeclean == 0)
{
//{
LearnTime_Count
=
0
;
// LearnTime_Count = 0;
}
//}
TPMS
.
TPMS_Front_Timeclean
=
1
;
//TPMS.TPMS_Front_Timeclean = 1;
if
(
LearnTime_Count
<=
6000
)
Front_LearnTime_Count0
=
0
;
if
(
Front_LearnTime_Count1
<=
6000
)
{
{
LearnTime_Count
++
;
Front_LearnTime_Count1
++
;
TPMS
.
TPMS_Front_Learn
=
Learning
;
TPMS
.
TPMS_Front_Learn
=
Learning
;
}
}
else
else
...
@@ -182,7 +202,8 @@ void Data_TPMS_Processing_Service ( void )
...
@@ -182,7 +202,8 @@ void Data_TPMS_Processing_Service ( void )
}
}
else
if
(
TPMS
.
TPMS_Front_Learn
==
0x2
)
else
if
(
TPMS
.
TPMS_Front_Learn
==
0x2
)
{
{
LearnTime_Count
=
0
;
Front_LearnTime_Count0
=
0
;
Front_LearnTime_Count1
=
0
;
//if((Get_CAN_CH0_ID_373_Sig_Front_id() != 0) && (Get_CAN_CH0_ID_373_Sig_Front_id() != 0xFFFFFFFF))
//if((Get_CAN_CH0_ID_373_Sig_Front_id() != 0) && (Get_CAN_CH0_ID_373_Sig_Front_id() != 0xFFFFFFFF))
//{
//{
// TPMS.TPMS_Front_ID_Value = 1;
// TPMS.TPMS_Front_ID_Value = 1;
...
@@ -196,29 +217,34 @@ void Data_TPMS_Processing_Service ( void )
...
@@ -196,29 +217,34 @@ void Data_TPMS_Processing_Service ( void )
}
}
else
if
(
TPMS
.
TPMS_Front_Learn
==
0x3
)
else
if
(
TPMS
.
TPMS_Front_Learn
==
0x3
)
{
{
LearnTime_Count
=
0
;
Front_LearnTime_Count0
=
0
;
Front_LearnTime_Count1
=
0
;
TPMS
.
TPMS_Front_Learn
=
LearningFailure
;
TPMS
.
TPMS_Front_Learn
=
LearningFailure
;
}
}
else
else
{
{
LearnTime_Count
=
0
;
Front_LearnTime_Count0
=
0
;
Front_LearnTime_Count1
=
0
;
TPMS
.
TPMS_Front_Learn
=
MenuData
.
TPMS_Front_Learn
;
TPMS
.
TPMS_Front_Learn
=
MenuData
.
TPMS_Front_Learn
;
}
}
if
(
TPMS
.
TPMS_Rear_Learn
==
0x0
)
if
(
TPMS
.
TPMS_Rear_Learn
==
0x0
)
{
{
if
(
LearnTime_Count1
<=
6000
)
//if(TPMS.TPMS_Rear_Timeclean == 0)
//{
// LearnTime_Count1 = 0;
//}
//TPMS.TPMS_Rear_Timeclean = 1;
Rear_LearnTime_Count1
=
0
;
if
(
Rear_LearnTime_Count0
<=
6000
)
{
{
LearnTime_Count1
++
;
// = 0;
Rear_LearnTime_Count0
++
;
// = 0;
TPMS
.
TPMS_Rear_Learn
=
Unstudied
;
TPMS
.
TPMS_Rear_Learn
=
Unstudied
;
}
}
else
else
{
{
if
(
TPMS
.
TPMS_Rear_Timeclean
==
1
)
{
LearnTime_Count1
=
0
;
}
TPMS
.
TPMS_Rear_Timeclean
=
0
;
if
((
MenuData
.
TPMS_Rear_Learn
!=
0x2
)
&&
(
MenuData
.
TPMS_Rear_Learn
!=
0x3
)
)
if
((
MenuData
.
TPMS_Rear_Learn
!=
0x2
)
&&
(
MenuData
.
TPMS_Rear_Learn
!=
0x3
)
)
{
{
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
CAN_CH0_ID_CAN_0x341_Msg_Count
)
!=
CAN_SIG_LOST
)
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
CAN_CH0_ID_CAN_0x341_Msg_Count
)
!=
CAN_SIG_LOST
)
...
@@ -238,15 +264,15 @@ void Data_TPMS_Processing_Service ( void )
...
@@ -238,15 +264,15 @@ void Data_TPMS_Processing_Service ( void )
}
}
else
if
(
TPMS
.
TPMS_Rear_Learn
==
0x1
)
else
if
(
TPMS
.
TPMS_Rear_Learn
==
0x1
)
{
{
if
(
TPMS
.
TPMS_Rear_Timeclean
==
0
)
//
if(TPMS.TPMS_Rear_Timeclean == 0)
{
//
{
LearnTime_Count1
=
0
;
//
LearnTime_Count1 = 0;
}
//
}
TPMS
.
TPMS_Rear_Timeclean
=
1
;
//
TPMS.TPMS_Rear_Timeclean = 1;
Rear_LearnTime_Count0
=
0
;
if
(
LearnTime_Count1
<=
6000
)
if
(
Rear_
LearnTime_Count1
<=
6000
)
{
{
LearnTime_Count1
++
;
Rear_
LearnTime_Count1
++
;
TPMS
.
TPMS_Rear_Learn
=
Learning
;
TPMS
.
TPMS_Rear_Learn
=
Learning
;
}
}
else
else
...
@@ -271,26 +297,19 @@ void Data_TPMS_Processing_Service ( void )
...
@@ -271,26 +297,19 @@ void Data_TPMS_Processing_Service ( void )
}
}
else
if
(
TPMS
.
TPMS_Rear_Learn
==
0x2
)
else
if
(
TPMS
.
TPMS_Rear_Learn
==
0x2
)
{
{
LearnTime_Count1
=
0
;
Rear_LearnTime_Count0
=
0
;
if
((
Get_CAN_CH0_ID_373_Sig_Rear_id
()
!=
0
)
&&
(
Get_CAN_CH0_ID_373_Sig_Rear_id
()
!=
0xFFFFFFFF
))
Rear_LearnTime_Count1
=
0
;
{
TPMS
.
TPMS_Rear_ID_Value
=
1
;
//TPMS.TPMS_Rear_Learn = LearningCompletion;
}
else
{
TPMS
.
TPMS_Rear_ID_Value
=
0
;
}
}
}
else
if
(
TPMS
.
TPMS_Rear_Learn
==
0x3
)
else
if
(
TPMS
.
TPMS_Rear_Learn
==
0x3
)
{
{
LearnTime_Count1
=
0
;
Rear_LearnTime_Count0
=
0
;
Rear_LearnTime_Count1
=
0
;
TPMS
.
TPMS_Rear_Learn
=
LearningFailure
;
TPMS
.
TPMS_Rear_Learn
=
LearningFailure
;
}
}
else
else
{
{
LearnTime_Count1
=
0
;
Rear_LearnTime_Count0
=
0
;
Rear_LearnTime_Count1
=
0
;
TPMS
.
TPMS_Rear_Learn
=
MenuData
.
TPMS_Front_Learn
;
TPMS
.
TPMS_Rear_Learn
=
MenuData
.
TPMS_Front_Learn
;
}
}
...
@@ -600,6 +619,16 @@ uint8_t Get_Rear_FirstLearn_Flag (void)
...
@@ -600,6 +619,16 @@ uint8_t Get_Rear_FirstLearn_Flag (void)
return
TPMS
.
TPMS_Rear_FirstLearn_Flag
;
return
TPMS
.
TPMS_Rear_FirstLearn_Flag
;
}
}
uint8_t
Get_TPMS_Front_Learn
(
void
)
{
return
TPMS
.
TPMS_Front_Learn
;
}
uint8_t
Get_TPMS_Rear_Learn
(
void
)
{
return
TPMS
.
TPMS_Rear_Learn
;
}
/*获取0x341是否掉线 0-掉线 “--”闪烁 1-在线 获取学习结果进行显示*/
/*获取0x341是否掉线 0-掉线 “--”闪烁 1-在线 获取学习结果进行显示*/
uint8_t
Get_TPMS_CAN_LOST
(
void
)
uint8_t
Get_TPMS_CAN_LOST
(
void
)
{
{
...
...
Firmware/Source/Application/Data_TPMS/Data_TPMS.h
View file @
4dfebd4a
...
@@ -46,6 +46,8 @@ void Data_TPMS_KL15_WAKE_UP_Init ( void );
...
@@ -46,6 +46,8 @@ void Data_TPMS_KL15_WAKE_UP_Init ( void );
uint8_t
Get_Front_FirstLearn_Flag
(
void
);
uint8_t
Get_Front_FirstLearn_Flag
(
void
);
uint8_t
Get_Rear_FirstLearn_Flag
(
void
);
uint8_t
Get_Rear_FirstLearn_Flag
(
void
);
uint8_t
Get_TPMS_CAN_LOST
(
void
);
uint8_t
Get_TPMS_CAN_LOST
(
void
);
uint8_t
Get_TPMS_Front_Learn
(
void
);
uint8_t
Get_TPMS_Rear_Learn
(
void
);
void
Can_341_Receive
(
void
);
void
Can_341_Receive
(
void
);
#endif
#endif
Firmware/Source/Application/GUI_Display/GUI_Display.c
View file @
4dfebd4a
...
@@ -122,19 +122,26 @@ void Gauge_Service(void)
...
@@ -122,19 +122,26 @@ void Gauge_Service(void)
SEG_SET_CoolantDial
(
1
,
GET_DataCoolantTempSegDisp
(),
GET_DataCoolantTempValueDisp
(),
GET_DataCollantTempSegValid
());
SEG_SET_CoolantDial
(
1
,
GET_DataCoolantTempSegDisp
(),
GET_DataCoolantTempValueDisp
(),
GET_DataCollantTempSegValid
());
SEG_SET_Voltage_NUM
(
1
,
Get_Battery_Voltage
());
SEG_SET_Voltage_NUM
(
1
,
Get_Battery_Voltage
());
#if(IC_Current == TY200_080000b_ty)
#if(IC_Current == TY200_080000b_ty)
SEG_SET_TPMS_DISPLAY
(
1
,
Get_Front_TPMS_Sig_Value
(),
Get_Rear_TPMS_Sig_Value
(),
0
,
Get_Front_TPMS_Sig_Vaild
(),
Get_Rear_TPMS_Sig_Vaild
());
SEG_SET_TPMS_DISPLAY
(
1
,
Get_Front_TPMS_Sig_Value
(),
Get_Rear_TPMS_Sig_Value
(),
0
,
Get_Front_TPMS_Sig_Vaild
(),
Get_Rear_TPMS_Sig_Vaild
());
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_03
,
LED_ON
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_04
,
LED_ON
);
#endif
#endif
SEG_SET_Navigation_STS
(
Get_Navigation_St_Dis
(),
Get_Navigation_Code_Dis
(),
Get_Navigation_Mileage_Dis
());
SEG_SET_Navigation_STS
(
Get_Navigation_St_Dis
(),
Get_Navigation_Code_Dis
(),
Get_Navigation_Mileage_Dis
());
}
}
else
else
{
{
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_03
,
LED_ON
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_04
,
LED_ON
);
Checkself_SEG_Display
();
Checkself_SEG_Display
();
}
}
}
}
else
else
{
{
Clear_Bu98
();
Clear_Bu98
();
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_03
,
LED_OFF
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_04
,
LED_OFF
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_35_ODO
,
LED_OFF
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_35_ODO
,
LED_OFF
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_34_TRIP
,
LED_OFF
);
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_34_TRIP
,
LED_OFF
);
...
...
Firmware/Source/Component/BU98R10/BU98R10.c
View file @
4dfebd4a
...
@@ -149,6 +149,8 @@ void BU98R10_Init(void)
...
@@ -149,6 +149,8 @@ void BU98R10_Init(void)
BU98R10_All_Command_Write
(
BU98R10_CMD_SWRST
);
BU98R10_All_Command_Write
(
BU98R10_CMD_SWRST
);
Gen_TimeDelay
(
20
*
1000
,
50U
);
BU98R10_All_Command_Write
(
BU98R10_CMD_ICSET
|
BU98R10_PAR_ICSET_RGB
);
BU98R10_All_Command_Write
(
BU98R10_CMD_ICSET
|
BU98R10_PAR_ICSET_RGB
);
BU98R10_All_Command_Write
(
BU98R10_CMD_DRVCTRL
|
BU98R10_PAR_DRVCTRL_NORMAL
);
BU98R10_All_Command_Write
(
BU98R10_CMD_DRVCTRL
|
BU98R10_PAR_DRVCTRL_NORMAL
);
...
...
Firmware/Source/Component/Line_In/Line_In_user.c
View file @
4dfebd4a
...
@@ -13,7 +13,7 @@ const Line_In_Attribute_st g_stLineInAttribute[LINE_IN_MAX] =
...
@@ -13,7 +13,7 @@ const Line_In_Attribute_st g_stLineInAttribute[LINE_IN_MAX] =
{
LEVEL_HIGH
,
LEVEL_LOW
,
LINE_IN_IG_ON
,
170U
,
20U
,
Get_LINE_IN_Fault_ABS
,
},
{
LEVEL_HIGH
,
LEVEL_LOW
,
LINE_IN_IG_ON
,
170U
,
20U
,
Get_LINE_IN_Fault_ABS
,
},
{
LEVEL_HIGH
,
LEVEL_LOW
,
LINE_IN_IG_ON
,
500U
,
20U
,
Get_LINE_IN_Oil_Pressure
,
},
{
LEVEL_HIGH
,
LEVEL_LOW
,
LINE_IN_IG_ON
,
500U
,
20U
,
Get_LINE_IN_Oil_Pressure
,
},
{
LEVEL_HIGH
,
LEVEL_LOW
,
LINE_IN_IG_ON
,
150U
,
20U
,
Get_LINE_IN_Auto_Start_Stop
,
},
{
LEVEL_HIGH
,
LEVEL_LOW
,
LINE_IN_IG_ON
,
150U
,
20U
,
Get_LINE_IN_Auto_Start_Stop
,
},
{
LEVEL_LOW
,
LEVEL_HIGH
,
LINE_IN_IG_ON
,
100U
,
2
0U
,
Get_LINE_IN_Little_Lamp
,
},
{
LEVEL_LOW
,
LEVEL_HIGH
,
LINE_IN_IG_ON
,
500U
,
50
0U
,
Get_LINE_IN_Little_Lamp
,
},
};
};
Linelib_uint8_t
Get_LINE_IN_Little_Lamp
(
void
)
Linelib_uint8_t
Get_LINE_IN_Little_Lamp
(
void
)
...
...
Firmware/Source/Device/Cmsemicon/BAT32A239/Library/Driver/src/cgc.c
View file @
4dfebd4a
...
@@ -246,7 +246,7 @@ void CGC_LSEConfig(OSC_Pin_Mode_t sub, OSC_Power_Mode_t amphs)
...
@@ -246,7 +246,7 @@ void CGC_LSEConfig(OSC_Pin_Mode_t sub, OSC_Power_Mode_t amphs)
/**
/**
* @brief Configures the External High Speed oscillator (HSE).
* @brief Configures the External High Speed oscillator (HSE).
* @note External High Speed oscillator clock source can be choose from PORT
* @note External High Speed oscillator clock source can be choose from PORT
��
* OSC_OSCILLATOR or external input clock.
* OSC_OSCILLATOR or external input clock.
* at same time, OSC_OSCILLATOR can be 1MHz < fx < 10MHz or 10MHz < fx < 20MHz
* at same time, OSC_OSCILLATOR can be 1MHz < fx < 10MHz or 10MHz < fx < 20MHz
* @param pinMode
* @param pinMode
...
@@ -438,7 +438,7 @@ void CGC_PLL_Setting(PLL_Src_t src, PLL_Div_t div, PLL_Mul_t mul)
...
@@ -438,7 +438,7 @@ void CGC_PLL_Setting(PLL_Src_t src, PLL_Div_t div, PLL_Mul_t mul)
* @note
* @note
* @retval None
* @retval None
*/
*/
void
CGC_PLL_CFG_AS_FCLK
(
void
)
__attribute__
((
section
(
"RW_FUNC_PLL"
)))
void
CGC_PLL_CFG_AS_FCLK
(
void
)
{
{
CGC
->
MCKC
=
0x01
;
CGC
->
MCKC
=
0x01
;
while
((
CGC
->
MCKC
&
CGC_MCKC_CKSTR_Msk
)
==
0
);
while
((
CGC
->
MCKC
&
CGC_MCKC_CKSTR_Msk
)
==
0
);
...
...
Firmware/utility/程序释放/软件变更记录(天鹰项目139).xlsx
View file @
4dfebd4a
No preview for this file type
Firmware/utility/评审记录/天鹰代码评审文件240802.xlsx
0 → 100644
View file @
4dfebd4a
File added
Firmware/utility/天鹰摩托功能规范V2.2_240725.docx
→
Firmware/utility/
评审记录/
天鹰摩托功能规范V2.2_240725.docx
View file @
4dfebd4a
File moved
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