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
b099cba6
Commit
b099cba6
authored
Jun 07, 2025
by
高士达
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'lgh_from_dev' into 'dev'
Lgh from dev See merge request
!34
parents
af387967
17acbff5
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
454 additions
and
200 deletions
+454
-200
CAN_CH0_CAN_Communication_Matrix.c
...ce/Application/CAN_APP/CAN_CH0_CAN_Communication_Matrix.c
+1
-0
Can_RX_User.c
Firmware/Source/Application/CAN_User/Can_RX_User.c
+34
-1
Data_Fuel.c
Firmware/Source/Application/Data_Fuel/Data_Fuel.c
+2
-0
Data_Fuel.h
Firmware/Source/Application/Data_Fuel/Data_Fuel.h
+1
-0
Data_Soc.c
Firmware/Source/Application/Data_Soc/Data_Soc.c
+6
-0
Data_Time.c
Firmware/Source/Application/Driving_Information/Data_Time.c
+57
-0
Data_Time.h
Firmware/Source/Application/Driving_Information/Data_Time.h
+2
-0
GpioUser.c
Firmware/Source/Application/GPIO_USER/GpioUser.c
+4
-4
GUI_Display.c
Firmware/Source/Application/GUI_Display/GUI_Display.c
+22
-58
GUI_Display.h
Firmware/Source/Application/GUI_Display/GUI_Display.h
+0
-2
SEG_DISPLAY.c
Firmware/Source/Application/SEG_DISPLAY/SEG_DISPLAY.c
+145
-100
BU98R10.c
Firmware/Source/Component/BU98R10/BU98R10.c
+98
-0
Telltales_user.c
Firmware/Source/Component/Telltales/Telltales_user.c
+75
-30
Telltales_user.h
Firmware/Source/Component/Telltales/Telltales_user.h
+2
-0
UDS_ISO14229_Services.h
Firmware/Source/UDS/UDS_ISO14229_Services.h
+5
-5
No files found.
Firmware/Source/Application/CAN_APP/CAN_CH0_CAN_Communication_Matrix.c
View file @
b099cba6
...
...
@@ -737,6 +737,7 @@ void System_Indicator_OFF_callback(canlib_uint8_t CopyData[])
g_ReadyCount
=
0U
;
g_PtoSwCount
=
0U
;
g_SysFltLampCount
=
0U
;
g_VCUChgModeCount
=
0U
;
}
uint8_t
Get_CAN_CH0_ID_225_Sig_VCU_VoltLow
(
void
)
...
...
Firmware/Source/Application/CAN_User/Can_RX_User.c
View file @
b099cba6
...
...
@@ -280,7 +280,19 @@ uint8_t Get_CAN_Power_State(void)
void
CAN_0x18E_Receive
(
uint8_t
CopyData
[])
{
Fuel
.
FuelSeg
=
Get_CAN_CH0_ID_18E_Sig_EMS_FuelRemainLevel
();
Fuel
.
FuelValid
=
1U
;
if
(
Fuel
.
FuelValid
==
0U
)
{
if
(
Fuel
.
FuelValidCount
>=
2U
)
{
Fuel
.
FuelValid
=
1U
;
}
else
{
Fuel
.
FuelValidCount
++
;
}
}
if
(
Fuel
.
FuelSeg
>
8U
)
{
Fuel
.
FuelSeg
=
8U
;
...
...
@@ -536,6 +548,26 @@ void CAN_0x220_Receive(uint8_t CopyData [])
{
g_SysFltLampCount
=
0U
;
}
if
((
Get_CAN_CH0_ID_220_Sig_VCU_ChgMode
()
==
1U
)
&&
(
g_VCUChgModeStatus
==
0U
))
{
if
(
g_VCUChgModeCount
<
3U
)
{
g_VCUChgModeCount
++
;
}
}
else
if
((
Get_CAN_CH0_ID_220_Sig_VCU_ChgMode
()
==
0U
)
&&
(
g_VCUChgModeStatus
==
1U
))
{
if
(
g_VCUChgModeCount
<
3U
)
{
g_VCUChgModeCount
++
;
}
}
else
{
g_VCUChgModeCount
=
0U
;
}
#endif
}
...
...
@@ -686,6 +718,7 @@ void CAN_0x17A_Receive(uint8_t CopyData [])
void
CAN_0x18E_Lost_CallBack
(
uint8_t
CopyData
[])
{
Fuel
.
FuelStatusCount
=
0U
;
Fuel
.
FuelValidCount
=
0U
;
}
void
CAN_0x225_Lost_CallBack
(
uint8_t
CopyData
[])
...
...
Firmware/Source/Application/Data_Fuel/Data_Fuel.c
View file @
b099cba6
...
...
@@ -9,6 +9,7 @@ void Data_Fuel_KL30_Init(void)
Fuel
.
FuelSegDis
=
0U
;
Fuel
.
FuelStatusCount
=
0U
;
Fuel
.
FuelValid
=
0U
;
Fuel
.
FuelValidCount
=
0U
;
}
void
Data_Fuel_KL15_Init
(
void
)
...
...
@@ -17,6 +18,7 @@ void Data_Fuel_KL15_Init(void)
Fuel
.
FuelSegDis
=
0U
;
Fuel
.
FuelStatusCount
=
0U
;
Fuel
.
FuelValid
=
0U
;
Fuel
.
FuelValidCount
=
0U
;
}
void
Data_Fuel_Service
(
void
)
...
...
Firmware/Source/Application/Data_Fuel/Data_Fuel.h
View file @
b099cba6
...
...
@@ -10,6 +10,7 @@ typedef struct //__attribute__((aligned(4)))
uint8_t
FuelSeg
;
//燃油格数
uint8_t
FuelSegDis
;
//燃油显示格数
uint8_t
FuelValid
;
//燃油有效状态
uint8_t
FuelValidCount
;
//燃油有效状态计数
uint8_t
FuelStatusCount
;
/*燃油状态计数*/
}
FuelStruct_st_t
;
...
...
Firmware/Source/Application/Data_Soc/Data_Soc.c
View file @
b099cba6
...
...
@@ -400,12 +400,18 @@ static void Data_Soc_DisplayEffect_Service(void)
else
if
(
Get_CAN_Power_State
()
==
KEY_OFF
)
{
Soc
.
Valid1
=
0U
;
SocPoweroffTime
=
0U
;
}
else
{
SocPoweroffTime
=
0U
;
}
}
else
{
g_SOCChargingState
=
0U
;
SocPoweroffTime
=
0U
;
if
(
Get_CAN_Power_State
()
==
KEY_ACC
)
{
Soc
.
Dis_Seg1
=
Soc
.
Act_Seg1
;
...
...
Firmware/Source/Application/Driving_Information/Data_Time.c
View file @
b099cba6
...
...
@@ -18,6 +18,7 @@ void Data_Time_KL30_Init(void)
u16EngineTimeCount
=
0U
;
g_u8ID339flag
=
0U
;
g_u8SixHoursCompensationFlag
=
1U
;
g_u8TYWClearEepromFlag
=
0U
;
}
void
Data_Time_KL15_Init
(
void
)
...
...
@@ -28,6 +29,7 @@ void Data_Time_KL15_Init(void)
u16EngineTimeCount
=
0U
;
g_u8ID339flag
=
0U
;
g_u8SixHoursCompensationFlag
=
1U
;
g_u8TYWClearEepromFlag
=
0U
;
#if (PART_NUMBER == G54_A01)
for
(
uint8_t
i
=
0U
;
i
<
3U
;
i
++
)
{
...
...
@@ -215,6 +217,61 @@ void Single_Working_Hours_Count(void)
#endif
}
void
TYW_Clear_Eeprom_Service
(
void
)
{
#if (PART_NUMBER == RMR42E_60)
uint8_t
u8MBMS_StatBattChargeState
=
0
;
uint8_t
u8MBMS_StatBattWorkState
=
0
;
uint8_t
u8BMCU_BladeSpeedGear
=
0
;
uint16_t
u16MMCU_AccumulatedWorkHours
=
0
;
if
(
Get_CAN_Power_State
()
==
READY
)
{
if
((
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18203220_Msg
))
==
CAN_SIG_NORMAL
)
&&
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x157_Msg
))
==
CAN_SIG_NORMAL
)
&&
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x339_Msg
))
==
CAN_SIG_NORMAL
))
{
u8MBMS_StatBattChargeState
=
Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattChargeState
();
u8MBMS_StatBattWorkState
=
Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState
();
u16MMCU_AccumulatedWorkHours
=
Get_CAN_CH0_ID_339_Sig_MMCU_AccumulatedWorkHours
();
u8BMCU_BladeSpeedGear
=
Get_CAN_CH0_ID_157_Sig_BMCU_BladeSpeedGear
();
if
((
u8MBMS_StatBattChargeState
==
0x7U
)
&&
(
u8MBMS_StatBattWorkState
==
0xfU
)
&&
(
u8BMCU_BladeSpeedGear
==
0x7U
)
&&
(
u16MMCU_AccumulatedWorkHours
>=
60000UL
))
{
g_u8TYWClearEepromFlag
=
1
;
}
else
{
g_u8TYWClearEepromFlag
=
0
;
}
}
else
{
g_u8TYWClearEepromFlag
=
0
;
}
}
else
{
g_u8TYWClearEepromFlag
=
0
;
}
#else
if
((
Get_CAN_CH0_ID_161_Sig_MBMS_FaultNum
()
==
0xFEDCU
)
&&
(
Get_CAN_CH0_ID_38E_Sig_BMCU_FaultCode
()
==
0xABCDU
)
&&
(
Get_CAN_CH0_ID_234_Sig_EMS_FaultCode
()
==
0xBCDEU
)
&&
(
Get_CAN_CH0_ID_22A_Sig_GCU_FaultCode
()
==
0x8888U
))
{
g_u8TYWClearEepromFlag
=
1
;
}
#endif
}
void
TYW_RESET_TIME
(
void
)
{
uint32_t
Clear_EE
[
1
]
=
{
0
};
if
(
g_u8TYWClearEepromFlag
==
1
)
{
g_u8TYWClearEepromFlag
=
2
;
Clear_EE
[
0
]
=
0
;
eeprom_WriteRecord
(
EEPROM_BLOCK_00
,
(
uint8_t
*
)
&
Clear_EE
,
4
);
}
}
/******************************************************************************
函数名:Get_SingleHour_Display
功 能:获取单次工作时长小时数函数
...
...
Firmware/Source/Application/Driving_Information/Data_Time.h
View file @
b099cba6
...
...
@@ -32,5 +32,7 @@ extern uint8_t Get_Single_Working_Hours_Status(void);
extern
uint32_t
Get_Total_Working_Hours
(
void
);
extern
uint8_t
Get_Clock_All_lenth
(
void
);
extern
void
TYW_Clear_Eeprom_Service
(
void
);
extern
void
TYW_RESET_TIME
(
void
);
#endif
Firmware/Source/Application/GPIO_USER/GpioUser.c
View file @
b099cba6
...
...
@@ -53,10 +53,10 @@ void Gpio_Init(_GpioUser_Enum InitMode)
RTE_GPIO_Config
(
RTE_GPIO_PORT05_PIN04
,
GpioOut_Low
);
//空
RTE_GPIO_Config
(
RTE_GPIO_PORT05_PIN05
,
GpioOut_Low
);
//空
RTE_GPIO_Config
(
RTE_GPIO_PORT06_PIN00
,
GpioOut_Low
);
//存储SCL
RTE_GPIO_Config
(
RTE_GPIO_PORT06_PIN01
,
GpioOut_Low
);
//存储SDA
RTE_GPIO_Config
(
RTE_GPIO_PORT06_PIN02
,
GpioOut_Low
);
//SCL_MCU
RTE_GPIO_Config
(
RTE_GPIO_PORT06_PIN03
,
GpioOut_Low
);
//SDA_MCU
RTE_GPIO_Config
(
RTE_GPIO_PORT06_PIN00
,
RTE_GPIO_DIR_IN
);
//存储SCL
RTE_GPIO_Config
(
RTE_GPIO_PORT06_PIN01
,
RTE_GPIO_DIR_IN
);
//存储SDA
RTE_GPIO_Config
(
RTE_GPIO_PORT06_PIN02
,
RTE_GPIO_DIR_IN
);
//SCL_MCU
RTE_GPIO_Config
(
RTE_GPIO_PORT06_PIN03
,
RTE_GPIO_DIR_IN
);
//SDA_MCU
RTE_GPIO_Config
(
RTE_GPIO_PORT07_PIN00
,
RTE_GPIO_DIR_IN
);
//段码SPI20-SCL-2
RTE_GPIO_Config
(
RTE_GPIO_PORT07_PIN01
,
RTE_GPIO_DIR_IN
);
//段码SPI20-CSB-2
...
...
Firmware/Source/Application/GUI_Display/GUI_Display.c
View file @
b099cba6
...
...
@@ -8,44 +8,6 @@ uint8_t Charge_OFF_Flag = 0;
void
Clear_Bu98_Conditions
(
DoNot_Close_Seg_en_t
closeType
);
void
TYW_Clear_Eeprom_Service
(
void
)
{
#if (PART_NUMBER == RMR42E_60)
uint8_t
u8MBMS_StatBattChargeState
=
0
;
uint8_t
u8MBMS_StatBattWorkState
=
0
;
uint8_t
u8BMCU_BladeSpeedGear
=
0
;
uint16_t
u16MMCU_AccumulatedWorkHours
=
0
;
if
(
Get_CAN_Power_State
()
==
READY
)
{
if
((
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18203220_Msg
))
==
CAN_SIG_NORMAL
)
&&
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x157_Msg
))
==
CAN_SIG_NORMAL
)
&&
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x339_Msg
))
==
CAN_SIG_NORMAL
))
{
u8MBMS_StatBattChargeState
=
Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattChargeState
();
u8MBMS_StatBattWorkState
=
Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState
();
u16MMCU_AccumulatedWorkHours
=
Get_CAN_CH0_ID_339_Sig_MMCU_AccumulatedWorkHours
();
u8BMCU_BladeSpeedGear
=
Get_CAN_CH0_ID_157_Sig_BMCU_BladeSpeedGear
();
if
((
u8MBMS_StatBattChargeState
==
0x7U
)
&&
(
u8MBMS_StatBattWorkState
==
0xfU
)
&&
(
u8BMCU_BladeSpeedGear
==
0x7U
)
&&
(
u16MMCU_AccumulatedWorkHours
>=
60000UL
))
{
g_u8TYWClearEepromFlag
=
1
;
}
else
{
g_u8TYWClearEepromFlag
=
0
;
}
}
else
{
g_u8TYWClearEepromFlag
=
0
;
}
}
else
{
g_u8TYWClearEepromFlag
=
0
;
}
#else
#endif
}
void
Gauge_Power_SOC_pull_Display
(
void
)
{
uint8_t
u8Soc1Seg
=
Get_CAN_Num_MBMS_Soc_1_Grid
();
...
...
@@ -183,10 +145,16 @@ void Clear_Bu98_Conditions(DoNot_Close_Seg_en_t closeType)
{
for
(
i
=
0
;
i
<
BU98R10_DDRAM_SIZE
;
i
++
)
{
if
(
i
==
74U
)
if
(
i
==
74U
)
{
transitionData
=
((
BU98R10Chip0DDRAM
.
Byte
[
i
]
>>
4U
)
&
0xFU
);
BU98R10Chip0DDRAM
.
Byte
[
i
]
=
((
transitionData
<<
4U
)
+
0
);
transitionData
=
0
;
}
else
if
(
i
==
43U
)
{
transitionData
=
((
BU98R10Chip0DDRAM
.
Byte
[
75
]
>>
4U
)
&
0xFU
);
BU98R10Chip0DDRAM
.
Byte
[
75
]
=
((
transitionData
<<
4U
)
+
0
)
;
transitionData
=
((
BU98R10Chip0DDRAM
.
Byte
[
i
]
)
&
0xFU
);
BU98R10Chip0DDRAM
.
Byte
[
i
]
=
transitionData
;
transitionData
=
0
;
}
else
...
...
@@ -196,8 +164,8 @@ void Clear_Bu98_Conditions(DoNot_Close_Seg_en_t closeType)
if
(
i
==
46U
)
{
transitionData
=
((
BU98R10Chip1DDRAM
.
Byte
[
46
])
&
0xFU
);
BU98R10Chip1DDRAM
.
Byte
[
46
]
=
transitionData
;
transitionData
=
((
BU98R10Chip1DDRAM
.
Byte
[
i
])
&
0xFU
);
BU98R10Chip1DDRAM
.
Byte
[
i
]
=
transitionData
;
transitionData
=
0
;
}
else
...
...
@@ -216,6 +184,12 @@ void Clear_Bu98_Conditions(DoNot_Close_Seg_en_t closeType)
BU98R10Chip0DDRAM
.
Byte
[
i
]
=
((
transitionData
<<
4U
)
+
0
);
transitionData
=
0
;
}
else
if
(
i
==
43U
)
{
transitionData
=
((
BU98R10Chip0DDRAM
.
Byte
[
i
])
&
0xFU
);
BU98R10Chip0DDRAM
.
Byte
[
i
]
=
transitionData
;
transitionData
=
0
;
}
else
if
((
i
==
29U
)
||
(
i
==
30U
)
||
(
i
==
31U
)
||
(
i
==
32U
)
||
(
i
==
33U
)
||
(
i
==
34U
)
||
(
i
==
35U
)
||
(
i
==
60U
)
||
(
i
==
67U
)
||
(
i
==
68U
)
||
(
i
==
71U
)
||
(
i
==
72U
)
||
(
i
==
73U
))
{
...
...
@@ -228,8 +202,8 @@ void Clear_Bu98_Conditions(DoNot_Close_Seg_en_t closeType)
if
(
i
==
46U
)
{
transitionData
=
((
BU98R10Chip1DDRAM
.
Byte
[
46
])
&
0xFU
);
BU98R10Chip1DDRAM
.
Byte
[
46
]
=
transitionData
;
transitionData
=
((
BU98R10Chip1DDRAM
.
Byte
[
i
])
&
0xFU
);
BU98R10Chip1DDRAM
.
Byte
[
i
]
=
transitionData
;
transitionData
=
0
;
}
else
...
...
@@ -260,9 +234,10 @@ void Gauge_Service(void)
{
if
((
Get_CAN_Power_State
()
!=
PKEY_ON
)
&&
(
Get_CAN_Power_State
()
!=
KEY_OFF
)
&&
(
Get_CAN_Power_State
()
!=
POWER_CHECK_NULL
))
{
if
(
g_u8TYWClearEepromFlag
>=
1
)
if
(
(
g_u8TYWClearEepromFlag
>=
1
)
&&
(
Common_GetIgnOnTime
()
>
1500
)
)
{
TYW_RESET_TIME
();
Check_SEG_Display
();
}
else
{
...
...
@@ -332,7 +307,7 @@ void Gauge_Service(void)
}
for
(
i
=
0
;
i
<
LampCh0_MAX
;
i
++
)
{
if
((
i
==
LampCh0_08_Battery_Charging_W
)
||
(
i
==
LampCh0_32_Charging_Connection_R
))
if
((
i
==
LampCh0_08_Battery_Charging_W
)
||
(
i
==
LampCh0_32_Charging_Connection_R
)
||
(
i
==
LampCh0_19_Fault_Codes_W
)
)
{
;
}
...
...
@@ -430,14 +405,3 @@ void Checkself_LED_Display(void)
}
void
TYW_RESET_TIME
(
void
)
{
uint32_t
Clear_EE
[
1
]
=
{
0
};
if
(
g_u8TYWClearEepromFlag
==
1
)
{
g_u8TYWClearEepromFlag
=
2
;
Clear_EE
[
0
]
=
0
;
eeprom_WriteRecord
(
EEPROM_BLOCK_00
,
(
uint8_t
*
)
&
Clear_EE
,
4
);
}
Check_SEG_Display
();
}
Firmware/Source/Application/GUI_Display/GUI_Display.h
View file @
b099cba6
...
...
@@ -66,6 +66,4 @@ void Checkself_LED_Display(void);
uint8_t
Get_Clock_All_lenth
(
void
);
uint8_t
Get_CAN_Num_SBMS_Soc_2_Grid
(
void
);
uint8_t
Get_CAN_Num_MBMS_Soc_1_Grid
(
void
);
void
TYW_Clear_Eeprom_Service
(
void
);
void
TYW_RESET_TIME
(
void
);
#endif
Firmware/Source/Application/SEG_DISPLAY/SEG_DISPLAY.c
View file @
b099cba6
This diff is collapsed.
Click to expand it.
Firmware/Source/Component/BU98R10/BU98R10.c
View file @
b099cba6
...
...
@@ -14,6 +14,8 @@
#define BU98R10_NOP_TIME 5U
static
uint16_t
BU98R10ResetCount
=
0
;
uint8_t
BU98R10_CHIP0_GET_SD_LEVEL
(
void
);
uint8_t
BU98R10_CHIP0_GET_SD_LEVEL
(
void
)
{
...
...
@@ -280,6 +282,7 @@ uint32_t u32BU98R10ForcedUpdate = 0UL;
void
BU98R10_Init
(
void
)
{
uint8_t
i
;
BU98R10ResetCount
=
0
;
#if BU98R10_WRITE_AT_SAME_TIME
#if BU98R10_COLORFUL_LCD_MODE
...
...
@@ -563,6 +566,88 @@ void BU98R10_Init(void)
#endif
}
/*****************************************************************************************************
* @brief BU98R10_Reset
*
* @version 0.1
* @author (kaiwen.jiang@hljtyw.com)
* @date 2024-11-07
* @copyright Copyright (c) 2024
*
* 1s调用一次
*****************************************************************************************************/
void
BU98R10_Reset
(
void
)
{
// uint8_t i;
/* IC模式复位 */
BU98R10_0_Command_Write
(
BU98R10_CMD_ICSET
|
BU98R10_PAR_ICSET_RGB
);
BU98R10_1_Command_Write
(
BU98R10_CMD_ICSET
|
BU98R10_PAR_ICSET_RGB
);
/* 驱动控制复位 */
BU98R10_0_Command_Write
(
BU98R10_CMD_DRVCTRL
|
BU98R10_PAR_DRVCTRL_NORMAL
);
BU98R10_1_Command_Write
(
BU98R10_CMD_DRVCTRL
|
BU98R10_PAR_DRVCTRL_NORMAL
);
/* 设置段码频率,0x98是指令,0x08是值(120hz) */
BU98R10_0_Command_Write
(
BU98R10_CMD_FREQ
);
BU98R10_0_Data_Write
(
BU98R10_FRAME_FREQ
);
BU98R10_1_Command_Write
(
BU98R10_CMD_FREQ
);
BU98R10_1_Data_Write
(
BU98R10_FRAME_FREQ
);
/* LED控制 */
// BU98R10_0_Command_Write(BU98R10_CMD_LED_CTRL);
// BU98R10_0_Data_Write(0x12u);
/* 定时控制--R段 */
// BU98R10_0_Command_Write(BU98R10_CMD_SEG_R);
// BU98R10_0_Data_Write(BU98R10_REG_SEG_R);
/* 定时控制--G段 */
// BU98R10_0_Command_Write(BU98R10_CMD_SEG_G);
// BU98R10_0_Data_Write(BU98R10_REG_SEG_G);
/* 定时控制--B段 */
// BU98R10_0_Command_Write(BU98R10_CMD_SEG_B);
// BU98R10_0_Data_Write(BU98R10_REG_SEG_B);
/**< 灰度------------------------------------------------- */
// BU98R10_All_Command_Write(BU98R10_CMD_LED_STARTR);
// BU98R10_All_Data_Write(BU98R10_LRS, BU98R10_LRS);
// BU98R10_All_Command_Write(BU98R10_CMD_LED_STARTG);
// BU98R10_All_Data_Write(BU98R10_LGS, BU98R10_LGS);
// BU98R10_All_Command_Write(BU98R10_CMD_LED_STARTB);
// BU98R10_All_Data_Write(BU98R10_LBS, BU98R10_LBS);
// BU98R10_All_Command_Write(BU98R10_CMD_LED_WIDTHR);
// BU98R10_All_Data_Write(BU98R10_LRW, BU98R10_LRW);
// BU98R10_All_Command_Write(BU98R10_CMD_LED_WIDTHG);
// BU98R10_All_Data_Write(BU98R10_LGW, BU98R10_LGW);
// BU98R10_All_Command_Write(BU98R10_CMD_LED_WIDTHB);
// BU98R10_All_Data_Write(BU98R10_LBW, BU98R10_LBW);
/**< 灰度------------------------------------------------- */
/* 设置RAM地址 */
// BU98R10_0_Command_Write(BU98R10_CMD_ADSET);
// BU98R10_0_Data_Write(0x00u);
/* 写入数据 */
// BU98R10_All_Command_Write(BU98R10_CMD_DATWR);
// for (i = 0; i < BU98R10_DDRAM_SIZE; i++)
// {
// BU98R10_All_Data_Write(BU98R10Chip0DDRAMBackup.Byte[i], BU98R10Chip1DDRAMBackup.Byte[i]);
// }
/* 正常显示模式 */
BU98R10_0_Command_Write
(
BU98R10_CMD_DISPON
);
BU98R10_1_Command_Write
(
BU98R10_CMD_DISPON
);
}
void
BU98R10_Shutdown
(
void
)
{
#if BU98R10_WRITE_AT_SAME_TIME
...
...
@@ -581,6 +666,19 @@ void BU98R10_Shutdown(void)
#define BU98R10_FORCED_SEG_NUM 2U
void
BU98R10_Update_Request
(
void
)
{
if
(
BU98R10ResetCount
>=
100
)
{
if
(
BU98R10Update
.
En
==
0
)
{
BU98R10_Reset
();
BU98R10ResetCount
=
0u
;
}
}
else
{
BU98R10ResetCount
++
;
}
if
(
BU98R10Update
.
En
==
0
)
{
if
(
u32BU98R10ForcedUpdate
<=
(
BU98R10_DDRAM_SIZE
-
BU98R10_FORCED_SEG_NUM
))
...
...
Firmware/Source/Component/Telltales/Telltales_user.c
View file @
b099cba6
...
...
@@ -90,6 +90,8 @@ __align(4) uint8_t g_BmsFltStatus[2] = {0U,0U};
__align
(
4
)
uint8_t
g_BmsFltCount
[
2
]
=
{
0U
,
0U
};
uint8_t
g_TOTALSigChargeStatus
=
0U
;
uint8_t
g_TOTALSigChargeCount
=
0U
;
uint8_t
g_VCUChgModeStatus
=
0U
;
uint8_t
g_VCUChgModeCount
=
0U
;
const
LED_Attribute_st
LED_Attribute
[
LED_Max
]
=
{
/* 指示灯索引 是否自检 外部信号自检 工作电源状态 自检开始时间 自检持续时间 指示灯点亮条件 指示灯执行函数 */
...
...
@@ -114,7 +116,7 @@ const LED_Attribute_st LED_Attribute[LED_Max] =
{
em_LED_Tire_pressure_R_W
,
NoSelfCheck
,
ExterNalCheck
,
LED_IGN_ON
,
0u
,
1500ul
,
LED_Tire_pressure_R_Judgement
,
LED_Tire_pressure_R_Execution
},
{
em_LED_Cutterhead_Gear_W
,
NoSelfCheck
,
ExterNalCheck
,
LED_IGN_ON
,
0u
,
1500ul
,
LED_Cutterhead_Gear_Judgement
,
LED_Cutterhead_Gear_Execution
},
{
em_LED_Working_Hours_One_W
,
NoSelfCheck
,
ExterNalCheck
,
LED_IGN_ON
,
0u
,
1500ul
,
LED_Working_Hours_One_Judgement
,
LED_Working_Hours_One_Execution
},
{
em_LED_Fault_Codes_W
,
NoSelfCheck
,
ExterNalCheck
,
LED_IGN_ON
,
0u
,
1500ul
,
LED_Fault_Codes_Judgement
,
LED_Fault_Codes_Execution
},
{
em_LED_Fault_Codes_W
,
NoSelfCheck
,
ExterNalCheck
,
LED_IGN_ON
_OFF
,
0u
,
1500ul
,
LED_Fault_Codes_Judgement
,
LED_Fault_Codes_Execution
},
{
em_LED_System_Indicator_R
,
SelfCheck
,
NoExterNalCheck
,
LED_IGN_ON
,
0u
,
1500ul
,
LED_SystIndicator_R_Judgement
,
LED_SystIndicator_R_Execution
},
{
em_LED_P_GEAR_G
,
NoSelfCheck
,
ExterNalCheck
,
LED_IGN_ON
,
0u
,
1500ul
,
LED_P_GEAR_G_Judgement
,
LED_P_GEAR_G_Execution
},
{
em_LED_Fuel_Alarm_W
,
NoSelfCheck
,
NoExterNalCheck
,
LED_IGN_ON
,
0u
,
1500ul
,
LED_Fuel_Alarm_W_Judgement
,
LED_Fuel_Alarm_W_Execution
},
...
...
@@ -156,6 +158,8 @@ void Telltales_Init(void)
g_SysFltLampCount
=
0U
;
g_TOTALSigChargeStatus
=
0U
;
g_TOTALSigChargeCount
=
0U
;
g_VCUChgModeStatus
=
0U
;
g_VCUChgModeCount
=
0U
;
Telltales_KL30_Wakeup_Init
(
Tel_Mem
,
LED_Attribute
,
&
m_ExtPara
);
}
...
...
@@ -708,15 +712,15 @@ static void LED_Cutterhead_Switch_Execution(Tellib_uint16_t led_status)
}
static
Tellib_uint16_t
LED_GEAR_Judgement
(
void
)
{
Tellib_uint16_t
LED_STATE
=
0u
;
if
((
Charge_OFF_Flag
==
0
)
&&
(
System_Indicator_CANFlag
!=
1
)
&&
(
Get_CAN_Power_State
()
!=
POWER_CHECK_NULL
))
{
LED_STATE
=
1
;
}
else
{
LED_STATE
=
0
;
}
//
Tellib_uint16_t LED_STATE = 0u;
//
if((Charge_OFF_Flag == 0) && (System_Indicator_CANFlag != 1) && (Get_CAN_Power_State() != POWER_CHECK_NULL))
//
{
//
LED_STATE = 1;
//
}
//
else
//
{
//
LED_STATE = 0;
//
}
}
static
void
LED_GEAR_Execution
(
Tellib_uint16_t
led_status
)
{
...
...
@@ -992,9 +996,31 @@ static Tellib_uint16_t LED_Fault_Codes_Judgement(void)
{
Tellib_uint16_t
LED_STATE
=
0u
;
#if (PART_NUMBER == G54_A01)
if
(
Get_
FaultCode_Valid
()
==
1U
)
if
(
Get_
CAN_Power_State
()
==
KEY_ACC
)
{
LED_STATE
=
1U
;
if
(
Get_FaultCode_Valid
()
==
1U
)
{
LED_STATE
=
1U
;
}
else
{
LED_STATE
=
0U
;
}
}
else
if
(
Get_CAN_Power_State
()
==
PKEY_ON
)
{
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x220_Msg
))
==
CAN_SIG_LOST
)
{
LED_STATE
=
1U
;
}
else
if
((
Get_CAN_CH0_ID_220_Sig_VCU_KeySts
()
==
0U
)
&&
(
Get_CAN_CH0_ID_220_Sig_VCU_ChgMode
()
==
0U
))
{
LED_STATE
=
1U
;
}
else
{
LED_STATE
=
0U
;
}
}
else
{
...
...
@@ -1008,12 +1034,18 @@ static void LED_Fault_Codes_Execution(Tellib_uint16_t led_status)
if
(
led_status
==
1u
)
{
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_19_Fault_Codes_W
,
LED_ON
);
// SEG_SET_LED_STS(1,1);
if
(
Get_CAN_Power_State
()
==
PKEY_ON
)
{
SEG_SET_Fault_Code_Spanner
(
1U
,
0U
,
1U
);
}
}
else
{
LED_Driver_Channel_Set
(
LampChannel_0
,
LampCh0_19_Fault_Codes_W
,
LED_OFF
);
// SEG_SET_LED_STS(1,0);
if
((
Get_CAN_Power_State
()
==
PKEY_ON
)
||
(
Get_CAN_Power_State
()
==
KEY_OFF
))
{
SEG_SET_Fault_Code_Spanner
(
0U
,
0U
,
0U
);
}
}
}
...
...
@@ -1150,27 +1182,40 @@ static Tellib_uint16_t LED_Charging_Connection_R_Judgement(void)
LED_STATE
=
0
;
}
#else
Tellib_uint8_t
Signal1
=
Get_CAN_CH0_ID_220_Sig_VCU_ChgMode
();
//
Tellib_uint8_t Signal1 = Get_CAN_CH0_ID_220_Sig_VCU_ChgMode();
if
(
Signal1
==
0x1U
)
{
if
((
g_TOTALSigChargeStatus
==
0U
)
&&
(
g_TOTALSigChargeCount
>=
3U
))
{
g_TOTALSigChargeStatus
=
1U
;
g_TOTALSigChargeCount
=
0U
;
}
else
if
((
g_TOTALSigChargeStatus
==
1U
)
&&
(
g_TOTALSigChargeCount
>=
3U
))
{
g_TOTALSigChargeStatus
=
0U
;
g_TOTALSigChargeCount
=
0U
;
}
// if (Signal1 == 0x1U)
// {
// if ((g_TOTALSigChargeStatus == 0U) && (g_TOTALSigChargeCount >= 3U))
// {
// g_TOTALSigChargeStatus = 1U;
// g_TOTALSigChargeCount = 0U;
// }
// else if ((g_TOTALSigChargeStatus == 1U) && (g_TOTALSigChargeCount >= 3U))
// {
// g_TOTALSigChargeStatus = 0U;
// g_TOTALSigChargeCount = 0U;
// }
// LED_STATE = (Tellib_uint16_t) g_TOTALSigChargeStatus;
// }
// else
// {
// LED_STATE = 0U;
// }
LED_STATE
=
(
Tellib_uint16_t
)
g_TOTALSigChargeStatus
;
if
((
g_VCUChgModeStatus
==
0U
)
&&
(
g_VCUChgModeCount
>=
3U
))
{
g_VCUChgModeStatus
=
1U
;
g_VCUChgModeCount
=
0U
;
}
else
else
if
((
g_VCUChgModeStatus
==
1U
)
&&
(
g_VCUChgModeCount
>=
3U
))
{
LED_STATE
=
0U
;
g_VCUChgModeStatus
=
0U
;
g_VCUChgModeCount
=
0U
;
}
LED_STATE
=
(
Tellib_uint16_t
)
g_VCUChgModeStatus
;
#endif
...
...
Firmware/Source/Component/Telltales/Telltales_user.h
View file @
b099cba6
...
...
@@ -71,6 +71,8 @@ extern uint8_t g_BmsFltStatus[2];
extern
uint8_t
g_BmsFltCount
[
2
];
extern
uint8_t
g_TOTALSigChargeStatus
;
extern
uint8_t
g_TOTALSigChargeCount
;
extern
uint8_t
g_VCUChgModeStatus
;
extern
uint8_t
g_VCUChgModeCount
;
// extern Tellib_uint8_t Auto_Start_Stop ;
void
Telltales_Init
(
void
);
...
...
Firmware/Source/UDS/UDS_ISO14229_Services.h
View file @
b099cba6
...
...
@@ -310,13 +310,13 @@
#define CheckSumErr 7 // Checksum Error
#define UnknownPartID 8 // Unknown Part ID
#define SWV 0x10
3
// 0x100 = 1.00 software version 软件版本号
#define HWV 0x1
0
0 // 0x100 = 1.00 hardware version 硬件版本号
#define SWV 0x10
4
// 0x100 = 1.00 software version 软件版本号
#define HWV 0x1
1
0 // 0x100 = 1.00 hardware version 硬件版本号
#define BTV 0x103 // 0x100 = 1.00 bootloader version boot程序版本号
#define INTLV 0x10
3
// 0x100 = 1.00 internal version 内部版本号
#define INTLV 0x10
4
// 0x100 = 1.00 internal version 内部版本号
#define PROG_Y 0x25 // 0x24 = 2024年, program year
#define PROG_M 0x0
4
// 0x03 = 3月, program month
#define PROG_D 0x
22
// 0x19 = 19日, program day
#define PROG_M 0x0
6
// 0x03 = 3月, program month
#define PROG_D 0x
06
// 0x19 = 19日, program day
/******************************************************************************
Bootloader Variable
...
...
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