Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
haoJin750TFT
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
时昊
haoJin750TFT
Commits
e0f90aa6
Commit
e0f90aa6
authored
Sep 21, 2024
by
张金硕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:新增故障码显16进制接口
parent
bf741393
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
2 deletions
+62
-2
BlueTooth.c
Firmware/Source/Application/BlueTooth.c
+60
-1
BlueTooth.h
Firmware/Source/Application/BlueTooth.h
+2
-1
No files found.
Firmware/Source/Application/BlueTooth.c
View file @
e0f90aa6
...
...
@@ -160,7 +160,7 @@ TEXT_STRUCT TextPara[TEXT_NUM_TOTAL] =
{
TEXT_NUM_INFORMATION_HW
,
0x4014
,
0
},
//23F 23E
{
TEXT_NUM_INFORMATION_OS
,
0x4015
,
0
},
{
TEXT_NUM_INFORMATION_MCU
,
0x4016
,
0
},
{
TEXT_NUM_
ROAD_NAME
,
0x4022
,
0
},
{
TEXT_NUM_
FAUULT_CODE
,
0x4022
,
0
},
};
...
...
@@ -173,6 +173,7 @@ uint8_t LastBlueToothName[20];
uint8_t
PhoneNumberTotal
[
20
];
uint8_t
InformationOSVersion
[
20
];
uint8_t
InformationMCUVersion
[
26
];
uint8_t
TextFaultCodeNum
[
10
];
void
TextService
(
void
)
{
...
...
@@ -215,6 +216,7 @@ void TextService(void)
memset
(
BlueToothName
,
0
,
sizeof
(
BlueToothName
));
memset
(
LastBlueToothName
,
0
,
sizeof
(
LastBlueToothName
));
memset
(
PhoneNumberTotal
,
0
,
sizeof
(
PhoneNumberTotal
));
memset
(
TextFaultCodeNum
,
0
,
sizeof
(
TextFaultCodeNum
));
for
(
uint8_t
i
=
0
;
i
<
sizeof
(
OSVersionASCLLList
);
i
++
)
{
...
...
@@ -284,6 +286,63 @@ void TextService(void)
TextPara
[
TEXT_NUM_PHONE_NUMBER_TOTAL
].
Vaild
=
0x01
;
LastPhoneBookTotalCount
=
BlueToothPhoneData
.
PhoneBookTotalCount
;
}
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
CAN_CH0_ID_CH0_402_Msg_Count
)
==
CAN_SIG_LOST
)
{
;
}
else
{
uint8_t
FaultCodeNumCnts
=
0
;
uint8_t
FaultCodeHighNum
=
0
;
uint8_t
FaultCodeMidNum
=
0
;
FaultCodeHighNum
=
Get_Current_Hight_FaultCode
();
FaultCodeMidNum
=
Get_Current_Mid_FaultCode
();
TextFaultCodeNum
[
FaultCodeNumCnts
++
]
=
0x50
;
TextFaultCodeNum
[
FaultCodeNumCnts
++
]
=
0x00
;
if
((((
FaultCodeHighNum
)
&
(
0xF0
))
>>
4
)
<
10
)
{
TextFaultCodeNum
[
FaultCodeNumCnts
++
]
=
(((
FaultCodeHighNum
)
&
(
0xF0
))
>>
4
)
+
0x30
;
TextFaultCodeNum
[
FaultCodeNumCnts
++
]
=
0x00
;
}
else
{
TextFaultCodeNum
[
FaultCodeNumCnts
++
]
=
((((
FaultCodeHighNum
)
&
(
0xF0
))
>>
4
)
%
10
)
+
0x41
;
TextFaultCodeNum
[
FaultCodeNumCnts
++
]
=
0x00
;
}
if
((((
FaultCodeHighNum
)
&
(
0x0F
)))
<
10
)
{
TextFaultCodeNum
[
FaultCodeNumCnts
++
]
=
((
FaultCodeHighNum
)
&
(
0x0F
))
+
0x30
;
TextFaultCodeNum
[
FaultCodeNumCnts
++
]
=
0x00
;
}
else
{
TextFaultCodeNum
[
FaultCodeNumCnts
++
]
=
(((
FaultCodeHighNum
)
&
(
0x0F
))
%
10
)
+
0x41
;
TextFaultCodeNum
[
FaultCodeNumCnts
++
]
=
0x00
;
}
if
((((
FaultCodeMidNum
)
&
(
0xF0
))
>>
4
)
<
10
)
{
TextFaultCodeNum
[
FaultCodeNumCnts
++
]
=
(((
FaultCodeMidNum
)
&
(
0xF0
))
>>
4
)
+
0x30
;
TextFaultCodeNum
[
FaultCodeNumCnts
++
]
=
0x00
;
}
else
{
TextFaultCodeNum
[
FaultCodeNumCnts
++
]
=
((((
FaultCodeMidNum
)
&
(
0xF0
))
>>
4
)
%
10
)
+
0x41
;
TextFaultCodeNum
[
FaultCodeNumCnts
++
]
=
0x00
;
}
if
((((
FaultCodeMidNum
)
&
(
0x0F
)))
<
10
)
{
TextFaultCodeNum
[
FaultCodeNumCnts
++
]
=
((
FaultCodeMidNum
)
&
(
0x0F
))
+
0x30
;
TextFaultCodeNum
[
FaultCodeNumCnts
++
]
=
0x00
;
}
else
{
TextFaultCodeNum
[
FaultCodeNumCnts
++
]
=
(((
FaultCodeMidNum
)
&
(
0x0F
))
%
10
)
+
0x41
;
TextFaultCodeNum
[
FaultCodeNumCnts
++
]
=
0x00
;
}
TextPara
[
TEXT_NUM_FAUULT_CODE
].
Vaild
=
0x01
;
}
}
Firmware/Source/Application/BlueTooth.h
View file @
e0f90aa6
...
...
@@ -13,7 +13,7 @@ typedef enum {
TEXT_NUM_INFORMATION_HW
,
TEXT_NUM_INFORMATION_OS
,
TEXT_NUM_INFORMATION_MCU
,
TEXT_NUM_
ROAD_NAM
E
,
TEXT_NUM_
FAUULT_COD
E
,
TEXT_NUM_TOTAL
,
}
TEXT_NUM_ENUM
;
...
...
@@ -47,6 +47,7 @@ extern uint8_t BlueToothName[40];
extern
uint8_t
PhoneNumberTotal
[
20
];
extern
uint8_t
InformationOSVersion
[
20
];
extern
uint8_t
InformationMCUVersion
[
26
];
extern
uint8_t
TextFaultCodeNum
[
10
];
extern
TEXT_STRUCT
TextPara
[];
#endif
\ No newline at end of file
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