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
9a6afa98
Commit
9a6afa98
authored
Sep 10, 2024
by
陈家乐
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://tyw-server.synology.me:12345/ty/tianying_ty100
into CJL
parents
6cc3b591
191e0e58
Changes
34
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
1883 additions
and
402 deletions
+1883
-402
TianYing.uvprojx
...ware/Project/Cmsemicon/BAT32A239/MDK_ARM/TianYing.uvprojx
+0
-10
TianYing200.BAT
Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/TianYing200.BAT
+4
-34
Application.h
Firmware/Source/Application/Application.h
+1
-1
Can_App.c
Firmware/Source/Application/CAN_User/Can_App.c
+1
-1
Can_App.h
Firmware/Source/Application/CAN_User/Can_App.h
+1
-1
Can_User.c
Firmware/Source/Application/CAN_User/Can_User.c
+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
+6
-6
Data_VSpeed.c
Firmware/Source/Application/Data_VSpeed/Data_VSpeed.c
+5
-5
Data_Voltage.h
Firmware/Source/Application/Data_Voltage/Data_Voltage.h
+1
-1
FaultCode.c
Firmware/Source/Application/FaultCode/FaultCode.c
+0
-225
FaultCode.h
Firmware/Source/Application/FaultCode/FaultCode.h
+0
-16
code.c
Firmware/Source/Application/FaultCode/code.c
+9
-9
code.h
Firmware/Source/Application/FaultCode/code.h
+3
-3
Data_Fuel.c
Firmware/Source/Application/Fuel/Data_Fuel.c
+1
-1
GUI_Display.c
Firmware/Source/Application/GUI_Display/GUI_Display.c
+11
-7
SEG_DISPLAY.c
Firmware/Source/Application/SEG_DISPLAY/SEG_DISPLAY.c
+4
-4
BU98R10.c
Firmware/Source/Component/BU98R10/BU98R10.c
+145
-42
BU98R10.h
Firmware/Source/Component/BU98R10/BU98R10.h
+1
-1
Key_user.c
Firmware/Source/Component/Key/Key_user.c
+1
-1
Service_Interval.c
...ware/Source/Component/Service_Interval/Service_Interval.c
+9
-7
RTE_GPIO.h
...are/Source/Device/Cmsemicon/BAT32A239/RTE/GPIO/RTE_GPIO.h
+1
-1
RTE_Tick_Timer_BAT32A239.c
...micon/BAT32A239/RTE/Tick_Timer/RTE_Tick_Timer_BAT32A239.c
+1
-1
UART_DEMO.c
...re/Source/Device/Cmsemicon/BAT32A239/RTE/UART/UART_DEMO.c
+1
-1
UART_DEMO.h
...re/Source/Device/Cmsemicon/BAT32A239/RTE/UART/UART_DEMO.h
+1
-1
Sys_Task_List.c
Firmware/Source/System/Sys_Task_List.c
+12
-14
UDS_ISO14229_Services.c
Firmware/Source/UDS/UDS_ISO14229_Services.c
+3
-3
UDS_ISO14229_Services.h
Firmware/Source/UDS/UDS_ISO14229_Services.h
+1
-0
TY200.080000b(ty)_BOOT变更记录.txt
..._Release/TY200.080000b(ty)/TY200.080000b(ty)_BOOT变更记录.txt
+9
-2
TY_TY200.080000b(ty)_Boot_B1.05_240910.hex
...00.080000b(ty)/TY_TY200.080000b(ty)_Boot_B1.05_240910.hex
+820
-0
TY200.080000b_BOOT变更记录.txt
...ity/Boot_Release/TY200.080000b/TY200.080000b_BOOT变更记录.txt
+9
-2
TY_TY200.080000b_Boot_B1.06_240910.hex
...ease/TY200.080000b/TY_TY200.080000b_Boot_B1.06_240910.hex
+820
-0
天鹰摩托功能规范V2.5_240818.docx
Firmware/utility/评审记录/天鹰摩托功能规范V2.5_240818.docx
+0
-0
天鹰软件审核记录.xlsx
Firmware/utility/评审记录/天鹰软件审核记录.xlsx
+0
-0
No files found.
Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/TianYing.uvprojx
View file @
9a6afa98
...
...
@@ -513,16 +513,6 @@
<FileType>
5
</FileType>
<FilePath>
..\..\..\..\Source\Application\Data_TPMS\Data_TPMS.h
</FilePath>
</File>
<File>
<FileName>
FaultCode.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\..\..\Source\Application\FaultCode\FaultCode.c
</FilePath>
</File>
<File>
<FileName>
FaultCode.h
</FileName>
<FileType>
5
</FileType>
<FilePath>
..\..\..\..\Source\Application\FaultCode\FaultCode.h
</FilePath>
</File>
<File>
<FileName>
Data_Voltage.c
</FileName>
<FileType>
1
</FileType>
...
...
Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/TianYing200.BAT
View file @
9a6afa98
SET PATH=C:\Keil_v5\ARM\ARMCC\Bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Users\tyw05\AppData\Local\Microsoft\WindowsApps;
SET ARMCC5_ASMOPT=--diag_suppress=9931
SET ARMCC5_CCOPT=--diag_suppress=9931
SET ARMCC5_LINKOPT=--diag_suppress=9931
SET CPU_TYPE=BAT32G139GK64FB
SET CPU_VENDOR=Cmsemicon
SET UV2_TARGET=TianYing200
...
...
@@ -15,7 +18,6 @@ SET CPU_CLOCK=0x00B71B00
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\can_user.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\can_app.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\data_tpms.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\faultcode.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\data_voltage.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\bluetooth.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\protocol_crc16.__i"
...
...
@@ -56,36 +58,4 @@ SET CPU_CLOCK=0x00B71B00
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\adc.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\can.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\cgc.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\cmp.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\dac.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\delay.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\dma.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\elc.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\epwm.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\flash.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\gpio.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\i2c.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\i2ca.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\interval.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\intp.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\key.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\pcbz.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\pga.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\rtc.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\sci_common.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\sspi.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\tim.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\tima.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\timb.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\timm.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\uart.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\wdt.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\isr.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\docan_iso15765.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\uds_iso14229_server.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\uds_iso14229_services.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\isr_bat32g139.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmAsm" --Via ".\objects\startup_bat32g139._ia"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\system_bat32g139.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmLink" --Via ".\Objects\TianYing.lnp"
"C:\Keil_v5\ARM\ARMCC\Bin\fromelf.exe" ".\Objects\TianYing.axf" --i32combined --output ".\Objects\TianYing.hex"
"C:\Keil
\ No newline at end of file
Firmware/Source/Application/Application.h
View file @
9a6afa98
...
...
@@ -17,7 +17,7 @@
#include "Data_Coolant/Data_Coolant.h"
#include "Data_TPMS/Data_TPMS.h"
#include "Data_Voltage/Data_Voltage.h"
#include "FaultCode/FaultCode.h"
#include "FaultCode/code.h"
#include "BLUETOOTH/BlueTooth.h"
#include "BLUETOOTH/Protocol_CRC16.h"
...
...
Firmware/Source/Application/CAN_User/Can_App.c
View file @
9a6afa98
...
...
@@ -83,7 +83,7 @@ void Can_Set_Buff_6EF(canlib_uint8_t CopyData[])
uint16_t
Espeed_tx
=
0
;
uint16_t
TripA_tx
=
0
;
Espeed_tx
=
Get_ActualEngineSpeed
()
/
100
;
TripA_tx
=
Data_Read_Trip
(
EM_TRIP_A
);
TripA_tx
=
(
uint16_t
)
Data_Read_Trip
(
EM_TRIP_A
);
p6EF
=
(
CANMsg6EFUnion
*
)
CopyData
;
if
(
p6EF
!=
(
void
*
)
0
)
{
...
...
Firmware/Source/Application/CAN_User/Can_App.h
View file @
9a6afa98
...
...
@@ -124,5 +124,5 @@ void Can_Set_Buff_6EF(canlib_uint8_t CopyData[]);
void
Can_Set_Buff_450
(
canlib_uint8_t
CopyData
[]);
void
Can_Set_Buff_580
(
canlib_uint8_t
CopyData
[]);
extern
void
CAN_TX_Count_Init
(
void
);
#endif
Firmware/Source/Application/CAN_User/Can_User.c
View file @
9a6afa98
...
...
@@ -219,7 +219,7 @@ void Can_Rx_Cak(CanTxRxMsg *Msg)
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
(
(
uint16_t
)(
Msg
->
Id
)
,
Msg
->
DLC
,
Msg
->
Data
);
}
}
/**
...
...
Firmware/Source/Application/Data_Coolant/Data_Coolant.c
View file @
9a6afa98
...
...
@@ -517,7 +517,7 @@ uint16_t GET_DataCoolantTempValueDisp(void)
}
uint16_t
GET_DataCoolantSegValue
(
void
)
{
return
(
u
32ColCurNum
)
/
100
;
return
(
u
int16_t
)((
u32ColCurNum
)
/
100
)
;
}
uint8_t
GET_DataCollantTempValueValid
(
void
)
{
...
...
Firmware/Source/Application/Data_TPMS/Data_TPMS.c
View file @
9a6afa98
...
...
@@ -563,8 +563,8 @@ uint16_t Get_Front_TPMS_Sig_Value (void)
//}
//else
{
value
=
TPMS
.
Front_Press_Value
+
50
;
value
=
value
/
100
;
//
value = TPMS.Front_Press_Value + 50;
value
=
(
uint16_t
)((
TPMS
.
Front_Press_Value
+
50
)
/
100
)
;
}
return
value
;
}
...
...
@@ -582,15 +582,15 @@ uint16_t Get_Rear_TPMS_Sig_Value (void)
//}
//else
{
value
=
TPMS
.
Rear_Press_Value
+
50
;
value
=
value
/
100
;
//
value = TPMS.Rear_Press_Value + 50;
value
=
(
uint8_t
)((
TPMS
.
Rear_Press_Value
+
50
)
/
100
)
;
}
return
value
;
}
uint16_t
Get_Rear_TPMS_TX
(
void
)
{
uint16_t
value
=
0
;
value
=
Data_Bar_To_Psi
(
TPMS
.
Rear_Press_Value
)
/
100
;
value
=
(
uint16_t
)(
Data_Bar_To_Psi
(
TPMS
.
Rear_Press_Value
)
/
100
)
;
if
(
value
>
990
)
{
value
=
990
;
...
...
@@ -600,7 +600,7 @@ uint16_t Get_Rear_TPMS_TX (void)
uint16_t
Get_Front_TPMS_TX
(
void
)
{
uint16_t
value
=
0
;
value
=
Data_Bar_To_Psi
(
TPMS
.
Front_Press_Value
)
/
100
;
value
=
(
uint16_t
)(
Data_Bar_To_Psi
(
TPMS
.
Front_Press_Value
)
/
100
)
;
if
(
value
>
990
)
{
value
=
990
;
...
...
Firmware/Source/Application/Data_VSpeed/Data_VSpeed.c
View file @
9a6afa98
...
...
@@ -70,10 +70,10 @@ void Data_Vehicle_Speed_Processing_Service(void)
{
uint8_t
i
;
uint16_t
Delta
;
uint
32
_t
VSpeed
;
uint
16
_t
VSpeed
;
uint32_t
VSpeedCal
;
uint8_t
ESC_VehicleSpeedState
;
uint
32_t
Vehicle_Speed
;
uint
8_t
Vehicle_Speed
;
Vehicle_Speed
=
Get_CAN_CH0_ID_101_Sig_ECU_Vehicle_Speed
(
);
ESC_VehicleSpeedState
=
Get_CAN_CH0_ID_101_Sig_ECU_Vehicle_Speed_State
(
);
...
...
@@ -163,13 +163,13 @@ void Data_Vehicle_Speed_Processing_Service(void)
if
(
(
DataVSpeedTarget
>=
DataVSpeedHysteresis
)
||
(
DataVSpeedTarget
<
DATA_VSPEED_HYSTERESIS
)
)
{
DataVSpeedHysteresis
=
DataVSpeedTarget
;
DataVSpeedHysteresis
=
(
uint16_t
)
DataVSpeedTarget
;
}
else
{
if
(
DataVSpeedHysteresis
-
DataVSpeedTarget
>=
DATA_VSPEED_HYSTERESIS
)
{
DataVSpeedHysteresis
=
DataVSpeedTarget
;
DataVSpeedHysteresis
=
(
uint16_t
)
DataVSpeedTarget
;
}
}
...
...
@@ -444,7 +444,7 @@ uint16_t Get_DispVechileSpeed(void)
}
else
/* MILE */
{
Vspeed
=
Data_Km_To_Mile
(
DataVSpeedDisp
);
Vspeed
=
(
uint16_t
)
Data_Km_To_Mile
(
DataVSpeedDisp
);
if
(
Vspeed
>=
1230
)
{
Vspeed
=
1230
;
...
...
Firmware/Source/Application/Data_Voltage/Data_Voltage.h
View file @
9a6afa98
...
...
@@ -5,7 +5,7 @@
typedef
struct
{
uint
32
_t
Buffer
[
30
];
uint
8
_t
Buffer
[
30
];
uint8_t
Cnt
;
uint8_t
time
;
uint16_t
ResOpen_ActTimer
;
...
...
Firmware/Source/Application/FaultCode/FaultCode.c
deleted
100644 → 0
View file @
6cc3b591
#include "FaultCode\FaultCode.h"
#include "Application.h"
uint8_t
DTC_Amnt_Number
=
0
;
uint8_t
DTC_Amnt_Number_Count
=
0
;
uint8_t
FaultCode_Number
=
0
;
uint32_t
DTC_Data
[
FualtCodeMax
]
=
{
0
};
uint32_t
DTC_Data_Count
[
FualtCodeMax
]
=
{
0
};
uint32_t
FaultCode_Data
[
FualtCodeMax
]
=
{
0
};
uint32_t
u32Countbuf
=
0UL
;
void
Fault_Code_Receive
(
uint8_t
CopyData
[])
{
uint8_t
i
=
0
;
//ECU_FaultCode_Processing_Service();
}
uint8_t
FaultCode_Compare
(
uint32_t
FaultCode
,
uint32_t
*
CodeList
,
uint8_t
len
)
{
uint8_t
i
=
0
;
uint8_t
result
=
0
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
if
(
FaultCode
==
CodeList
[
i
])
{
result
=
1
;
}
}
return
result
;
}
static
void
Fault_Code_App_Swap
(
uint32_t
*
pData1
,
uint32_t
*
pData2
)
{
uint32_t
psw
;
if
((
*
pData1
)
>
(
*
pData2
))
{
psw
=
(
*
pData2
);
(
*
pData2
)
=
(
*
pData1
);
(
*
pData1
)
=
psw
;
}
}
static
void
Fault_Code_App_SortNByte
(
uint32_t
*
SortData
,
uint8_t
len
)
{
uint8_t
n
=
0
,
m
;
for
(;
n
<
len
-
1
;
n
++
)
{
for
(
m
=
n
+
1
;
m
<
len
;
m
++
)
{
Fault_Code_App_Swap
((
SortData
+
n
),
(
SortData
+
m
));
}
}
}
uint32_t
u32YZHDArray
[
200
];
uint32_t
u32YZHDArraycount
=
0
;
uint32_t
u32YZHDCount
=
0
;
void
ECU_FaultCode_Processing_Service
(
void
)
{
uint8_t
DTCH1
=
0
;
uint8_t
DTCM1
=
0
;
uint8_t
DTCH2
=
0
;
uint8_t
DTCM2
=
0
;
uint32_t
DTC1
=
0
;
uint32_t
DTC2
=
0
;
uint32_t
i
=
0
;
if
(
Common_Get_IG_Sts
()
==
COMMON_POWER_ON
)
{
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
CAN_CH0_ID_CAN_0x402_Msg_Count
)
==
CAN_SIG_LOST
)
{
memset
(
FaultCode_Data
,
0
,
FaultCode_Number
);
FaultCode_Number
=
0
;
}
else
{
u32YZHDCount
=
0
;
DTCH1
=
Get_CAN_CH0_ID_402_Sig_ECU_DTCH1
();
DTCM1
=
Get_CAN_CH0_ID_402_Sig_ECU_DTCM1
();
DTCH2
=
Get_CAN_CH0_ID_402_Sig_ECU_DTCH2
();
DTCM2
=
Get_CAN_CH0_ID_402_Sig_ECU_DTCM2
();
DTC_Amnt_Number
=
Get_CAN_CH0_ID_402_Sig_ECU_DTCAmnt
();
if
(((
DTCH1
&
0xF0
)
>>
4
)
>=
0xA
)
{
DTC1
|=
((
DTCH1
&
0xF0
)
>>
4
)
+
3
;
}
else
{
DTC1
|=
(
DTCH1
&
0xF0
)
>>
4
;
}
DTC1
<<=
8
;
if
((
DTCH1
&
0xF
)
>=
0xA
)
{
DTC1
|=
(
DTCH1
&
0xF
)
+
3
;
}
else
{
DTC1
|=
DTCH1
&
0xF
;
}
DTC1
<<=
8
;
if
(((
DTCM1
&
0xF0
)
>>
4
)
>=
0xA
)
{
DTC1
|=
((
DTCM1
&
0xF0
)
>>
4
)
+
3
;
}
else
{
DTC1
|=
(
DTCM1
&
0xF0
)
>>
4
;
}
DTC1
<<=
8
;
if
((
DTCM1
&
0xF
)
>=
0xA
)
{
DTC1
|=
(
DTCM1
&
0xF
)
+
3
;
}
else
{
DTC1
|=
DTCM1
&
0xF
;
}
if
(((
DTCH2
&
0xF0
)
>>
4
)
>=
0xA
)
{
DTC2
|=
((
DTCH2
&
0xF0
)
>>
4
)
+
3
;
}
else
{
DTC2
|=
(
DTCH2
&
0xF0
)
>>
4
;
}
DTC2
<<=
8
;
if
((
DTCH2
&
0xF
)
>=
0xA
)
{
DTC2
|=
(
DTCH2
&
0xF
)
+
3
;
}
else
{
DTC2
|=
DTCH2
&
0xF
;
}
DTC2
<<=
8
;
if
(((
DTCM2
&
0xF0
)
>>
4
)
>=
0xA
)
{
DTC2
|=
((
DTCM2
&
0xF0
)
>>
4
)
+
3
;
}
else
{
DTC2
|=
(
DTCM2
&
0xF0
)
>>
4
;
}
DTC2
<<=
8
;
if
((
DTCM2
&
0xF
)
>=
0xA
)
{
DTC2
|=
(
DTCM2
&
0xF
)
+
3
;
}
else
{
DTC2
|=
DTCM2
&
0xF
;
}
if
(
DTC_Amnt_Number
==
0
)
{
for
(
i
=
0
;
i
<
FualtCodeMax
;
i
++
)
{
FaultCode_Data
[
i
]
=
0
;
DTC_Data_Count
[
i
]
=
0
;
DTC_Data
[
i
]
=
0
;
}
DTC_Amnt_Number_Count
=
0
;
}
if
(
DTC_Amnt_Number_Count
<
DTC_Amnt_Number
)
{
if
((
DTC1
!=
0
)
&&
(
FaultCode_Compare
(
DTC1
,
&
DTC_Data_Count
[
0
],
DTC_Amnt_Number_Count
)
==
0
))
{
DTC_Data_Count
[
DTC_Amnt_Number_Count
]
=
DTC1
;
DTC_Amnt_Number_Count
++
;
Fault_Code_App_SortNByte
(
DTC_Data_Count
,
DTC_Amnt_Number_Count
);
}
}
if
(
DTC_Amnt_Number_Count
<
DTC_Amnt_Number
)
{
if
((
DTC2
!=
0
)
&&
(
FaultCode_Compare
(
DTC2
,
&
DTC_Data_Count
[
0
],
DTC_Amnt_Number_Count
)
==
0
))
{
DTC_Data_Count
[
DTC_Amnt_Number_Count
]
=
DTC2
;
DTC_Amnt_Number_Count
++
;
Fault_Code_App_SortNByte
(
DTC_Data_Count
,
DTC_Amnt_Number_Count
);
}
}
if
(
DTC_Amnt_Number_Count
>
DTC_Amnt_Number
)
{
for
(
i
=
0
;
i
<
FualtCodeMax
;
i
++
)
{
// FaultCode_Data[i] = 0;
DTC_Data_Count
[
i
]
=
0
;
DTC_Data
[
i
]
=
0
;
}
DTC_Amnt_Number_Count
=
0
;
}
if
(
DTC_Amnt_Number_Count
==
DTC_Amnt_Number
)
{
for
(
i
=
0
;
i
<
DTC_Amnt_Number_Count
;
i
++
)
{
DTC_Data
[
i
]
=
DTC_Data_Count
[
i
];
DTC_Data_Count
[
i
]
=
0
;
Fault_Code_App_SortNByte
(
DTC_Data
,
FaultCode_Number
);
}
FaultCode_Number
=
DTC_Amnt_Number
;
DTC_Amnt_Number_Count
=
0
;
for
(
i
=
0
;
i
<
FaultCode_Number
;
i
++
)
{
if
(
FaultCode_Data
[
i
]
!=
DTC_Data
[
i
])
{
FaultCode_Data
[
i
]
=
DTC_Data
[
i
];
Fault_Code_App_SortNByte
(
FaultCode_Data
,
FaultCode_Number
);
}
}
}
if
(
u32YZHDArraycount
<
200
)
{
u32YZHDArray
[
u32YZHDArraycount
++
]
=
u32YZHDCount
;
}
}
}
else
{
memset
(
FaultCode_Data
,
0
,
FaultCode_Number
);
FaultCode_Number
=
0
;
}
}
Firmware/Source/Application/FaultCode/FaultCode.h
deleted
100644 → 0
View file @
6cc3b591
#ifndef FAULTCODE_H__
#define FAULTCODE_H__
#include "Application.h"
#include "common.h"
#define FualtCodeMax 72
extern
uint32_t
FaultCode_Data
[
FualtCodeMax
]
;
extern
uint8_t
FaultCode_Number
;
uint8_t
FaultCode_Compare
(
uint32_t
FaultCode
,
uint32_t
*
CodeList
,
uint8_t
len
);
void
ECU_FaultCode_Processing_Service
(
void
);
//void Fault_Code_Sort(void);
extern
void
Fault_Code_Receive
(
uint8_t
CopyData
[]);
static
void
Fault_Code_App_SortNByte
(
uint32_t
*
SortData
,
uint8_t
len
);
static
void
Fault_Code_App_Swap
(
uint32_t
*
pData1
,
uint32_t
*
pData2
);
extern
uint32_t
u32YZHDCount
;
#endif
Firmware/Source/Application/FaultCode/code.c
View file @
9a6afa98
...
...
@@ -151,9 +151,9 @@ void FaultCode_Init(void)
stFaultCodetemp
[
i
].
u16FaultCodeCount
=
0
;
}
FaultCodeInit
.
callbacks
[
DTC1
]
=
Get_FaultCodeDtc1
;
FaultCodeInit
.
callbacks
[
DTC2
]
=
Get_FaultCodeDtc2
;
FaultCodeInit
.
callbacks
[
DTC3
]
=
NULL
;
FaultCodeInit
.
callbacks
[
DTC
_
1
]
=
Get_FaultCodeDtc1
;
FaultCodeInit
.
callbacks
[
DTC
_
2
]
=
Get_FaultCodeDtc2
;
FaultCodeInit
.
callbacks
[
DTC
_
3
]
=
NULL
;
FaultCodeInit
.
FaultCodeVaildCbk
=
Get_FaultCodeValid
;
FaultCodeInit
.
FaultCodeNumCbk
=
Get_FaultCodeNum
;
...
...
@@ -227,19 +227,19 @@ void FaultCode_Service(uint16_t Cycle)
uint32_t
tempFaultCode
=
0
;
uint16_t
Vaild
=
0
;
if
(
FaultCodeInit
.
callbacks
[
DTC1
]
!=
NULL
)
if
(
FaultCodeInit
.
callbacks
[
DTC
_
1
]
!=
NULL
)
{
Dtc1
=
FaultCodeInit
.
callbacks
[
DTC1
]();
Dtc1
=
FaultCodeInit
.
callbacks
[
DTC
_
1
]();
}
if
(
FaultCodeInit
.
callbacks
[
DTC2
]
!=
NULL
)
if
(
FaultCodeInit
.
callbacks
[
DTC
_
2
]
!=
NULL
)
{
Dtc2
=
FaultCodeInit
.
callbacks
[
DTC2
]();
Dtc2
=
FaultCodeInit
.
callbacks
[
DTC
_
2
]();
}
if
(
FaultCodeInit
.
callbacks
[
DTC3
]
!=
NULL
)
if
(
FaultCodeInit
.
callbacks
[
DTC
_
3
]
!=
NULL
)
{
Dtc3
=
FaultCodeInit
.
callbacks
[
DTC3
]();
Dtc3
=
FaultCodeInit
.
callbacks
[
DTC
_
3
]();
}
if
(
FaultCodeInit
.
FaultCodeVaildCbk
!=
NULL
)
...
...
Firmware/Source/Application/FaultCode/code.h
View file @
9a6afa98
...
...
@@ -18,9 +18,9 @@
typedef
enum
{
DTC1
,
DTC2
,
DTC3
,
DTC
_
1
,
DTC
_
2
,
DTC
_
3
,
NUM_FAULT_TYPES
,
}
FaultCodeType_Num
;
...
...
Firmware/Source/Application/Fuel/Data_Fuel.c
View file @
9a6afa98
...
...
@@ -115,7 +115,7 @@ void Fuel_R_Cal(uint8_t deltaTime)
{
temp32
+=
FuelData
[
i
];
}
FuelR
=
temp32
/
(
FUEL_CAL_END
-
FUEL_CAL_START
);
FuelR
=
(
uint16_t
)(
temp32
/
(
FUEL_CAL_END
-
FUEL_CAL_START
)
);
FuelDataCount
=
0
;
FuelADCompleteFlg
=
1
;
}
...
...
Firmware/Source/Application/GUI_Display/GUI_Display.c
View file @
9a6afa98
...
...
@@ -62,7 +62,7 @@ void Clear_Bu98(void)
}
}
uint8_t
u8VspeedCount
=
0
;
void
Gauge_Service
(
void
)
{
static
uint16_t
VSpeed_Count
=
0u
;
...
...
@@ -93,11 +93,7 @@ void Gauge_Service(void)
{
LED_Driver_Channel_Set
(
LampChannel_0
,
k
,
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_07_Screen_Time, LED_OFF);
//LED_Driver_Channel_Set(LampChannel_0, LampCh0_08_KMH, LED_OFF);
//LED_Driver_Channel_Set(LampChannel_0, LampCh0_09_MPH, LED_OFF);
}
}
else
...
...
@@ -112,8 +108,16 @@ void Gauge_Service(void)
// BU98R10Chip1DDRAM.Byte[i] = 0x77;
//}
if
(
u8VspeedCount
<
3
)
{
u8VspeedCount
++
;
}
else
{
u8VspeedCount
=
0
;
SEG_SET_VSpeed_NUM
(
1u
,
Get_DispVechileSpeed
(
)
/
10u
,
Get_Dis_KM_Unit
());
}
SEG_SET_VSpeed_NUM
(
1u
,
Get_DispVechileSpeed
(
)
/
10u
,
Get_Dis_KM_Unit
());
SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS
(
Get_Dis_KM_Unit
(),
Get_ODO_Value
()
/
10u
,
Get_Trip_Value
());
Gauge_Clock_Display
();
...
...
Firmware/Source/Application/SEG_DISPLAY/SEG_DISPLAY.c
View file @
9a6afa98
...
...
@@ -4490,7 +4490,7 @@ uint8_t check_SEG_step = 0;
/*仪表段码扫描函数*/
void
Check_SEG_Display
(
void
)
{
uint
32
_t
a
;
uint
8
_t
a
;
uint8_t
i
=
0
;
a
=
check_SEG_step
/
25u
;
...
...
@@ -4531,12 +4531,12 @@ void Checkself_SEG_Display(void)
{
uint16_t
Vspeed
=
0
;
uint16_t
Espeed
=
0
;
uint
16_t
Fuel
=
0
;
uint
8_t
Fuel
=
0
;
uint16_t
collant
=
0
;
uint16_t
TPMS_dis
=
0
;
uint16_t
voltage
=
0
;
uint
16
_t
hour
=
0
;
uint
16
_t
min
=
0
;
uint
8
_t
hour
=
0
;
uint
8
_t
min
=
0
;
uint32_t
ODO
=
0
;
uint32_t
Mileage
=
0
;
// uint32_t i = 0;
...
...
Firmware/Source/Component/BU98R10/BU98R10.c
View file @
9a6afa98
...
...
@@ -12,6 +12,8 @@
#define BU98R10_CHIP1_CSB RTE_GPIO_PORT07_PIN01
#define BU98R10_CHIP1_SCL RTE_GPIO_PORT07_PIN00
#define BU98R10_NOP_TIME 5U
uint8_t
BU98R10_CHIP0_GET_SD_LEVEL
(
void
);
uint8_t
BU98R10_CHIP0_GET_SD_LEVEL
(
void
)
{
...
...
@@ -23,6 +25,59 @@ uint8_t BU98R10_CHIP1_GET_SD_LEVEL(void)
return
RTE_GPIO_Get_Level
(
BU98R10_CHIP1_SD
);
}
void
NOP_DelayTime
(
uint8_t
timer
)
{
// uint8_t i = 0;
// for(i = 0;i < timer;i++)
// {
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
// }
}
void
BU98R10_CHIP0_SET_SD_LEVEL
(
uint8_t
Level
);
void
BU98R10_CHIP0_SET_SD_LEVEL
(
uint8_t
Level
)
{
...
...
@@ -30,15 +85,22 @@ void BU98R10_CHIP0_SET_SD_LEVEL(uint8_t Level)
{
//RTE_GPIO_Config(BU98R10_CHIP0_SD, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_HIGH);
//RTE_GPIO_Set_Level(BU98R10_CHIP0_SD, RTE_GPIO_LEVEL_HIGH);
PORT
->
P0
|=
(
1
<<
2
);
//PORT->P0 |= (1<<2);
//PORT->PM0 &= ~(1<<2);
PORT
->
PM0
&=
~
(
1
<<
2
);
PORT
->
PSET0
=
(
1
<<
2
);
NOP_DelayTime
(
BU98R10_NOP_TIME
);
}
else
{
//RTE_GPIO_Config(BU98R10_CHIP0_SD, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_LOW);
//RTE_GPIO_Set_Level(BU98R10_CHIP0_SD, RTE_GPIO_LEVEL_LOW);
PORT
->
P0
&=
~
(
1
<<
2
);
//P02
PORT
->
PM0
&=
~
(
1
<<
2
);
// PORT->P0 &= ~(1<<2);//P02
// PORT->PM0 &= ~(1<<2);
PORT
->
PM0
&=
~
(
1
<<
2
);
PORT
->
PCLR0
=
(
1
<<
2
);
NOP_DelayTime
(
BU98R10_NOP_TIME
);
}
}
void
BU98R10_CHIP1_SET_SD_LEVEL
(
uint8_t
Level
);
...
...
@@ -48,15 +110,21 @@ void BU98R10_CHIP1_SET_SD_LEVEL(uint8_t Level)
{
//RTE_GPIO_Config(BU98R10_CHIP1_SD, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_HIGH);
//RTE_GPIO_Set_Level(BU98R10_CHIP1_SD, RTE_GPIO_LEVEL_HIGH);
PORT
->
P7
|=
(
1
<<
2
);
PORT
->
PM7
&=
~
(
1
<<
2
);
// PORT->P7 |= (1<<2);
// PORT->PM7 &= ~(1<<2);
PORT
->
PM7
&=
~
(
1
<<
2
);
PORT
->
PSET7
=
(
1
<<
2
);
NOP_DelayTime
(
BU98R10_NOP_TIME
);
}
else
{
//RTE_GPIO_Config(BU98R10_CHIP1_SD, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_LOW);
//RTE_GPIO_Set_Level(BU98R10_CHIP1_SD, RTE_GPIO_LEVEL_LOW);
PORT
->
P7
&=
~
(
1
<<
2
);
//P72
// PORT->P7 &= ~(1<<2);//P72
// PORT->PM7 &= ~(1<<2);
PORT
->
PM7
&=
~
(
1
<<
2
);
PORT
->
PCLR7
=
(
1
<<
2
);
NOP_DelayTime
(
BU98R10_NOP_TIME
);
}
}
void
BU98R10_CHIP0_SET_CSB_LEVEL
(
uint8_t
Level
);
...
...
@@ -66,15 +134,21 @@ void BU98R10_CHIP0_SET_CSB_LEVEL(uint8_t Level)
{
// RTE_GPIO_Config(BU98R10_CHIP0_CSB, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_HIGH);
//RTE_GPIO_Set_Level(BU98R10_CHIP0_CSB, RTE_GPIO_LEVEL_HIGH);
PORT
->
P0
|=
(
1
<<
3
);
PORT
->
PM0
&=
~
(
1
<<
3
);
// PORT->P0 |= (1<<3);
// PORT->PM0 &= ~(1<<3);
PORT
->
PM0
&=
~
(
1
<<
3
);
PORT
->
PSET0
=
(
1
<<
3
);
NOP_DelayTime
(
BU98R10_NOP_TIME
);
}
else
{
// RTE_GPIO_Config(BU98R10_CHIP0_CSB, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_LOW);
//RTE_GPIO_Set_Level(BU98R10_CHIP0_CSB, RTE_GPIO_LEVEL_LOW);
PORT
->
P0
&=
~
(
1
<<
3
);
//P03
PORT
->
PM0
&=
~
(
1
<<
3
);
// PORT->P0 &= ~(1<<3);//P03
// PORT->PM0 &= ~(1<<3);
PORT
->
PM0
&=
~
(
1
<<
3
);
PORT
->
PCLR0
=
(
1
<<
3
);
NOP_DelayTime
(
BU98R10_NOP_TIME
);
}
}
void
BU98R10_CHIP1_SET_CSB_LEVEL
(
uint8_t
Level
);
...
...
@@ -84,15 +158,21 @@ void BU98R10_CHIP1_SET_CSB_LEVEL(uint8_t Level)
{
// RTE_GPIO_Config(BU98R10_CHIP1_CSB, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_HIGH);
//RTE_GPIO_Set_Level(BU98R10_CHIP1_CSB, RTE_GPIO_LEVEL_HIGH);
PORT
->
P7
|=
(
1
<<
1
);
// PORT->P7 |= (1<<1);
// PORT->PM7 &= ~(1<<1);
PORT
->
PM7
&=
~
(
1
<<
1
);
PORT
->
PSET7
=
(
1
<<
1
);
NOP_DelayTime
(
BU98R10_NOP_TIME
);
}
else
{
//RTE_GPIO_Config(BU98R10_CHIP1_CSB, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_LOW);
//RTE_GPIO_Set_Level(BU98R10_CHIP1_CSB, RTE_GPIO_LEVEL_LOW);
PORT
->
P7
&=
~
(
1
<<
1
);
//P71
// PORT->P7 &= ~(1<<1);//P71
// PORT->PM7 &= ~(1<<1);
PORT
->
PM7
&=
~
(
1
<<
1
);
PORT
->
PCLR7
=
(
1
<<
1
);
NOP_DelayTime
(
BU98R10_NOP_TIME
);
}
}
void
BU98R10_CHIP0_SET_SCL_LEVEL
(
uint8_t
Level
);
...
...
@@ -102,15 +182,21 @@ void BU98R10_CHIP0_SET_SCL_LEVEL(uint8_t Level)
{
//RTE_GPIO_Config(BU98R10_CHIP0_SCL, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_HIGH);
//RTE_GPIO_Set_Level(BU98R10_CHIP0_SCL, RTE_GPIO_LEVEL_HIGH);
PORT
->
P0
|=
(
1
<<
4
);
PORT
->
PM0
&=
~
(
1
<<
4
);
// PORT->P0 |= (1<<4);
// PORT->PM0 &= ~(1<<4);
PORT
->
PM0
&=
~
(
1
<<
4
);
PORT
->
PSET0
=
(
1
<<
4
);
NOP_DelayTime
(
BU98R10_NOP_TIME
);
}
else
{
//RTE_GPIO_Config(BU98R10_CHIP0_SCL, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_LOW);
//RTE_GPIO_Set_Level(BU98R10_CHIP0_SCL, RTE_GPIO_LEVEL_LOW);
PORT
->
P0
&=
~
(
1
<<
4
);
//P04
PORT
->
PM0
&=
~
(
1
<<
4
);
// PORT->P0 &= ~(1<<4);//P04
// PORT->PM0 &= ~(1<<4);
PORT
->
PM0
&=
~
(
1
<<
4
);
PORT
->
PCLR0
=
(
1
<<
4
);
NOP_DelayTime
(
BU98R10_NOP_TIME
);
}
}
void
BU98R10_CHIP1_SET_SCL_LEVEL
(
uint8_t
Level
);
...
...
@@ -120,15 +206,21 @@ void BU98R10_CHIP1_SET_SCL_LEVEL(uint8_t Level)
{
//RTE_GPIO_Config(BU98R10_CHIP1_SCL, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_HIGH);
//RTE_GPIO_Set_Level(BU98R10_CHIP1_SCL, RTE_GPIO_LEVEL_HIGH);
PORT
->
P7
|=
(
1
<<
0
);
PORT
->
PM7
&=
~
(
1
<<
0
);
// PORT->P7 |= (1<<0);
// PORT->PM7 &= ~(1<<0);
PORT
->
PM7
&=
~
(
1
<<
0
);
PORT
->
PSET7
=
(
1
<<
0
);
NOP_DelayTime
(
BU98R10_NOP_TIME
);
}
else
{
//RTE_GPIO_Config(BU98R10_CHIP1_SCL, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_LOW);
//RTE_GPIO_Set_Level(BU98R10_CHIP1_SCL, RTE_GPIO_LEVEL_LOW);
PORT
->
P7
&=
~
(
1
<<
0
);
//P70
PORT
->
PM7
&=
~
(
1
<<
0
);
// PORT->P7 &= ~(1<<0);//P70
// PORT->PM7 &= ~(1<<0);
PORT
->
PM7
&=
~
(
1
<<
0
);
PORT
->
PCLR7
=
(
1
<<
0
);
NOP_DelayTime
(
BU98R10_NOP_TIME
);
}
}
void
BU98R10_CHIP0_SET_SD_DIR
(
uint8_t
Dir
);
...
...
@@ -137,14 +229,18 @@ void BU98R10_CHIP0_SET_SD_DIR(uint8_t Dir)
if
(
Dir
)
{
//RTE_GPIO_Set_Level(BU98R10_CHIP0_SD, RTE_GPIO_LEVEL_HIGH);
PORT
->
P0
|=
(
1
<<
2
);
PORT
->
PM0
&=
~
(
1
<<
2
);
//
PORT->P0 |= (1<<2);
//
PORT->PM0 &= ~(1<<2);
// RTE_GPIO_Config(BU98R10_CHIP0_SD, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_HIGH);
PORT
->
PSET0
=
(
1
<<
2
);
NOP_DelayTime
(
BU98R10_NOP_TIME
);
}
else
{
//RTE_GPIO_Config(BU98R10_CHIP0_SD, RTE_GPIO_DIR_IN);
PORT
->
PM0
|=
(
1
<<
2
);
// PORT->PM0 |= (1<<2);
PORT
->
PCLR0
=
(
1
<<
2
);
NOP_DelayTime
(
BU98R10_NOP_TIME
);
}
}
void
BU98R10_CHIP1_SET_SD_DIR
(
uint8_t
Dir
);
...
...
@@ -154,13 +250,17 @@ void BU98R10_CHIP1_SET_SD_DIR(uint8_t Dir)
{
//RTE_GPIO_Set_Level(BU98R10_CHIP1_SD, RTE_GPIO_LEVEL_HIGH);
//RTE_GPIO_Config(BU98R10_CHIP1_SD, RTE_GPIO_DIR_OUT | RTE_GPIO_LEVEL_HIGH);
PORT
->
P7
|=
(
1
<<
2
);
PORT
->
PM7
&=
~
(
1
<<
2
);
// PORT->P7 |= (1<<2);
// PORT->PM7 &= ~(1<<2);
PORT
->
PSET7
=
(
1
<<
2
);
NOP_DelayTime
(
BU98R10_NOP_TIME
);
}
else
{
//RTE_GPIO_Config(BU98R10_CHIP1_SD, RTE_GPIO_DIR_IN);
PORT
->
PM7
|=
(
1
<<
2
);
// PORT->PM7 |= (1<<2);
PORT
->
PCLR7
=
(
1
<<
2
);
NOP_DelayTime
(
BU98R10_NOP_TIME
);
}
}
...
...
@@ -175,6 +275,7 @@ BU98R10DDRAMUnion BU98R10Chip1DDRAMBackup;
#endif
BU98R10UpdateCtrlStruct
BU98R10Update
;
uint32_t
u32BU98R10ForcedUpdate
=
0UL
;
void
BU98R10_Init
(
void
)
{
...
...
@@ -183,6 +284,8 @@ void BU98R10_Init(void)
#if BU98R10_WRITE_AT_SAME_TIME
#if BU98R10_COLORFUL_LCD_MODE
Gen_TimeDelay
(
120
*
1000u
,
50u
);
BU98R10_All_Command_Write
(
BU98R10_CMD_SWRST
);
Gen_TimeDelay
(
20
*
1000
,
50U
);
...
...
@@ -445,7 +548,7 @@ void BU98R10_Init(void)
#endif
#endif
#endif
u32BU98R10ForcedUpdate
=
0UL
;
BU98R10Update
.
En
=
0
;
BU98R10Update
.
Step
=
0
;
BU98R10Update
.
Cont
=
0
;
...
...
@@ -475,25 +578,23 @@ void BU98R10_Shutdown(void)
#endif
}
uint8_t
u8BU98R10CheckCount
=
0
;
#define BU98R10_FORCED_SEG_NUM 2U
void
BU98R10_Update_Request
(
void
)
{
// if (g_sysFlag.Bits.AccSaveState)
//{
// //if (u8BU98R10CheckCount < 20)
// //{
// // BU98R10Update.En = 1;
// // u8BU98R10CheckCount++;
// //}
// BU98R10Update.En = 1;
// }
// else
if
(
BU98R10Update
.
En
==
0
)
{
u8BU98R10CheckCount
=
0
;
BU98R10Update
.
En
=
1
;
if
(
u32BU98R10ForcedUpdate
<=
(
BU98R10_DDRAM_SIZE
-
BU98R10_FORCED_SEG_NUM
))
{
u32BU98R10ForcedUpdate
+=
BU98R10_FORCED_SEG_NUM
;
}
else
{
u32BU98R10ForcedUpdate
=
0UL
;
}
}
BU98R10Update
.
En
=
1
;
#if USE_BU98R10_CHIP_0
BU98R10Update
.
Chip
=
0
;
#elif USE_BU98R10_CHIP_1
...
...
@@ -513,7 +614,9 @@ void BU98R10_Update_Service(void)
{
case
0
:
if
((
BU98R10Chip0DDRAM
.
Byte
[
BU98R10Update
.
Addr
]
!=
BU98R10Chip0DDRAMBackup
.
Byte
[
BU98R10Update
.
Addr
])
||
(
BU98R10Chip1DDRAM
.
Byte
[
BU98R10Update
.
Addr
]
!=
BU98R10Chip1DDRAMBackup
.
Byte
[
BU98R10Update
.
Addr
]))
(
BU98R10Chip1DDRAM
.
Byte
[
BU98R10Update
.
Addr
]
!=
BU98R10Chip1DDRAMBackup
.
Byte
[
BU98R10Update
.
Addr
])
||
((
u32BU98R10ForcedUpdate
<=
BU98R10Update
.
Addr
)
&&
((
u32BU98R10ForcedUpdate
+
BU98R10_FORCED_SEG_NUM
)
>=
BU98R10Update
.
Addr
)))
{
BU98R10Chip0DDRAMBackup
.
Byte
[
BU98R10Update
.
Addr
]
=
BU98R10Chip0DDRAM
.
Byte
[
BU98R10Update
.
Addr
];
BU98R10Chip1DDRAMBackup
.
Byte
[
BU98R10Update
.
Addr
]
=
BU98R10Chip1DDRAM
.
Byte
[
BU98R10Update
.
Addr
];
...
...
Firmware/Source/Component/BU98R10/BU98R10.h
View file @
9a6afa98
...
...
@@ -938,7 +938,7 @@ void BU98R10_All_Data_Write(uint8_t Dat0, uint8_t Dat1);
extern
void
checkSegTftState
(
void
);
#endif
extern
void
NOP_DelayTime
(
uint8_t
timer
);
#endif
Firmware/Source/Component/Key/Key_user.c
View file @
9a6afa98
...
...
@@ -558,7 +558,7 @@ uint8_t Get_Dis_Tpms_Unit(void)
uint8_t
Get_Dis_Tcs_Val
(
void
)
{
return
MenuData
.
Tcs_Val
;
// 0 off, 1 on
return
(
uint8_t
)(
MenuData
.
Tcs_Val
)
;
// 0 off, 1 on
}
uint8_t
Get_Tpms_TX_Flag
(
void
)
{
...
...
Firmware/Source/Component/Service_Interval/Service_Interval.c
View file @
9a6afa98
#include "Service_Interval.h"
#include <stdio.h>
#include <string.h>
#include "Components.h"
/**
* @file Service_Interval.c
* @brief 保养里程
...
...
@@ -70,7 +72,7 @@ void Service_Interval_KL30_Init(Intlib_uint8_t *pMemSpace, Maintain_Init_t *pIni
if
(
g_EEPromRead_Cbk
!=
Intlib_NULL
)
{
g_EEPromRead_Cbk
((
Intlib_uint32_t
*
)
&
DataIntervalSave
,
sizeof
(
DataIntervalSave_t
)
/
4
);
g_EEPromRead_Cbk
((
Intlib_uint32_t
*
)
&
DataIntervalSave
,
(
Intlib_uint16_t
)(
sizeof
(
DataIntervalSave_t
)
/
4
)
);
if
(
DataIntervalSave
.
Flag
!=
0x7887A55A
)
{
g_IntervalCalc
->
Interval100m
=
pInitData
->
IntervalKm
*
10
;
...
...
@@ -85,7 +87,7 @@ void Service_Interval_KL30_Init(Intlib_uint8_t *pMemSpace, Maintain_Init_t *pIni
DataIntervalSave
.
TotalTimer
=
g_IntervalCalc
->
CurTimer_1s
;
if
(
g_EEPromWrite_Cbk
!=
Intlib_NULL
)
{
g_EEPromWrite_Cbk
((
Intlib_uint32_t
*
)
&
DataIntervalSave
,
sizeof
(
DataIntervalSave_t
)
/
4
);
g_EEPromWrite_Cbk
((
Intlib_uint32_t
*
)
&
DataIntervalSave
,
(
Intlib_uint16_t
)(
sizeof
(
DataIntervalSave_t
)
/
4
)
);
}
}
else
...
...
@@ -212,7 +214,7 @@ void Service_Interval_Processing(void)
DataIntervalSave
.
MilAfterReset
=
g_IntervalCalc
->
MilAfterReset
;
DataIntervalSave
.
Interval1s
=
g_IntervalCalc
->
Interval1s
;
DataIntervalSave
.
TotalTimer
=
g_IntervalCalc
->
CurTimer_1s
;
g_EEPromWrite_Cbk
((
Intlib_uint32_t
*
)
&
DataIntervalSave
,
sizeof
(
DataIntervalSave_t
)
/
4
);
g_EEPromWrite_Cbk
((
Intlib_uint32_t
*
)
&
DataIntervalSave
,
(
Intlib_uint16_t
)(
sizeof
(
DataIntervalSave_t
)
/
4
)
);
}
}
}
...
...
@@ -301,12 +303,12 @@ void Service_Interval_SetKm(Intlib_uint32_t IntervalKm)
{
if
(
g_EEPromWrite_Cbk
!=
Intlib_NULL
)
{
g_EEPromWrite_Cbk
((
Intlib_uint32_t
*
)
&
DataIntervalSave
,
sizeof
(
DataIntervalSave_t
)
/
4
);
g_EEPromWrite_Cbk
((
Intlib_uint32_t
*
)
&
DataIntervalSave
,
(
Intlib_uint16_t
)(
sizeof
(
DataIntervalSave_t
)
/
4
)
);
}
if
(
g_EEPromRead_Cbk
!=
Intlib_NULL
)
{
g_EEPromRead_Cbk
((
Intlib_uint32_t
*
)
&
ReadDataIntervalSave
,
sizeof
(
DataIntervalSave_t
)
/
4
);
g_EEPromRead_Cbk
((
Intlib_uint32_t
*
)
&
ReadDataIntervalSave
,
(
Intlib_uint16_t
)(
sizeof
(
DataIntervalSave_t
)
/
4
)
);
}
if
(
memcmp
(
&
DataIntervalSave
,
&
ReadDataIntervalSave
,
sizeof
(
DataIntervalSave_t
))
==
0
)
...
...
@@ -358,7 +360,7 @@ void Service_Interval_SetDay(Intlib_uint32_t IntervalDay)
if
(
g_EEPromWrite_Cbk
!=
Intlib_NULL
)
{
g_EEPromWrite_Cbk
((
Intlib_uint32_t
*
)
&
DataIntervalSave
,
sizeof
(
DataIntervalSave_t
)
/
4
);
g_EEPromWrite_Cbk
((
Intlib_uint32_t
*
)
&
DataIntervalSave
,
(
Intlib_uint16_t
)(
sizeof
(
DataIntervalSave_t
)
/
4
)
);
}
}
}
...
...
Firmware/Source/Device/Cmsemicon/BAT32A239/RTE/GPIO/RTE_GPIO.h
View file @
9a6afa98
...
...
@@ -142,7 +142,7 @@ typedef enum
typedef
struct
{
uint16_t
u16PinNum
;
/**< GPIO端口编号(RTE_GPIO_PORTxx_PINyy) */
uint
16
_t
u16PinMode
;
/**< GPIO工作模式 */
uint
8
_t
u16PinMode
;
/**< GPIO工作模式 */
}
RTE_GPIO_Config_st_t
;
/******************************************************************************
...
...
Firmware/Source/Device/Cmsemicon/BAT32A239/RTE/Tick_Timer/RTE_Tick_Timer_BAT32A239.c
View file @
9a6afa98
...
...
@@ -24,7 +24,7 @@ void RTE_Tick_Timer_Start(uint32_t u32Interval, RTE_Tick_Timer_Call_Back_ptr_t p
u32Interval
=
1UL
;
}
u8Value_us
=
RTE_TICK_TIMER_CLK_SRC_FREQ
/
1000000
;
u8Value_us
=
(
uint8_t
)(
RTE_TICK_TIMER_CLK_SRC_FREQ
/
1000000
)
;
SysTick
->
LOAD
=
u32Interval
*
u8Value_us
;
NVIC_SetPriority
(
SysTick_IRQn
,
(
1UL
<<
__NVIC_PRIO_BITS
)
-
1UL
);
SysTick
->
VAL
=
0UL
;
...
...
Firmware/Source/Device/Cmsemicon/BAT32A239/RTE/UART/UART_DEMO.c
View file @
9a6afa98
...
...
@@ -99,7 +99,7 @@ char Uart0_Receive(void)
* @param None
* @return None
*****************************************************************************/
void
Uart0_IntSend
(
uint8_t
*
tx_buf
,
uint
16
_t
tx_num
)
void
Uart0_IntSend
(
uint8_t
*
tx_buf
,
uint
32
_t
tx_num
)
{
pData
.
data
=
tx_buf
;
pData
.
len
=
tx_num
;
...
...
Firmware/Source/Device/Cmsemicon/BAT32A239/RTE/UART/UART_DEMO.h
View file @
9a6afa98
...
...
@@ -18,7 +18,7 @@ int8_t Uart0_Init(uint32_t bound);
void
Uart0_Send
(
uint8_t
ch
);
char
Uart0_Receive
(
void
);
void
Uart0_IntSend
(
uint8_t
*
tx_buf
,
uint
16
_t
tx_num
);
void
Uart0_IntSend
(
uint8_t
*
tx_buf
,
uint
32
_t
tx_num
);
void
uart0_interrupt_send
(
void
*
msg
);
void
uart0_interrupt_receive
(
void
);
#endif
Firmware/Source/System/Sys_Task_List.c
View file @
9a6afa98
...
...
@@ -37,13 +37,12 @@ void Sys_5ms_Tasks(void)
{
Flash_Sync_Signal_Generation_Service
();
}
}
//uint8_t ljs_buf[200] = {0};
void
Sys_10ms_Tasks
(
void
)
{
//memset(ljs_buf, 0x55, 200);
Line_In_Debounce_Service
(
10u
);
{
Line_In_Debounce_Service
(
10u
);
if
(
Common_GetIgnOnTime
()
>=
3000
)
{
Key_Service
();
...
...
@@ -57,7 +56,7 @@ void Sys_10ms_Tasks(void)
Data_TPMS_Processing_Service
();
Protocol_Service
();
Protocol_Send_Service
();
//Uart0_IntSend(ljs_buf, 200) ;
FaultCode_Service
(
10u
);
}
...
...
@@ -68,14 +67,14 @@ void Sys_20ms_Tasks(void)
Data_Vehicle_Speed_Processing_Service
();
Data_Engine_Speed_Processing_Service
();
Data_Coolant_Temp_Processing_Service
();
//Data_Voltage_Processing_Service();
BU98R10_Update_Request
();
}
void
Sys_50ms_Tasks
(
void
)
{
// BU98R10_Update_Request();
LED_Driver_Scan_Refresh
();
Telltales_Management
();
Gauge_Service
();
...
...
@@ -83,7 +82,7 @@ void Sys_50ms_Tasks(void)
}
uint8_t
u8LEDDriverCheckCount
=
0U
;
//uint16_t ljs_voltage = 0;
void
Sys_100ms_Tasks
(
void
)
{
if
((
PageType
!=
Page_Time_Hour
)
&&
(
PageType
!=
Page_Time_Minute
))
...
...
@@ -97,10 +96,9 @@ void Sys_100ms_Tasks(void)
BackLight_Process
();
Services_Mileage_Callback
();
Data_Voltage_Processing_Service
();
S3_ServerCNTT
();
//ECU_FaultCode_Processing_Service();
S3_ServerCNTT
();
Send_UUID_To_Esp32
();
//ljs_voltage = ADC_Conv_Single_Channel(ADC_CH_KL15_VOLTAGE);
if
(
u8LEDDriverCheckCount
>=
10U
)
{
u8LEDDriverCheckCount
=
0U
;
...
...
@@ -119,7 +117,7 @@ void Sys_100ms_Tasks(void)
{
CAN_TX_SetEnable
(
&
CAN_CH0_CanMsgTxOp
,
CAN_N_TX_Disable
);
}
//R_test = ADC_Read_Signal(ADC_CH_FUEL1);
}
...
...
@@ -147,5 +145,5 @@ void Sys_Exact_50us_Tasks(void)
task_1ms
=
0U
;
eeprom_1ms_timeCount
(
);
}
//u32YZHDCount++;
}
Firmware/Source/UDS/UDS_ISO14229_Services.c
View file @
9a6afa98
...
...
@@ -168,7 +168,7 @@ void Write_App_InValid(uint32_t m32)
/*写22服务数据*/
void
DFlash_init
(
void
)
{
DiagDFlashData
*
ReadDiagDataForDFlash
=
(
DiagDFlashData
*
)
0x500200
;
DiagDFlashData
*
ReadDiagDataForDFlash
=
(
DiagDFlashData
*
)
APP_DATA_INFO
;
if
(
(
ReadDiagDataForDFlash
->
Flag
!=
0x5AA5A77Au
)
||
(
0
!=
memcmp
(
ReadDiagDataForDFlash
->
DID_F180
,
MCU_FBLversion
,
sizeof
(
MCU_FBLversion
)))
||
...
...
@@ -180,9 +180,9 @@ void DFlash_init(void)
Data_Set_DiagPara
();
DiagDataForDFlash
.
Flag
=
0x5AA5A77Au
;
//擦除扇区
EraseSector
(
0x500200ul
);
EraseSector
(
APP_DATA_INFO
);
//App程序状态和22服务数据全写进去
ProgramPage
(
0x500200ul
,
sizeof
(
DiagDataForDFlash
),
(
uint8_t
*
)(
&
DiagDataForDFlash
));
ProgramPage
(
APP_DATA_INFO
,
sizeof
(
DiagDataForDFlash
),
(
uint8_t
*
)(
&
DiagDataForDFlash
));
}
else
{
...
...
Firmware/Source/UDS/UDS_ISO14229_Services.h
View file @
9a6afa98
...
...
@@ -33,6 +33,7 @@
#define NoNeedWait 0x00u
#define NeedWait 0x01u
#define APP_STATUS_ADDR (0x500400ul)
#define APP_DATA_INFO (0x500800ul)
#define Data_Flash_Addr_BootValid_OFFSET 0x00000000
#define Data_Flash_Addr_DiagReceive_OFFSET 0x00002000
...
...
Firmware/utility/Boot_Release/TY200.080000b(ty)/TY200.080000b(ty)_BOOT变更记录.txt
View file @
9a6afa98
...
...
@@ -30,4 +30,11 @@ feat:删除无用代码
feat:更新驱动, 修改内存清空长度, 更新内部版本信息
1、更新驱动文件(cgc), 函数 CGC_PLL_CFG_AS_FCLK 放到RAM中运行
2、跳转前清空的内存长度不正确
2、更新内部版本信息(1.04_20240820)
\ No newline at end of file
2、更新内部版本信息(1.04_20240820)
----2024/09/10----
TY_TY200.080000b(ty)_Boot_B1.05_240910.hex
变更内容:
fix:修改22服务数据存储地址为0x500800ul,
共用同一地址时会导致频繁更新BOOT程序与22服务信息
feat:修改BOOT版本号1.05 240910
\ No newline at end of file
Firmware/utility/Boot_Release/TY200.080000b(ty)/TY_TY200.080000b(ty)_Boot_B1.05_240910.hex
0 → 100644
View file @
9a6afa98
This diff is collapsed.
Click to expand it.
Firmware/utility/Boot_Release/TY200.080000b/TY200.080000b_BOOT变更记录.txt
View file @
9a6afa98
...
...
@@ -33,4 +33,11 @@ feat:删除无用代码
feat:更新驱动, 修改内存清空长度, 更新内部版本信息
1、更新驱动文件(cgc), 函数 CGC_PLL_CFG_AS_FCLK 放到RAM中运行
2、跳转前清空的内存长度不正确
2、更新内部版本信息(1.05_20240820)
\ No newline at end of file
2、更新内部版本信息(1.05_20240820)
----2024/09/10----
TY_TY200.080000b_Boot_B1.06_240910.hex
变更内容:
fix:修改22服务数据存储地址为0x500800ul,
共用同一地址时会导致频繁更新BOOT程序与22服务信息
feat:修改BOOT版本号1.06 240910
\ No newline at end of file
Firmware/utility/Boot_Release/TY200.080000b/TY_TY200.080000b_Boot_B1.06_240910.hex
0 → 100644
View file @
9a6afa98
This diff is collapsed.
Click to expand it.
Firmware/utility/评审记录/天鹰摩托功能规范V2.5_240818.docx
0 → 100644
View file @
9a6afa98
File added
Firmware/utility/评审记录/天鹰软件审核记录.xlsx
0 → 100644
View file @
9a6afa98
File added
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