Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
RT_RMR42E
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
时昊
RT_RMR42E
Commits
a9b6cd09
Commit
a9b6cd09
authored
Feb 20, 2025
by
李冠华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🦄
refactor:将CAN报文回调函数放在统一的文件中,删除无用代码
parent
d221c91e
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
135 additions
and
81 deletions
+135
-81
CAN_CH0_CAN_Communication_Matrix.c
...ce/Application/CAN_APP/CAN_CH0_CAN_Communication_Matrix.c
+7
-2
CAN_CH0_CAN_Communication_Matrix.h
...ce/Application/CAN_APP/CAN_CH0_CAN_Communication_Matrix.h
+1
-0
Can_RX_User.c
Firmware/Source/Application/CAN_User/Can_RX_User.c
+108
-0
Can_RX_User.h
Firmware/Source/Application/CAN_User/Can_RX_User.h
+4
-1
Data_Fuel.c
Firmware/Source/Application/Data_Fuel/Data_Fuel.c
+0
-17
Data_Fuel.h
Firmware/Source/Application/Data_Fuel/Data_Fuel.h
+1
-1
Telltales_user.c
Firmware/Source/Component/Telltales/Telltales_user.c
+4
-57
Telltales_user.h
Firmware/Source/Component/Telltales/Telltales_user.h
+10
-3
No files found.
Firmware/Source/Application/CAN_APP/CAN_CH0_CAN_Communication_Matrix.c
View file @
a9b6cd09
...
...
@@ -687,7 +687,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
500ul
,
0x18Eul
,
((
void
*
)
0
),
(
MsgID
_0x18E_Receive
),
(
CAN
_0x18E_Receive
),
((
void
*
)
0
),
},
{
...
...
@@ -707,7 +707,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
2000ul
,
0x38Eul
,
((
void
*
)
0
),
(
(
void
*
)
0
),
(
CAN_0x38E_Receive
),
((
void
*
)
0
),
},
{
...
...
@@ -1035,6 +1035,11 @@ uint8_t Get_CAN_CH0_ID_38E_Sig_BMCU_Moto3_SoftOverCurrentFault(void)
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_BMCU_Error_Msg_Count
,
3u
)
>>
7u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto3HWOverCurrentFault
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_BMCU_Error_Msg_Count
,
3u
)
>>
0u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto3_Locked_RotorFault
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_BMCU_Error_Msg_Count
,
3u
)
>>
4u
)
&
0x01u
));
...
...
Firmware/Source/Application/CAN_APP/CAN_CH0_CAN_Communication_Matrix.h
View file @
a9b6cd09
...
...
@@ -274,6 +274,7 @@ extern uint8_t Get_CAN_CH0_ID_3B1_Sig_CHG_InputVoltState(void);
extern
uint8_t
Get_CAN_CH0_ID_3B1_Sig_CHG_HardFault
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_3B1_Sig_CHG_CommState
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_3B1_Sig_CHG_ChargeStage
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto3HWOverCurrentFault
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto3_SoftOverCurrentFault
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto3_Locked_RotorFault
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto2HWOverCurrentFault
(
void
);
...
...
Firmware/Source/Application/CAN_User/Can_RX_User.c
View file @
a9b6cd09
...
...
@@ -275,3 +275,111 @@ uint8_t Get_CAN_Power_State(void)
#endif
return
state
;
}
void
CAN_0x18E_Receive
(
uint8_t
CopyData
[])
{
if
((
Fuel
.
FuelSeg
!=
Fuel
.
FuelSegDis
)
&&
(
Fuel
.
FuelStatusCount
>=
3U
))
{
Fuel
.
FuelSegDis
=
Fuel
.
FuelSeg
;
Fuel
.
FuelStatusCount
=
0U
;
}
else
if
((
Fuel
.
FuelSeg
!=
Fuel
.
FuelSegDis
)
&&
(
Fuel
.
FuelStatusCount
<
3U
))
{
Fuel
.
FuelStatusCount
++
;
}
else
{
Fuel
.
FuelStatusCount
=
0U
;
}
}
void
CAN_0x225_Receive
(
uint8_t
CopyData
[])
{
#if (PART_NUMBER == G54_A01)
if
((
Get_CAN_CH0_ID_225_Sig_VCU_EmsFltLv3
()
==
1U
)
&&
(
g_EngineMalfunctionStatus
==
0U
))
{
g_u8EmsFltLv3Count
++
;
}
else
if
((
Get_CAN_CH0_ID_225_Sig_VCU_EmsFltLv3
()
==
0U
)
&&
(
g_EngineMalfunctionStatus
==
1U
))
{
g_u8EmsFltLv3Count
++
;
}
else
{
g_u8EmsFltLv3Count
=
0U
;
}
if
((
Get_CAN_CH0_ID_225_Sig_VCU_VoltLow
()
==
1U
)
&&
(
g_VoltLowStatus
==
0U
))
{
g_VoltLowCount
++
;
}
else
if
((
Get_CAN_CH0_ID_225_Sig_VCU_VoltLow
()
==
0U
)
&&
(
g_VoltLowStatus
==
1U
))
{
g_VoltLowCount
++
;
}
else
{
g_VoltLowCount
=
0U
;
}
#endif
}
void
CAN_0x234_Receive
(
uint8_t
CopyData
[])
{
#if (PART_NUMBER == G54_A01)
if
((
Get_CAN_CH0_ID_234_Sig_EMS_EngineOilLow
()
==
1U
)
&&
(
g_EngineOilLowStatus
==
0U
))
{
g_EngineOilLowCount
++
;
}
else
if
((
Get_CAN_CH0_ID_234_Sig_EMS_EngineOilLow
()
==
0U
)
&&
(
g_EngineOilLowStatus
==
1U
))
{
g_EngineOilLowCount
++
;
}
else
{
g_EngineOilLowCount
=
0U
;
}
#endif
}
void
CAN_0x38E_Receive
(
uint8_t
CopyData
[])
{
#if (PART_NUMBER == G54_A01)
uint8_t
u8Signal
[
9
]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
u8Signal
[
0
]
=
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto1_Locked_RotorFault
();
u8Signal
[
1
]
=
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto2_Locked_RotorFault
();
u8Signal
[
2
]
=
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto3_Locked_RotorFault
();
u8Signal
[
3
]
=
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto1_SoftOverCurrentFault
();
u8Signal
[
4
]
=
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto2_SoftOverCurrentFault
();
u8Signal
[
5
]
=
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto3_SoftOverCurrentFault
();
u8Signal
[
6
]
=
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto1HWOverCurrentFault
();
u8Signal
[
7
]
=
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto2HWOverCurrentFault
();
u8Signal
[
8
]
=
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto3HWOverCurrentFault
();
for
(
uint8_t
i
=
0U
;
i
<
9U
;
i
++
)
{
if
((
u8Signal
[
i
]
==
1U
)
&&
(
g_OverLoadStatus
[
i
]
==
0U
))
{
if
(
g_OverLoadCount
[
i
]
<
3U
)
{
g_OverLoadCount
[
i
]
++
;
}
}
else
if
((
u8Signal
[
i
]
==
0U
)
&&
(
g_OverLoadStatus
[
i
]
==
1U
))
{
if
(
g_OverLoadCount
[
i
]
<
3U
)
{
g_OverLoadCount
[
i
]
++
;
}
}
else
{
g_OverLoadCount
[
i
]
=
0U
;
}
}
#endif
}
Firmware/Source/Application/CAN_User/Can_RX_User.h
View file @
a9b6cd09
...
...
@@ -37,6 +37,9 @@ extern uint8_t Get_CAN_Num_SBMS_Soc(void);
extern
uint8_t
Get_CAN_Num_SMCU_ErrorGrage
(
void
);
extern
uint8_t
Get_CAN_Power_State
(
void
);
extern
void
Set_CAN_ALL_Signal
(
void
);
extern
void
CAN_0x18E_Receive
(
uint8_t
CopyData
[]);
extern
void
CAN_0x225_Receive
(
uint8_t
CopyData
[]);
extern
void
CAN_0x234_Receive
(
uint8_t
CopyData
[]);
extern
void
CAN_0x38E_Receive
(
uint8_t
CopyData
[]);
#endif
Firmware/Source/Application/Data_Fuel/Data_Fuel.c
View file @
a9b6cd09
...
...
@@ -16,23 +16,6 @@ void Data_Fuel_KL15_Init(void)
}
void
MsgID_0x18E_Receive
(
void
)
{
if
((
Fuel
.
FuelSeg
!=
Fuel
.
FuelSegDis
)
&&
(
Fuel
.
FuelStatusCount
>=
3U
))
{
Fuel
.
FuelSegDis
=
Fuel
.
FuelSeg
;
Fuel
.
FuelStatusCount
=
0U
;
}
else
if
((
Fuel
.
FuelSeg
!=
Fuel
.
FuelSegDis
)
&&
(
Fuel
.
FuelStatusCount
<
3U
))
{
Fuel
.
FuelStatusCount
++
;
}
else
{
Fuel
.
FuelStatusCount
=
0U
;
}
}
void
Data_Fuel_Service
(
void
)
{
...
...
Firmware/Source/Application/Data_Fuel/Data_Fuel.h
View file @
a9b6cd09
...
...
@@ -14,10 +14,10 @@ typedef struct //__attribute__((aligned(4)))
}
FuelStruct_st_t
;
extern
FuelStruct_st_t
Fuel
;
extern
void
Data_Fuel_KL30_Init
(
void
);
extern
void
Data_Fuel_KL15_Init
(
void
);
extern
void
MsgID_0x18E_Receive
(
void
);
extern
void
Data_Fuel_Service
(
void
);
extern
uint8_t
Get_FuelSeg_Display
(
void
);
...
...
Firmware/Source/Component/Telltales/Telltales_user.c
View file @
a9b6cd09
...
...
@@ -62,13 +62,14 @@ static Tellib_uint16_t LED_Charging_Connection_R_Judgement(void);
static
void
LED_Charging_Connection_R_Execution
(
Tellib_uint16_t
led_status
);
static
Tellib_uint16_t
LED_Power_Battery_Failure_R_Judgement
(
void
);
static
void
LED_Power_Battery_Failure_R_Execution
(
Tellib_uint16_t
led_status
);
uint8_t
u8CanId401Flag
=
0
;
uint8_t
g_u8EmsFltLv3Count
=
0U
;
uint8_t
g_EngineMalfunctionStatus
=
0U
;
uint8_t
g_EngineOilLowCount
=
0U
;
uint8_t
g_EngineOilLowStatus
=
0U
;
uint8_t
g_VoltLowStatus
=
0U
;
uint8_t
g_VoltLowCount
=
0U
;
uint8_t
g_OverLoadStatus
[
9
]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
uint8_t
g_OverLoadCount
[
9
]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
const
LED_Attribute_st
LED_Attribute
[
LED_Max
]
=
{
/* 指示灯索引 是否自检 外部信号自检 工作电源状态 自检开始时间 自检持续时间 指示灯点亮条件 指示灯执行函数 */
...
...
@@ -111,69 +112,15 @@ void Telltales_Init(void)
m_ExtPara
.
LED_PowerON_TimerCbk
=
Common_GetIgnOnTime
;
m_ExtPara
.
LED_PowerCbk
=
Common_Get_IG_Sts
;
PowerSts_num
=
Common_Get_IG_Sts
();
u8CanId401Flag
=
0
;
g_u8EmsFltLv3Count
=
0U
;
g_EngineMalfunctionStatus
=
0U
;
g_EngineOilLowCount
=
0U
;
g_EngineOilLowStatus
=
0U
;
g_VoltLowStatus
=
0U
;
g_VoltLowCount
=
0U
;
Telltales_KL30_Wakeup_Init
(
Tel_Mem
,
LED_Attribute
,
&
m_ExtPara
);
}
void
Can_ID_401
(
uint8_t
CopyData
[])
{
u8CanId401Flag
=
1
;
}
void
CAN_0x225_Receive
(
uint8_t
CopyData
[])
{
#if (PART_NUMBER == G54_A01)
if
((
Get_CAN_CH0_ID_225_Sig_VCU_EmsFltLv3
()
==
1U
)
&&
(
g_EngineMalfunctionStatus
==
0U
))
{
g_u8EmsFltLv3Count
++
;
}
else
if
((
Get_CAN_CH0_ID_225_Sig_VCU_EmsFltLv3
()
==
0U
)
&&
(
g_EngineMalfunctionStatus
==
1U
))
{
g_u8EmsFltLv3Count
++
;
}
else
{
g_u8EmsFltLv3Count
=
0U
;
}
if
((
Get_CAN_CH0_ID_225_Sig_VCU_VoltLow
()
==
1U
)
&&
(
g_VoltLowStatus
==
0U
))
{
g_VoltLowCount
++
;
}
else
if
((
Get_CAN_CH0_ID_225_Sig_VCU_VoltLow
()
==
0U
)
&&
(
g_VoltLowStatus
==
1U
))
{
g_VoltLowCount
++
;
}
else
{
g_VoltLowCount
=
0U
;
}
#endif
}
void
CAN_0x234_Receive
(
uint8_t
CopyData
[])
{
#if (PART_NUMBER == G54_A01)
if
((
Get_CAN_CH0_ID_234_Sig_EMS_EngineOilLow
()
==
1U
)
&&
(
g_EngineOilLowStatus
==
0U
))
{
g_EngineOilLowCount
++
;
}
else
if
((
Get_CAN_CH0_ID_234_Sig_EMS_EngineOilLow
()
==
0U
)
&&
(
g_EngineOilLowStatus
==
1U
))
{
g_EngineOilLowCount
++
;
}
else
{
g_EngineOilLowCount
=
0U
;
}
#endif
}
static
Tellib_uint16_t
LED_EFI_failure_Judgement
(
void
)
{
Tellib_uint16_t
LED_STATE
=
0u
;
...
...
Firmware/Source/Component/Telltales/Telltales_user.h
View file @
a9b6cd09
...
...
@@ -42,13 +42,20 @@ typedef enum
LED_Max
,
}
LED_Idx_t
;
extern
uint8_t
g_u8EmsFltLv3Count
;
extern
uint8_t
g_EngineMalfunctionStatus
;
extern
uint8_t
g_EngineOilLowCount
;
extern
uint8_t
g_EngineOilLowStatus
;
extern
uint8_t
g_VoltLowStatus
;
extern
uint8_t
g_VoltLowCount
;
extern
uint8_t
g_OverLoadStatus
[
9
];
extern
uint8_t
g_OverLoadCount
[
9
];
// extern Tellib_uint8_t Auto_Start_Stop ;
void
Telltales_Init
(
void
);
// void Telltales_Auto_Start_Stop(void);
// void Telltales_Auto_Start_Stop_Setting(void);
Tellib_uint8_t
Telltales_Voltage_Date
(
void
);
extern
void
CAN_0x225_Receive
(
uint8_t
CopyData
[]);
extern
void
CAN_0x234_Receive
(
uint8_t
CopyData
[]);
#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