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
c4943fc8
Commit
c4943fc8
authored
Sep 19, 2024
by
陈家乐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix:禅道外发问题:62025、61997、61907,数据处理完之前外发无效值
parent
1cd7f1c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
108 additions
and
60 deletions
+108
-60
Can_App.c
Firmware/Source/Application/CAN_User/Can_App.c
+99
-56
PowerManag_user.c
Firmware/Source/Component/PowerManagement/PowerManag_user.c
+9
-4
No files found.
Firmware/Source/Application/CAN_User/Can_App.c
View file @
c4943fc8
...
...
@@ -4,7 +4,17 @@
uint16_t
CAN_TX_Count
=
0
;
uint16_t
AliveCountTimer
=
0
;
uint8_t
Power_KL30_Init_flag
=
0
;
extern
uint8_t
Tpms_TX_Flag
;
#define INVALID_VALUE 0x0
void
CAN_TX_Flag_Init
(
void
)
{
Power_KL30_Init_flag
=
0
;
}
void
CAN_TX_Count_Init
(
void
)
{
CAN_TX_Count
=
0
;
...
...
@@ -20,15 +30,15 @@ void Can_Set_Buff_220(canlib_uint8_t CopyData[])
p220
=
(
CANMsg220Union
*
)
CopyData
;
if
(
p220
!=
(
void
*
)
0
)
{
for
(
i
=
0u
;
i
<
8u
;
i
++
)
{
p220
->
Msg
[
i
]
=
0x0u
;
}
for
(
i
=
0u
;
i
<
8u
;
i
++
)
{
p220
->
Msg
[
i
]
=
0x0u
;
}
p220
->
Sig
.
TCS_TX
=
u8TCSVal
;
p220
->
Sig
.
AliveCounter
=
AliveCountTimer
;
p220
->
Sig
.
CheckSum
=
(
u8TCSVal
==
1
)
?
8
:
0
;
}
p220
->
Sig
.
TCS_TX
=
u8TCSVal
;
p220
->
Sig
.
AliveCounter
=
AliveCountTimer
;
p220
->
Sig
.
CheckSum
=
(
u8TCSVal
==
1
)
?
8
:
0
;
}
...
...
@@ -46,21 +56,32 @@ void Can_Set_Buff_6EE(canlib_uint8_t CopyData[])
if
(
p6EE
!=
(
void
*
)
0
)
{
for
(
i
=
0u
;
i
<
8u
;
i
++
)
if
(
Power_KL30_Init_flag
==
1
)
{
p6EE
->
Msg
[
i
]
=
0x0u
;
}
p6EE
->
Sig
.
ODO_TX_H
=
(
ODO_tx
>>
16
)
&
0xFF
;
p6EE
->
Sig
.
ODO_TX_M
=
(
ODO_tx
>>
8
)
&
0xFF
;
p6EE
->
Sig
.
ODO_TX_L
=
ODO_tx
&
0xFF
;
if
(
Fuel_tx
>
255
)
{
p6EE
->
Sig
.
Fuel_Res_TX
=
0xFF
;
for
(
i
=
0u
;
i
<
8u
;
i
++
)
{
p6EE
->
Msg
[
i
]
=
0x0u
;
}
p6EE
->
Sig
.
ODO_TX_H
=
(
ODO_tx
>>
16
)
&
0xFF
;
p6EE
->
Sig
.
ODO_TX_M
=
(
ODO_tx
>>
8
)
&
0xFF
;
p6EE
->
Sig
.
ODO_TX_L
=
ODO_tx
&
0xFF
;
if
(
Fuel_tx
>
255
)
{
p6EE
->
Sig
.
Fuel_Res_TX
=
0xFF
;
}
else
{
p6EE
->
Sig
.
Fuel_Res_TX
=
Fuel_tx
;
}
}
else
{
p6EE
->
Sig
.
Fuel_Res_TX
=
Fuel_tx
;
for
(
i
=
0u
;
i
<
8u
;
i
++
)
{
p6EE
->
Msg
[
i
]
=
INVALID_VALUE
;
}
}
}
//p6EE -> Sig.Vsppe_H3_TX = (Vspeed_tx >> 8) & 0x7u ;
...
...
@@ -91,12 +112,23 @@ void Can_Set_Buff_6EF(canlib_uint8_t CopyData[])
p6EF
=
(
CANMsg6EFUnion
*
)
CopyData
;
if
(
p6EF
!=
(
void
*
)
0
)
{
for
(
i
=
0u
;
i
<
8u
;
i
++
)
if
(
Power_KL30_Init_flag
==
1
)
{
p6EF
->
Msg
[
i
]
=
0x0u
;
for
(
i
=
0u
;
i
<
8u
;
i
++
)
{
p6EF
->
Msg
[
i
]
=
0x0u
;
}
p6EF
->
Sig
.
TripA_H
=
(
TripA_tx
>>
8
)
&
0xFF
;
p6EF
->
Sig
.
TripA_L
=
TripA_tx
&
0xFF
;
}
else
{
for
(
i
=
0u
;
i
<
8u
;
i
++
)
{
p6EF
->
Msg
[
i
]
=
INVALID_VALUE
;
}
}
p6EF
->
Sig
.
TripA_H
=
(
TripA_tx
>>
8
)
&
0xFF
;
p6EF
->
Sig
.
TripA_L
=
TripA_tx
&
0xFF
;
}
//p6EF -> Sig.Espeed_TX = Espeed_tx;
...
...
@@ -115,52 +147,63 @@ void Can_Set_Buff_450(canlib_uint8_t CopyData[])
p450
=
(
CANMsg450Union
*
)
CopyData
;
if
(
p450
!=
(
void
*
)
0
)
{
for
(
i
=
0u
;
i
<
8u
;
i
++
)
{
p450
->
Msg
[
i
]
=
0x0u
;
}
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_L
=
0
;
}
else
if
(
Power_KL30_Init_flag
==
1
)
{
if
((
u16FrontTpmsValue
+
146
)
<=
1000U
)
for
(
i
=
0u
;
i
<
8u
;
i
++
)
{
u16FrontTpms
=
(
u16FrontTpmsValue
+
146
);
p450
->
Msg
[
i
]
=
0x0u
;
}
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_L
=
0
;
}
else
{
u16FrontTpms
=
1000U
;
if
((
u16FrontTpmsValue
+
146
)
<=
1000U
)
{
u16FrontTpms
=
(
u16FrontTpmsValue
+
146
);
}
else
{
u16FrontTpms
=
1000U
;
}
p450
->
Sig
.
Front_Pressure_TX_H
=
(
u16FrontTpms
>>
8
)
&
0xFF
;
p450
->
Sig
.
Front_Pressure_TX_L
=
(
u16FrontTpms
)
&
0xFF
;
}
p450
->
Sig
.
Front_Pressure_TX_H
=
(
u16FrontTpms
>>
8
)
&
0xFF
;
p450
->
Sig
.
Front_Pressure_TX_L
=
(
u16FrontTpms
)
&
0xFF
;
}
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_L
=
0
;
}
else
{
if
((
u16RearTpmsValue
+
146
)
<=
1000U
)
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
)
{
u16RearTpms
=
(
u16RearTpmsValue
+
146
);
p450
->
Sig
.
Rear_Pressure_TX_H
=
0
;
p450
->
Sig
.
Rear_Pressure_TX_L
=
0
;
}
else
{
u16RearTpms
=
1000U
;
if
((
u16RearTpmsValue
+
146
)
<=
1000U
)
{
u16RearTpms
=
(
u16RearTpmsValue
+
146
);
}
else
{
u16RearTpms
=
1000U
;
}
p450
->
Sig
.
Rear_Pressure_TX_H
=
(
u16RearTpms
>>
8
)
&
0xFF
;
p450
->
Sig
.
Rear_Pressure_TX_L
=
(
u16RearTpms
)
&
0xFF
;
}
p450
->
Sig
.
Rear_Pressure_TX_H
=
(
u16RearTpms
>>
8
)
&
0xFF
;
p450
->
Sig
.
Rear_Pressure_TX_L
=
(
u16RearTpms
)
&
0xFF
;
}
else
{
for
(
i
=
0u
;
i
<
8u
;
i
++
)
{
p450
->
Msg
[
i
]
=
INVALID_VALUE
;
}
}
}
...
...
Firmware/Source/Component/PowerManagement/PowerManag_user.c
View file @
c4943fc8
...
...
@@ -23,6 +23,7 @@ static Power_Status_em Power_Stay_Sleep(void);
extern
uint8_t
u8LEDDriverCheckCount
;
static
const
st_PowerGroup
g_stPwrTasks
=
{
Power_KL30_Init
,
Power_IG_OFF_Init
,
...
...
@@ -42,14 +43,16 @@ void PwrMemInit(void)
PowerMemInit
(
&
g_stPwrTasks
);
}
extern
uint8_t
Power_KL30_Init_flag
;
static
void
Power_KL30_Init
(
void
)
{
CAN_TX_Flag_Init
();
ClearODO_Flag
=
0
;
Gpio_Init
(
Gpio_KL30_Init
);
Simulated_IIC_2_Init
();
eeprom_StoreInfo_Init
();
Can_Init
();
Can_Init
();
Data_TPMS_KL30_Init
();
CAN_TX_Init
();
//CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Enable);
...
...
@@ -98,6 +101,8 @@ static void Power_KL30_Init(void)
// Data_TPMS_Processing_Service();
Common_DataInit
();
Power_KL30_Init_flag
=
1
;
}
extern
uint32_t
PowerIgnOffTimeLine
;
static
void
Power_Wakeup_Init
(
void
)
...
...
@@ -173,7 +178,7 @@ static void Power_IG_OFF_Init(void)
static
void
Power_IG_ON_Init
(
void
)
{
Checkself_Init
();
Checkself_Init
();
Line_In_KL15_ON_Init
();
Telltales_KL15_Init
();
Telltales_UserInit
();
...
...
@@ -200,7 +205,7 @@ static void Power_Sleep_Init(void)
//TimerM_PWM_CH_Output_init(TIMERM_COUNTER0, TIMERM_CHD, ActiveLevel_High);
//TimerM_PWM_CH_Output_init(TIMERM_COUNTER1, TIMERM_CHB, ActiveLevel_High);
//RTC_Stop();
rte_can_deinit
(
CAN_CH_0
);
rte_can_deinit
(
CAN_CH_0
);
TMM0_Stop
();
TMM1_Stop
();
TMM_All_Stop
();
...
...
@@ -350,5 +355,5 @@ void Sys_Startup_Init(void)
uint8_t
u8StartuoMode
=
0
;
PwrMemInit
(
);
Power_Management_Init
(
u8StartuoMode
);
}
}
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