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
d44eff9a
Commit
d44eff9a
authored
Feb 21, 2025
by
李冠华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:混动车型增加故障码功能逻辑
parent
56507836
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
178 additions
and
0 deletions
+178
-0
RMR42E.uvprojx
Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/RMR42E.uvprojx
+10
-0
Application.h
Firmware/Source/Application/Application.h
+1
-0
Fault_Code.c
Firmware/Source/Application/Driving_Information/Fault_Code.c
+133
-0
Fault_Code.h
Firmware/Source/Application/Driving_Information/Fault_Code.h
+30
-0
PowerManag_user.c
Firmware/Source/Component/PowerManagement/PowerManag_user.c
+2
-0
Sys_Task_List.c
Firmware/Source/System/Sys_Task_List.c
+2
-0
No files found.
Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/RMR42E.uvprojx
View file @
d44eff9a
...
@@ -528,6 +528,16 @@
...
@@ -528,6 +528,16 @@
<FileType>
5
</FileType>
<FileType>
5
</FileType>
<FilePath>
..\..\..\..\Source\Application\BackLight\BackLight_User.h
</FilePath>
<FilePath>
..\..\..\..\Source\Application\BackLight\BackLight_User.h
</FilePath>
</File>
</File>
<File>
<FileName>
Fault_Code.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\..\..\Source\Application\Driving_Information\Fault_Code.c
</FilePath>
</File>
<File>
<FileName>
Fault_Code.h
</FileName>
<FileType>
5
</FileType>
<FilePath>
..\..\..\..\Source\Application\Driving_Information\Fault_Code.h
</FilePath>
</File>
</Files>
</Files>
</Group>
</Group>
<Group>
<Group>
...
...
Firmware/Source/Application/Application.h
View file @
d44eff9a
...
@@ -16,5 +16,6 @@
...
@@ -16,5 +16,6 @@
#include "Driving_Information\Data_Time.h"
#include "Driving_Information\Data_Time.h"
#include "Driving_Information\Data_Gear.h"
#include "Driving_Information\Data_Gear.h"
#include "BackLight\BackLight_User.h"
#include "BackLight\BackLight_User.h"
#include "Driving_Information\Fault_Code.h"
#endif
#endif
Firmware/Source/Application/Driving_Information/Fault_Code.c
0 → 100644
View file @
d44eff9a
#include "Components.h"
#include "Driving_Information\Fault_Code.h"
FaultCodeStruct_st_t
Code
;
uint8_t
FaultCodeReflash
=
0U
;
uint8_t
DisplayIndex
=
0U
;
void
Fault_Code_KL30_Init
(
void
)
{
Code
.
FaultCodeDis
=
0U
;
Code
.
FaultCodeValid
=
0U
;
Code
.
FaultCodeValidHistory
=
0U
;
Code
.
DisTimeCount
=
0U
;
memset
(
Code
.
FaultCodeArr
,
0x0U
,
(
MAX_CODE_NUM
*
2U
));
FaultCodeReflash
=
0U
;
DisplayIndex
=
0U
;
}
void
Fault_Code_KL15_Init
(
void
)
{
Code
.
FaultCodeDis
=
0U
;
Code
.
FaultCodeValid
=
0U
;
Code
.
FaultCodeValidHistory
=
0U
;
Code
.
DisTimeCount
=
0U
;
memset
(
Code
.
FaultCodeArr
,
0x0U
,
(
MAX_CODE_NUM
*
2U
));
FaultCodeReflash
=
0U
;
DisplayIndex
=
0U
;
}
void
Fault_Code_Service
(
void
)
{
#if (PART_NUMBER == G54_A01)
Code
.
FaultCodeArr
[
0
]
=
Get_CAN_CH0_ID_38E_Sig_BMCU_FaultCode
();
Code
.
FaultCodeArr
[
1
]
=
Get_CAN_CH0_ID_234_Sig_EMS_FaultCode
();
Code
.
FaultCodeArr
[
2
]
=
Get_CAN_CH0_ID_22A_Sig_GCU_FaultCode
();
Code
.
FaultCodeArr
[
3
]
=
Get_CAN_CH0_ID_161_Sig_MBMS_FaultNum
();
Code
.
FaultCodeArr
[
4
]
=
Get_CAN_CH0_ID_33E_Sig_MMCU_FaultCode
();
Code
.
FaultCodeArr
[
5
]
=
Get_CAN_CH0_ID_361_Sig_SMCU_FaultCode
();
Code
.
FaultCodeArr
[
6
]
=
Get_CAN_CH0_ID_225_Sig_VCU_FaultCode
();
if
((
Code
.
FaultCodeArr
[
0
]
==
0U
)
&&
(
Code
.
FaultCodeArr
[
1
]
==
0U
)
&&
(
Code
.
FaultCodeArr
[
2
]
==
0U
)
&&
(
Code
.
FaultCodeArr
[
3
]
==
0U
)
&&
(
Code
.
FaultCodeArr
[
4
]
==
0U
)
&&
(
Code
.
FaultCodeArr
[
5
]
==
0U
)
&&
(
Code
.
FaultCodeArr
[
6
]
==
0U
))
{
Code
.
FaultCodeValid
=
0U
;
}
else
{
Code
.
FaultCodeValid
=
1U
;
}
if
((
Code
.
FaultCodeValid
==
1U
)
&&
(
Code
.
FaultCodeValidHistory
==
0U
))
{
FaultCodeReflash
=
1U
;
}
if
(
Code
.
FaultCodeValid
!=
Code
.
FaultCodeValidHistory
)
{
Code
.
FaultCodeValidHistory
=
Code
.
FaultCodeValid
;
}
#endif
}
void
Fault_Code_Display_Queue
(
uint8_t
TaskTime
)
{
#if (PART_NUMBER == G54_A01)
if
(
Code
.
FaultCodeValid
==
1U
)
{
if
((
Code
.
DisTimeCount
<
CODE_DISPLAY_TIME
)
&&
(
FaultCodeReflash
!=
1U
))
{
Code
.
DisTimeCount
+=
TaskTime
;
}
else
{
FaultCodeReflash
=
0U
;
for
(
uint8_t
i
=
0U
;
i
<=
MAX_CODE_NUM
;
i
++
)
{
if
(
Code
.
FaultCodeArr
[
DisplayIndex
]
==
0U
)
{
if
(
DisplayIndex
<
(
MAX_CODE_NUM
-
1U
))
{
DisplayIndex
++
;
}
else
{
DisplayIndex
=
0U
;
}
}
else
{
Code
.
FaultCodeDis
=
Code
.
FaultCodeArr
[
DisplayIndex
];
Code
.
DisTimeCount
=
0U
;
DisplayIndex
++
;
break
;
}
}
}
}
else
{
Code
.
FaultCodeDis
=
0U
;
Code
.
DisTimeCount
=
0U
;
}
#endif
}
/******************************************************************************
函数名:Get_FaultCode_Value
功 能:获取当前应显示的故障码函数
参 数:无
返回值:Code.FaultCodeDis;
******************************************************************************
注 意:该函数必须每 ms被调用一次
******************************************************************************/
uint16_t
Get_FaultCode_Value
(
void
)
{
return
Code
.
FaultCodeDis
;
}
/******************************************************************************
函数名:Get_FaultCode_Valid
功 能:获取故障码有效状态数
参 数:无
返回值:Code.FaultCodeValid 0--不显示,1--常显
******************************************************************************
注 意:该函数必须每 ms被调用一次
******************************************************************************/
uint8_t
Get_FaultCode_Valid
(
void
)
{
return
Code
.
FaultCodeValid
;
}
Firmware/Source/Application/Driving_Information/Fault_Code.h
0 → 100644
View file @
d44eff9a
#ifndef FAULT_CODE_H__
#define FAULT_CODE_H__
#include "Application.h"
#include "Components.h"
#define MAX_CODE_NUM 7U
#define CODE_DISPLAY_TIME 2000U
typedef
struct
//__attribute__((aligned(4)))
{
uint16_t
FaultCodeArr
[
MAX_CODE_NUM
];
//故障码列表
uint16_t
FaultCodeDis
;
//当前显示故障
uint16_t
DisTimeCount
;
/*故障码显示计时*/
uint8_t
FaultCodeValid
;
/*故障码有效状态*/
uint8_t
FaultCodeValidHistory
;
/*故障码有效状态*/
}
FaultCodeStruct_st_t
;
extern
void
Fault_Code_KL30_Init
(
void
);
extern
void
Fault_Code_KL15_Init
(
void
);
extern
void
Fault_Code_Service
(
void
);
extern
void
Fault_Code_Display_Queue
(
uint8_t
TaskTime
);
extern
uint16_t
Get_FaultCode_Value
(
void
);
extern
uint8_t
Get_FaultCode_Valid
(
void
);
#endif
Firmware/Source/Component/PowerManagement/PowerManag_user.c
View file @
d44eff9a
...
@@ -76,6 +76,7 @@ static void Power_KL30_Init(void)
...
@@ -76,6 +76,7 @@ static void Power_KL30_Init(void)
Data_Time_KL30_Init
();
Data_Time_KL30_Init
();
Data_Gear_KL30_Init
();
Data_Gear_KL30_Init
();
Data_Fuel_KL30_Init
();
Data_Fuel_KL30_Init
();
Fault_Code_KL30_Init
();
}
}
extern
uint32_t
PowerIgnOffTimeLine
;
extern
uint32_t
PowerIgnOffTimeLine
;
...
@@ -121,6 +122,7 @@ static void Power_IG_ON_Init(void)
...
@@ -121,6 +122,7 @@ static void Power_IG_ON_Init(void)
Checkself_Init
();
Checkself_Init
();
Line_In_KL15_ON_Init
();
Line_In_KL15_ON_Init
();
LED_Driver_Service_Immediate
();
LED_Driver_Service_Immediate
();
Fault_Code_KL15_Init
();
}
}
static
void
Power_Sleep_Init
(
void
)
static
void
Power_Sleep_Init
(
void
)
...
...
Firmware/Source/System/Sys_Task_List.c
View file @
d44eff9a
...
@@ -36,6 +36,7 @@ void Sys_10ms_Tasks(void)
...
@@ -36,6 +36,7 @@ void Sys_10ms_Tasks(void)
Can_BusOff_Recover
(
10u
);
Can_BusOff_Recover
(
10u
);
Data_CumulativeWorkHours_EEPROM_Write
();
Data_CumulativeWorkHours_EEPROM_Write
();
BackLight_Service
();
BackLight_Service
();
Fault_Code_Service
();
}
}
void
Sys_20ms_Tasks
(
void
)
void
Sys_20ms_Tasks
(
void
)
...
@@ -51,6 +52,7 @@ void Sys_50ms_Tasks(void)
...
@@ -51,6 +52,7 @@ void Sys_50ms_Tasks(void)
Set_CAN_ALL_Signal
();
Set_CAN_ALL_Signal
();
Gauge_Service
();
Gauge_Service
();
Data_Soc_Service
();
Data_Soc_Service
();
Fault_Code_Display_Queue
(
50U
);
}
}
void
Sys_15ms_Tasks
(
void
)
void
Sys_15ms_Tasks
(
void
)
...
...
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