Ble receive Successful

This commit is contained in:
2025-06-28 20:33:31 +08:00
parent 03dba7bcc3
commit 9ca28fd516
10 changed files with 6634 additions and 6486 deletions

File diff suppressed because one or more lines are too long

View File

@@ -27,7 +27,15 @@ Project File Date: 06/26/2025
<h2>Output:</h2>
*** Using Compiler 'V6.21', folder: 'D:\keil5\ARM\ARMCLANG\Bin'
Build target 'AutoGuideStick'
"AutoGuideStick\AutoGuideStick.axf" - 0 Error(s), 0 Warning(s).
../fun/HCBle.c(124): warning: illegal character encoding in string literal [-Winvalid-source-encoding]
124 | HCBle_SendData("? <BD><E2><CE><F6>ʧ<B0><DC>: %s\r\n", frame);
| ^~~~~~~~~~~~~~~~ ~~~~~~~~
1 warning generated.
compiling HCBle.c...
linking...
Program Size: Code=83284 RO-data=1592 RW-data=16 ZI-data=11480
FromELF: creating hex file...
"AutoGuideStick\AutoGuideStick.axf" - 0 Error(s), 1 Warning(s).
<h2>Software Packages used:</h2>
@@ -51,7 +59,7 @@ Package Vendor: Keil
* Component: ARM::CMSIS:CORE@5.6.0
Include file: CMSIS/Core/Include/tz_context.h
Build Time Elapsed: 00:00:00
Build Time Elapsed: 00:00:02
</pre>
</body>
</html>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -2070,7 +2070,7 @@ I (..\Middlewares\ST\threadx\ports\cortex_m33\ac6\inc\tx_port.h)(0x683FA4D9)
-o autoguidestick/tx_event_flags_info_get.o -MD)
I (..\Middlewares\ST\threadx\common\inc\tx_api.h)(0x683FA4DA)
I (..\Middlewares\ST\threadx\ports\cortex_m33\ac6\inc\tx_port.h)(0x683FA4D9)
I (..\Middlewares\ST\threadx\ports\cortex_m33\ac6\inc\tx_port.h)(0x683FA4D9)
I (..\Core\Inc\tx_user.he:\keil5\ARM\ARMCLANG\include\stdlib.h)(0x00000000)
I (D:\keil5\ARM\ARMCLANG\include\string.h)(0x6569B012)
I (..\Middlewares\ST\threadx\common\inc\tx_trace.h)(0x683FA4DA)
@@ -2111,9 +2111,9 @@ I (D:\keil5\ARM\ARMCLANG\include\string.h)(0x6569B012)
-o autoguidestick/tx_event_flags_set.o -MD)
I (..\Middlewares\ST\threadx\common\inc\tx_api.h)(0x683FA4DA)
I (..\Middlewares\ST\threadx\ports\cortex_m33\ac6\inc\tx_port.h)(0x683FA4D9)
I (..\Middlewares\ST\threadx\ports\cortex_m33\ac6\inc\tx_port.h)(0x683FA4D9)
I (..\Core\Inc\tx_user.he:\keil5\ARM\ARMCLANG\include\stdlib.h)(0x00000000)
I (D:\keil5\ARM\ARMCLANG\include\string.h)(0x6569B012)
I (D:\keil5\ARM\ARMCLANG\include\string.h)(0x6569B012)
I (..\Middlewares\ST\threadx\common\inc\tx_trace.h)(0x683FA4DA)
I (..\Middlewares\ST\threadx\common\inc\tx_thread.h)(0x683FA4DA)
I (..\Middlewares\ST\threadx\common\inc\tx_event_flags.h)(0x683FA4DA)

Binary file not shown.

View File

@@ -101,30 +101,32 @@ void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size)
// <20>ѳɹ<D1B3>ʵ<EFBFBD><CAB5> Ble<6C><65>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>
void HCBle_ParseAndHandleFrame(const char *frame)
{
int left, right;
float lat, lon, angle;
// if (sscanf(frame, "#{\"leftSpeed\":%d,\"rightSpeed\":%d}", &left, &right) == 2) {
if (sscanf(frame, "#{\"leftSpeed\":%d,\"rightSpeed\":%d}$", &left, &right) == 2) {
cmd.LeftSpeed = left;
cmd.RightSpeed = right;
HCBle_SendData("left=%d, right=%d\r\n", left, right);
return;
}
// if (sscanf(frame, "%*[^0-9]%d%*[^0-9]%d", &left, &right) == 2) {
// cmd.LeftSpeed = left;
// cmd.RightSpeed = right;
// HCBle_SendData("? <20><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>: <20><>=%d, <20><>=%d\r\n", left, right);
// return;
// }
if (sscanf(frame, "%*[^0-9]%d%*[^0-9]%d", &left, &right) == 2) {
cmd.LeftSpeed = left;
cmd.RightSpeed = right;
HCBle_SendData("? <20><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>: <20><>=%d, <20><>=%d\r\n", left, right);
return;
}
HCBle_SendData("? <20><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>: %s\r\n", frame);
}
//Ϊɶһֱʹ<D6B1>ò<EFBFBD><C3B2>ˣ<EFBFBD><CBA3><EFBFBD><EFBFBD><EFBFBD>һֱ<D2BB>ٵȴ<D9B5>TX<54><58><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// <20>ں<EFBFBD>̨<EFBFBD><CCA8><EFBFBD>е<EFBFBD>һ<EFBFBD><D2BB><EFBFBD>̣߳<DFB3><CCA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȴ<EFBFBD>UART<52>յ<EFBFBD>BLE<4C><45><EFBFBD>ݺ󴥷<DDBA><F3B4A5B7><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD>Ȼ<EFBFBD><C8BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Щ<EFBFBD><D0A9><EFBFBD><EFBFBD>
void ble_rx_task_entry(ULONG thread_input)
@@ -158,7 +160,6 @@ void ble_rx_task_entry(ULONG thread_input)
json_buf[idx++] = c;
if (c == '$') {
json_buf[idx] = '\0';
HCBle_SendData("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>json_buf: %s\r\n", json_buf);
HCBle_ParseAndHandleFrame(json_buf);
parsing = 0;
idx = 0;

View File

@@ -2,7 +2,7 @@
#define __HCBLE_H
#include "headfile.h"
#define DEBUG_EN 1 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1> ʹ<><CAB9>DMA <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9> <20><><EFBFBD><EFBFBD>ʽ
//#define DEBUG_EN 1 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1> ʹ<><CAB9>DMA <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9> <20><><EFBFBD><EFBFBD>ʽ
#define RX_DataSize 128
#define RING_BUFFER_SIZE 256
#define UART_DMA_RX_BUF_SIZE 20