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
7c8c73ee
Commit
7c8c73ee
authored
Jun 07, 2024
by
李俭双
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:增加WiFi升级协议内容,收到ESP32重启命令后复位重启
parent
83ef960d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
4 deletions
+25
-4
TianYing.uvprojx
...ware/Project/Cmsemicon/BAT32A239/MDK_ARM/TianYing.uvprojx
+1
-1
BlueTooth.h
Firmware/Source/Application/BLUETOOTH/BlueTooth.h
+4
-1
Protocol_User.c
Firmware/Source/Application/BLUETOOTH/Protocol_User.c
+20
-2
No files found.
Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/TianYing.uvprojx
View file @
7c8c73ee
...
...
@@ -339,7 +339,7 @@
<MiscControls></MiscControls>
<Define>
USE_STDPERIPH_DRIVER,BAT32G139_64PIN
</Define>
<Undefine></Undefine>
<IncludePath>
..\..\..\..\Source\Device\Cmsemicon\BAT32A239\RTE;..\..\..\..\Source\Component;..\..\..\..\Source\Device\Cmsemicon\BAT32A239\Library\Driver\include;..\..\..\..\Source\Device\Cmsemicon\BAT32A239\Library\Device\Include;..\..\..\..\Source\Application;..\..\..\..\Source;..\..\..\..\Source\Component\LED_Driver;..\..\..\..\Source\UDS
</IncludePath>
<IncludePath>
..\..\..\..\Source\Device\Cmsemicon\BAT32A239\RTE;..\..\..\..\Source\Component;..\..\..\..\Source\Device\Cmsemicon\BAT32A239\Library\Driver\include;..\..\..\..\Source\Device\Cmsemicon\BAT32A239\Library\Device\Include;..\..\..\..\Source\Application;..\..\..\..\Source;..\..\..\..\Source\Component\LED_Driver;..\..\..\..\Source\UDS
;..\..\..\..\Source\Component\System_Monitor
</IncludePath>
</VariousControls>
</Cads>
<Aads>
...
...
Firmware/Source/Application/BLUETOOTH/BlueTooth.h
View file @
7c8c73ee
...
...
@@ -11,6 +11,8 @@
#define ESP32_MCU_0x01 0x01 //ESP32发送蓝牙导航信息的ID
#define ESP32_MCU_0x12 0x12 //低功耗蓝牙启动状态及蓝牙名称
#define MCU_ESP32_0x03 0x03 //MCU发送UUID
#define ESP32_MCU_0x02 0x02 //ESP32发送重启请求
#define MCU_ESP32_0x04 0x04 //MCU发送重启命令
enum
{
BLUE_STATE_Starting
,
//蓝牙模组启动中
...
...
@@ -23,7 +25,8 @@ typedef struct __attribute__((aligned(4)))
uint8_t
Navigation_St
;
/*导航状态 0x35 未导航或导航结束 0x33 正在导航*/
uint8_t
Navigation_Code
;
/*蓝牙导向编码*/
uint32_t
Navigation_Mileage
;
/*剩余里程*/
uint8_t
BLE_St
;
uint8_t
BLE_St
;
uint8_t
ESP32_Reset
;
}
BlueTooth_t
;
typedef
enum
__attribute__
((
aligned
(
4
)))
...
...
Firmware/Source/Application/BLUETOOTH/Protocol_User.c
View file @
7c8c73ee
#include "Protocol_User.h"
#include "RTE.h"
#include "System_Monitor_User.h"
#define UART_TX_MAX_DEPTH 1024UL //(2 * 1024UL) // 4K
#define UART_RX_MAX_DEPTH (2 * 1024UL) // 4K
...
...
@@ -169,7 +169,7 @@ 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
};
if
(
pData
->
CmdID
==
ESP32_MCU_0x10
)
{
BlueTooth
.
BlueTooth_St
=
pData
->
Data
[
0
];
...
...
@@ -182,6 +182,24 @@ static void Protocol_UartHandle(const Protocol_Data_t *pData)
{
BlueTooth
.
BLE_St
=
pData
->
Data
[
0
];
}
else
if
(
pData
->
CmdID
==
ESP32_MCU_0x02
)
{
BlueTooth
.
ESP32_Reset
=
pData
->
Data
[
0
];
if
(
BlueTooth
.
ESP32_Reset
==
1
)
{
ID04
[
0
]
=
1
;
Protocol_Send
(
MCU_ESP32_0x04
,
ID04
,
1
);
}
else
if
(
BlueTooth
.
ESP32_Reset
==
2
)
{
__NVIC_SystemReset
();
}
else
{
;
}
}
else
if
(
pData
->
CmdID
==
ESP32_MCU_0x01
)
{
if
(
pData
->
Data
[
0
]
==
0x33
)
...
...
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