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
baizhengyuan
TianYing_ty100
Commits
682348c7
Commit
682348c7
authored
Aug 17, 2024
by
李俭双
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:增加ESP32心跳检测
parent
4b832f2e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
0 deletions
+37
-0
Protocol_User.c
Firmware/Source/Application/BLUETOOTH/Protocol_User.c
+35
-0
Protocol_User.h
Firmware/Source/Application/BLUETOOTH/Protocol_User.h
+1
-0
Sys_Task_List.c
Firmware/Source/System/Sys_Task_List.c
+1
-0
No files found.
Firmware/Source/Application/BLUETOOTH/Protocol_User.c
View file @
682348c7
...
...
@@ -7,6 +7,8 @@
#define UART_RX_MAX_DEPTH (2 * 1024UL) // 4K
#define UART_DATA_BUF_LEN (2 * 1024UL) // 4K
uint32_t
u32ActiveCount
=
0
;
uint32_t
u32ActiveReset
=
0
;
typedef
struct
__attribute__
((
aligned
(
4
)))
{
Protocol_uint32_t
read_pos
;
...
...
@@ -170,6 +172,8 @@ static Protocol_uint32_t Protocol_UartSend(const Protocol_uint8_t *pData, Protoc
static
void
Protocol_UartHandle
(
const
Protocol_Data_t
*
pData
)
{
uint8_t
ID04
[
1
]
=
{
0
};
u32ActiveCount
=
0
;
if
(
pData
->
CmdID
==
ESP32_MCU_0x10
)
{
BlueTooth
.
BlueTooth_St
=
pData
->
Data
[
0
];
...
...
@@ -227,6 +231,37 @@ static void Protocol_UartHandle(const Protocol_Data_t *pData)
//非本协议数据,不处理
}
}
void
Protocol_ESP32_Active_Service
(
void
)
{
if
(
RTE_GPIO_Get_Level
(
L_BD433Ctrl_OUT
)
==
1
)
{
if
(
u32ActiveCount
>=
200
)
{
u32ActiveReset
=
0
;
RTE_GPIO_Set_Level
(
L_BD433Ctrl_OUT
,
RTE_GPIO_LEVEL_LOW
);
}
else
{
u32ActiveCount
++
;
}
}
else
{
if
(
u32ActiveReset
<=
2
)
{
u32ActiveReset
++
;
}
else
{
u32ActiveReset
=
0
;
u32ActiveCount
=
0
;
RTE_GPIO_Set_Level
(
L_BD433Ctrl_OUT
,
RTE_GPIO_LEVEL_HIGH
);
}
}
}
void
UART_Put
(
Protocol_uint16_t
Data
)
{
...
...
Firmware/Source/Application/BLUETOOTH/Protocol_User.h
View file @
682348c7
...
...
@@ -9,5 +9,6 @@
void
Protocol_KL30_Wakeup_Init
(
void
);
void
Protocol_Send_Service
(
void
);
// 10ms任务调用
void
UART_Put
(
Protocol_uint16_t
Data
);
void
Protocol_ESP32_Active_Service
(
void
);
#endif
Firmware/Source/System/Sys_Task_List.c
View file @
682348c7
...
...
@@ -114,6 +114,7 @@ void Sys_100ms_Tasks(void)
}
Clear_Navigation_St
();
Protocol_ESP32_Active_Service
();
//R_test = ADC_Read_Signal(ADC_CH_FUEL1);
}
...
...
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