zhangbo
2025-02-28 e8fae59212dd962e2f13137f53d70bd1625891fb
修改串口蓝牙转发
已修改10个文件
18028 ■■■■ 文件已修改
keil/Listings/uwb_simple_example.map 5860 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Objects/uwb_simple_example.build_log.htm 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Objects/uwb_simple_example.hex 9826 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Objects/uwb_simple_example.htm 1938 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Objects/uwb_simple_example_MK8000 Release.dep 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/include/drivers/serial_at_cmd_app.c 163 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/include/main/main.c 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/lora_3029.c 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/uwb_app.c 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/uwb_simple_example.uvoptx 138 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Listings/uwb_simple_example.map
ÎļþÌ«´ó
keil/Objects/uwb_simple_example.build_log.htm
@@ -27,13 +27,8 @@
<h2>Output:</h2>
*** Using Compiler 'V6.14', folder: 'D:\keil\ARM\ARMCLANG\Bin'
Build Project 'uwb_simple_example' - Target 'MK8000 Release'
linking...
D:\zhangbo\2024\Code\ChinaUWB\ChinaUWBProject-biaoqian-RX - BT-zuixinceshi\keil\include\devices\MK800X\Source\ARM\MK800X_ac6_copy.sct(25): warning: L6314W: No section matches pattern *(.XIP_SECTION).
Program Size: Code=74060 RO-data=9452 RW-data=1628 ZI-data=28064
Finished: 0 information, 1 warning and 0 error messages.
FromELF: creating hex file...
After Build - User command #1: fromelf.exe --bincombined -o "Output\uwb_simple_example.bin" "D:\zhangbo\2024\Code\ChinaUWB\ChinaUWBProject-biaoqian-RX - BT-zuixinceshi\keil\Objects\uwb_simple_example.axf"
".\Objects\uwb_simple_example.axf" - 0 Error(s), 1 Warning(s).
".\Objects\uwb_simple_example.axf" - 0 Error(s), 0 Warning(s).
<h2>Software Packages used:</h2>
@@ -47,7 +42,7 @@
  D:\keil\pack\MKSEMI\MK800X_DFP\1.0.3\Device\Include
<h2>Collection of Component Files used:</h2>
Build Time Elapsed:  00:00:02
Build Time Elapsed:  00:00:00
</pre>
</body>
</html>
keil/Objects/uwb_simple_example.hex
ÎļþÌ«´ó
keil/Objects/uwb_simple_example.htm
ÎļþÌ«´ó
keil/Objects/uwb_simple_example_MK8000 Release.dep
@@ -530,7 +530,7 @@
I (D:\keil\ARM\ARMCLANG\include\stdarg.h)(0x5DDFFD72)
F (.\include\drivers\mk_timer.h)(0x67206CDD)()
F (.\include\drivers\PCA9555.c)(0x67AEA0D7)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O0 -ffunction-sections -w -I ./include/drivers -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/pca9555.o -MD)
I (include\drivers\PCA9555.h)(0x67909B96)
I (include\drivers\PCA9555.h)(0x67BFDB96)
I (include\board\board.h)(0x67AC74B2)
I (include\drivers\mk_common.h)(0x67206CDC)
I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x5DDFFD72)
@@ -554,7 +554,7 @@
I (include\drivers\mk_io.h)(0x67206CDC)
I (include\drivers\mk_power.h)(0x67206CDC)
I (..\keil\lora_3029.h)(0x67BBDB00)
F (.\include\drivers\PCA9555.h)(0x67909B96)()
F (.\include\drivers\PCA9555.h)(0x67BFDB96)()
F (.\include\drivers\Usart1.c)(0x672050F0)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O0 -ffunction-sections -w -I ./include/board -I ../keil -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/usart1.o -MD)
I (include\drivers\Usart.h)(0x67B4382E)
I (D:\keil\ARM\ARMCLANG\include\stdint.h)(0x5DDFFD72)
@@ -664,7 +664,7 @@
I (include\drivers\mk_dma.h)(0x672473BD)
I (include\drivers\mk_misc.h)(0x67206CDC)
I (include\drivers\mk_clock.h)(0x67206CDC)
F (.\include\drivers\serial_at_cmd_app.c)(0x67BD6138)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O0 -ffunction-sections -w -I ./include/drivers -I ./include/board -I ../keil -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/serial_at_cmd_app.o -MD)
F (.\include\drivers\serial_at_cmd_app.c)(0x67C0381C)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O0 -ffunction-sections -w -I ./include/drivers -I ./include/board -I ../keil -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/serial_at_cmd_app.o -MD)
I (include\drivers\serial_at_cmd_app.h)(0x672050F0)
I (D:\keil\ARM\ARMCLANG\include\stdint.h)(0x5DDFFD72)
I (include\drivers\global_param.h)(0x672B0902)
@@ -748,7 +748,7 @@
I (include\drivers\mk_gpio.h)(0x67206CDC)
I (include\drivers\Usart.h)(0x67B4382E)
I (..\keil\lora_3029.h)(0x67BBDB00)
F (.\include\main\main.c)(0x67BD24F9)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O0 -ffunction-sections -w -I ./include/board -I ../keil -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/main.o -MD)
F (.\include\main\main.c)(0x67C029C7)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O0 -ffunction-sections -w -I ./include/board -I ../keil -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/main.o -MD)
I (include\drivers\mk_trace.h)(0x67206CDC)
I (include\drivers\mk_common.h)(0x67206CDC)
I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x5DDFFD72)
@@ -805,7 +805,7 @@
I (include\drivers\mk_spi.h)(0x67206CDD)
I (include\components\hal\pan_port.h)(0x672050F0)
I (include\components\hal\pan_rf.h)(0x676E1685)
I (include\drivers\PCA9555.h)(0x67909B96)
I (include\drivers\PCA9555.h)(0x67BFDB96)
I (include\drivers\mk_timer.h)(0x67206CDD)
I (..\keil\lora_3029.h)(0x67BBDB00)
I (include\drivers\mk_phy.h)(0x67206CDD)
@@ -867,7 +867,7 @@
I (D:\keil\ARM\ARMCLANG\include\stdarg.h)(0x5DDFFD72)
I (include\drivers\mk_gpio.h)(0x67206CDC)
I (include\drivers\mk_io.h)(0x67206CDC)
F (.\uwb_app.c)(0x67B425C5)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O0 -ffunction-sections -w -I ./include/board -I ../keil -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/uwb_app.o -MD)
F (.\uwb_app.c)(0x67BFFC89)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O0 -ffunction-sections -w -I ./include/board -I ../keil -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/uwb_app.o -MD)
I (include\drivers\mk_trace.h)(0x67206CDC)
I (include\drivers\mk_common.h)(0x67206CDC)
I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x5DDFFD72)
@@ -900,7 +900,7 @@
I (include\drivers\mk_gpio.h)(0x67206CDC)
I (include\drivers\mk_io.h)(0x67206CDC)
I (..\keil\lora_3029.h)(0x67BBDB00)
F (.\lora_3029.c)(0x67BD6362)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O0 -ffunction-sections -w -I ./include/board -I ../keil -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/lora_3029.o -MD)
F (.\lora_3029.c)(0x67BE8E7F)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O0 -ffunction-sections -w -I ./include/board -I ../keil -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/lora_3029.o -MD)
I (..\keil\lora_3029.h)(0x67BBDB00)
I (include\drivers\mk_io.h)(0x67206CDC)
I (include\drivers\mk_common.h)(0x67206CDC)
@@ -925,7 +925,7 @@
I (D:\keil\ARM\ARMCLANG\include\stdlib.h)(0x5DDFFD6A)
I (D:\keil\ARM\ARMCLANG\include\math.h)(0x5DDFFD6C)
I (include\components\hal\pan_rf.h)(0x676E1685)
I (include\drivers\PCA9555.h)(0x67909B96)
I (include\drivers\PCA9555.h)(0x67BFDB96)
I (include\board\board.h)(0x67AC74B2)
I (include\drivers\mk_trace.h)(0x67206CDC)
I (include\drivers\mk_uart.h)(0x672473BD)
@@ -1470,7 +1470,7 @@
I (D:\keil\ARM\ARMCLANG\include\stdbool.h)(0x5DDFFD72)
I (D:\keil\ARM\ARMCLANG\include\math.h)(0x5DDFFD6C)
I (include\components\hal\pan_rf.h)(0x676E1685)
I (include\drivers\PCA9555.h)(0x67909B96)
I (include\drivers\PCA9555.h)(0x67BFDB96)
I (include\board\board.h)(0x67AC74B2)
I (include\drivers\mk_common.h)(0x67206CDC)
I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x5DDFFD72)
@@ -1500,7 +1500,7 @@
I (D:\keil\ARM\ARMCLANG\include\stdbool.h)(0x5DDFFD72)
I (D:\keil\ARM\ARMCLANG\include\math.h)(0x5DDFFD6C)
I (include\components\hal\pan_rf.h)(0x676E1685)
I (include\drivers\PCA9555.h)(0x67909B96)
I (include\drivers\PCA9555.h)(0x67BFDB96)
I (include\board\board.h)(0x67AC74B2)
I (include\drivers\mk_common.h)(0x67206CDC)
I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x5DDFFD72)
keil/include/drivers/serial_at_cmd_app.c
@@ -139,128 +139,57 @@
#define buff_lenth 1024
#define MAX_BASE_STATIONS 10
uint8_t DMA_RXBuf_BT[200]={0};
uint8_t Forward_BT_buff[buff_lenth]={0};
uint8_t report_ancnum_bt=0;
uint8_t data_length_flag=0;
void UsartParseDataHandler(uint8_t data)
{
      uint8_t buff[buff_lenth] = {0};
    uint8_t length = 0;
    uint8_t base_station_count = 0;
        memcpy(buff, m_EUART_DMA_RXBuf, 1024);
    //memcpy(buff, Forward_BT_buff, 1024);
    // éåކ
    for (int n = 0; n < 1024 - 6; n++)
    {
        // åŒ…头 0x55 0xAA 0x41
        if (buff[n] == 0x55 && buff[n+1] == 0xAA && buff[n+2] == 0x41)
        {
            length = buff[n+3];
            if (n + 6 + report_ancnum_bt * 6 + length > 1024) {
                continue; // å¦‚果数据越界,跳过该包
        static UsartRecvPackState usart_receive_state = UsartReceiveWaitHead0;
        uint16_t checksum = 0;
        static uint8_t pack_datalen = 0,pack_length = 0,pack_index = 0,pack_msgtype = 0,pack_cmd = CMD_READ,pack_num=0;
        static uint8_t index = 0;
        if(usart_receive_state == UsartReceiveWaitChecksum)
        {   //若收到校验和包
                      if(mUsartReceivePack[pack_datalen-1]==0x66&&data==0xBB)
                        {
                         memcpy(&DMA_RXBuf_BT[0],&mUsartReceivePack[0], pack_datalen-1);
                        }
            usart_receive_state = UsartReceiveWaitHead0;
            pack_index = 0;
            pack_length = 0;
            index=0;
        } else if((usart_receive_state == UsartReceiveWaitData) ) {    //若果收到的是正常通讯包
            mUsartReceivePack[pack_index] = data;
            pack_index++;
//                      if(data_length_flag==1)
//                        {
//                            data_length_flag=0;
//                            usart_receive_state = UsartReceiveWaitDataLen;
////                            pack_length=0x03+data;
//                        }
            if(pack_index == pack_datalen) {        //如果收到的index与长度相等
                usart_receive_state = UsartReceiveWaitChecksum;
            }
            // å°†æ•°æ®å¤åˆ¶åˆ° DMA ç¼“冲区
            memcpy(DMA_RXBuf_BT, &buff[n+4], length);
            report_ancnum_bt=buff[n+4];
            // ä¸ºäº†é¿å…å¤šæ¬¡é‡å¤è§£æžåŒä¸€ä¸ªæ•°æ®åŒ…,可以在这里添加跳跃
            n += 6 + report_ancnum_bt * 6 + length - 1; // è·³è¿‡å½“前数据包
        } else if(usart_receive_state == UsartReceiveWaitDataLen) {                        //收到指令类型字节
            pack_datalen = data;
                        pack_index = 0;
            usart_receive_state = UsartReceiveWaitData;
        }  else if((usart_receive_state == UsartReceiveWaitHead0) && (data == 0x55)) {    //收到第一个包头
            usart_receive_state = UsartReceiveWaitHead1;
        } else if((usart_receive_state == UsartReceiveWaitHead1) && (data == 0xAA)) {    //收到第二个包头
            usart_receive_state = UsartReceiveWaitMsgType;
        } else if ((usart_receive_state == UsartReceiveWaitMsgType) && (data == 0x41)) {
            usart_receive_state = UsartReceiveWaitDataLen;
        }
    }
    // æ¸…除临时缓冲区
    memset(buff, 0, buff_lenth);
//    if(state5V_prase_flag&&!g_com_map[MODBUS_MODE])
//    {   //升级程序
//        static UsartRecvPackState usart_receive_state = UsartReceiveWaitHead0;
//        uint16_t checksum = 0;
//        static uint8_t pack_datalen = 0,pack_length = 0,pack_index = 0,pack_msgtype = 0,pack_cmd = CMD_READ;
//        static uint8_t index = 0;
//        if(usart_receive_state == UsartReceiveWaitChecksum)
//        {   //若收到校验和包
//            checksum = 0;
//            for(int i = 0; i<pack_length-5; i++) {
//                checksum += mUsartReceivePack[i];
//            }
//            checksum += pack_cmd;
//            checksum += pack_length;
//            checksum += pack_index;
//            checksum += pack_datalen;
//            checksum += pack_msgtype;
//            if(((data + checksum)&0xff) == 0xFF)                //校验通过
//            {
//                switch(pack_cmd)
//                {
//                case CMD_WRITE:
//                  if(pack_index==MODBUS_MODE*2)
//                  {
//                      Uart1GpsRecDebugSend();
//                      g_com_map[MODBUS_MODE] = 1;
//                      return;
//                  }
//                    //从mUsartReceivePack中读取pack_length长度的字节,放到全局变量中,赋值保存的参数并且存入flash
//                    memcpy((uint8_t*)&g_com_map + pack_index, mUsartReceivePack, pack_datalen);
//                    if(mUsartReceivePack[0]==1)
//                        UpdateProcess(pack_index);
//                    //返回一个error状态
//                    //SendComMap(pack_datalen,pack_index);
//                    save_com_map_to_flash();
//                    //delay_ms(100);
//                    NVIC_SystemReset();
//                    break;
//                case CMD_READ:
//                    //read包中data字节,即mUsartReceivePack[0]表示数据长度;
//                    //从g_com_data结构体中的第index位置读取长度为mUsartReceivePack[0]的字节,发送出来
//                    SendComMap(pack_datalen,pack_index>>1);
//                    break;
//                default:
//                    break;
//                }
//            }
//            usart_receive_state = UsartReceiveWaitHead0;
//            pack_index = 0;
//            pack_length = 0;
//            index=0;
//        } else if((usart_receive_state == UsartReceiveWaitData) ) {    //若果收到的是正常通讯包
//            mUsartReceivePack[index] = data;
//            index++;
//            if(index == pack_length-5) {        //如果收到的index与长度相等
//                usart_receive_state = UsartReceiveWaitChecksum;
//            }
//        } else if(usart_receive_state == UsartReceiveWaitDataLen) {                        //收到指令类型字节
//            pack_datalen = data;
//            usart_receive_state = UsartReceiveWaitData;
//        } else if(usart_receive_state == UsartReceiveWaitIndex) {                        //收到指令类型字节
//            pack_index = data;
//            usart_receive_state = UsartReceiveWaitDataLen;
//        } else if(usart_receive_state == UsartReceiveWaitCMD) {                            //收到指令类型字节
//            pack_cmd = data;
//            usart_receive_state = UsartReceiveWaitIndex;
//        } else if(usart_receive_state == UsartReceiveWaitLength) {                        //收到长度字节
//            pack_length = data;
//            pack_index = 0;
//            usart_receive_state = UsartReceiveWaitCMD;
//        } else if((usart_receive_state == UsartReceiveWaitHead0) && (data == 0x55)) {    //收到第一个包头
//            usart_receive_state = UsartReceiveWaitHead1;
//        } else if((usart_receive_state == UsartReceiveWaitHead1) && (data == 0xAA)) {    //收到第二个包头
//            usart_receive_state = UsartReceiveWaitMsgType;
//        } else if ((usart_receive_state == UsartReceiveWaitMsgType) && (data == 0x3)) {
//            usart_receive_state = UsartReceiveWaitLength;
//            pack_msgtype = data;
//        }
//        else {
//            usart_receive_state = UsartReceiveWaitHead0;
//            pack_index = 0;
//            pack_length = 0;
//        }
        else {
            usart_receive_state = UsartReceiveWaitHead0;
            pack_index = 0;
            pack_length = 0;
        }
//    } else if(gps_prase_flag)
//    {
//        static uint8_t index = 0;
keil/include/main/main.c
@@ -378,7 +378,7 @@
{
    Usart1ParseDataCallback = UsartParseDataHandler;//需改为默认为gps处理,UsartParseDataHandler为升级处理当调试时候改为
    parameter_init_anchor();//g_com_map表初始化角色默认为基站
    g_com_map[DEV_ID]=0x1234;
    g_com_map[DEV_ID]=0x1131;
//    g_com_map[GROUP_ID]=1;
    dev_id=g_com_map[DEV_ID];//这里不太对
    group_id=g_com_map[GROUP_ID];//组ID
@@ -417,7 +417,9 @@
void IdleTask(void)
{    
//    BT_LED_ON;
 UART0_CheckReceive();
//    BT_LED_OFF;
}
int bind_check(void)
@@ -584,7 +586,7 @@
        
            uint16_t checksum1;    
            rf_irq_process();
      LORA_LED_OFF;
            no_rx_flag=0;
        tx_flag=rf_get_transmit_flag();
        recv_flag=rf_get_recv_flag();
@@ -637,25 +639,23 @@
                                        switch(RX_Buffer[PWTAG_RW_FLAG_IDX])
                                        {
                                                case WGRSP_RWTAG_NONE:
//                        wg_report_freq = RX_Buffer[POLL_FREQ_IDX]+400;
//                        memcpy(&rec_delaytime,&RX_Buffer[NEXTPOLL_TIME_IDX],2);
//                        if(report_ancnum<2)
//                        {
//                            datalen_offset = report_ancnum*85;
//                        }else{
//                            datalen_offset = (report_ancnum-1)*46+85;
//                        }
//                        rec_secdelay = RX_Buffer[PWTAG_SECDELAY_IDX];
//                        if(BufferSize!=13||rec_secdelay>20)
//                        {
//                            rec_secdelay = 0;
//                        }
//
//                        sleep_time_count = rec_delaytime*3.2768 - delaytime-datalen_offset;
//                        while(sleep_time_count>=32768)
//                            sleep_time_count-=32768;
//                                                sleep_timer_start(sleep_time_count);
                        wg_report_freq = RX_Buffer[POLL_FREQ_IDX]+400;
                        memcpy(&rec_delaytime,&RX_Buffer[NEXTPOLL_TIME_IDX],2);
                        if(report_ancnum<2)
                        {
                            datalen_offset = report_ancnum*85;
                        }else{
                            datalen_offset = (report_ancnum-1)*46+85;
                        }
                        rec_secdelay = RX_Buffer[PWTAG_SECDELAY_IDX];
                        if(BufferSize!=13||rec_secdelay>20)
                        {
                         rec_secdelay = 0;
                        }
                        sleep_time_count = rec_delaytime - delaytime-datalen_offset;
                        while(sleep_time_count>=1000)
                            sleep_time_count-=1000;
                                                sleep_timer_start(sleep_time_count);
                        break;
                                                case WGRSP_RWTAG_READ:
@@ -726,7 +726,9 @@
                 //rf_set_mode(RF_MODE_STB3);
                 rf_set_transmit_flag(RADIO_FLAG_IDLE);
                 Loratx_flag++;
                 LORA_LED_ON;
                  rf_enter_single_timeout_rx(100);
        }
        if((recv_flag == RADIO_FLAG_RXTIMEOUT))
        {
keil/lora_3029.c
@@ -278,15 +278,17 @@
        checksum = Checksum_u16(lora_sendbuffer,4*BT_NUM+4*report_ancnum+ANCID_IDX+2);
        memcpy(&lora_sendbuffer[ANCID_IDX+BT_NUM*4+report_ancnum*4+2],&checksum,2);
        BT_SEND_flag++;
        LORA_3029_SINGLE_SEND(lora_sendbuffer,ANCID_IDX+report_ancnum*4+BT_NUM*4+4,0);
        }
        else
        {
        checksum = Checksum_u16(lora_sendbuffer,4*report_ancnum+ANCID_IDX);
        memcpy(&lora_sendbuffer[ANCID_IDX+report_ancnum*4],&checksum,2);
        LORA_3029_SINGLE_SEND(lora_sendbuffer,ANCID_IDX+report_ancnum*4+BT_NUM*4+2,0);
        }
    LORA_3029_SINGLE_SEND(lora_sendbuffer,ANCID_IDX+report_ancnum*4+BT_NUM*4+4,0);
        memset(DMA_RXBuf_BT, 0,200);
        memset(&lora_sendbuffer[ANCID_IDX],0,200);
    //LED_TB_ON;
keil/uwb_app.c
@@ -522,33 +522,11 @@
                }
      //  uwb_rxflag=uwb_rx(0, 0, range_timeout_us);
    }    
        #ifdef DEBUG_BOXING
//        gpio_pin_clr(IO_PIN_5);//测试
//        gpio_pin_set(IO_PIN_5);//测试
        #endif
    
    delay_us(1);
    uwb_rx_force_off(1);
//        gpio_pin_clr(IO_PIN_5);
//        #ifdef DEBUG_BOXING
//        gpio_pin_clr(IO_PIN_5);//测试.
//        #endif
//        if(!flag_recsuccess)
//        {
//            sleep_timer_start(__MS_TO_32K_CNT(UWB_DELAY_TIME_US-3));//测试
//        LOG_INFO(TRACE_MODULE_APP,"测距失败,计数:%d\r\n",recev_error_num);
//        if(recev_error_num++>5)
//        {
//            recev_error_num=0;
//            UWB_work_state=SEARCH_DEV;
//            uwb_searchcount = 0;
//            search_open_flag = 1;
//        }
//            }
//        #ifdef DEBUG_BOXING
//        gpio_pin_clr(IO_PIN_5);//测试
////        gpio_pin_set(IO_PIN_5);//测试
//        #endif
}
int Uwbinit(void)
{
keil/uwb_simple_example.uvoptx
@@ -148,7 +148,24 @@
          <Name></Name>
        </SetRegEntry>
      </TargetDriverDllRegistry>
      <Breakpoint/>
      <Breakpoint>
        <Bp>
          <Number>0</Number>
          <Type>0</Type>
          <LineNumber>623</LineNumber>
          <EnabledFlag>1</EnabledFlag>
          <Address>9498</Address>
          <ByteObject>0</ByteObject>
          <HtxType>0</HtxType>
          <ManyObjects>0</ManyObjects>
          <SizeOfObject>0</SizeOfObject>
          <BreakByAccess>0</BreakByAccess>
          <BreakIfRCount>1</BreakIfRCount>
          <Filename>&lt;1&gt;.\include\main\main.c</Filename>
          <ExecCommand></ExecCommand>
          <Expression>\\uwb_simple_example\include/main/main.c\623</Expression>
        </Bp>
      </Breakpoint>
      <WatchWindow1>
        <Ww>
          <count>0</count>
@@ -355,132 +372,27 @@
          <WinNumber>1</WinNumber>
          <ItemText>rec_nearbase_num</ItemText>
        </Ww>
        <Ww>
          <count>41</count>
          <WinNumber>1</WinNumber>
          <ItemText>pack_datalen</ItemText>
        </Ww>
      </WatchWindow1>
      <WatchWindow2>
        <Ww>
          <count>0</count>
          <WinNumber>2</WinNumber>
          <ItemText>resp_tx_num</ItemText>
          <ItemText>lora_sendbuffer</ItemText>
        </Ww>
        <Ww>
          <count>1</count>
          <WinNumber>2</WinNumber>
          <ItemText>distance,0x0A</ItemText>
          <ItemText>sleep_time_count</ItemText>
        </Ww>
        <Ww>
          <count>2</count>
          <WinNumber>2</WinNumber>
          <ItemText>rec_ancdistlist</ItemText>
        </Ww>
        <Ww>
          <count>3</count>
          <WinNumber>2</WinNumber>
          <ItemText>rec_ancidlist</ItemText>
        </Ww>
        <Ww>
          <count>4</count>
          <WinNumber>2</WinNumber>
          <ItemText>rec_antdelay</ItemText>
        </Ww>
        <Ww>
          <count>5</count>
          <WinNumber>2</WinNumber>
          <ItemText>UWB_fachu_count,0x0A</ItemText>
        </Ww>
        <Ww>
          <count>6</count>
          <WinNumber>2</WinNumber>
          <ItemText>UWB_shoudao_count,0x0A</ItemText>
        </Ww>
        <Ww>
          <count>7</count>
          <WinNumber>2</WinNumber>
          <ItemText>report_ancnum</ItemText>
        </Ww>
        <Ww>
          <count>8</count>
          <WinNumber>2</WinNumber>
          <ItemText>report_ancid</ItemText>
        </Ww>
        <Ww>
          <count>9</count>
          <WinNumber>2</WinNumber>
          <ItemText>rec_ancdistlist</ItemText>
        </Ww>
        <Ww>
          <count>10</count>
          <WinNumber>2</WinNumber>
          <ItemText>rec_ancidlist</ItemText>
        </Ww>
        <Ww>
          <count>11</count>
          <WinNumber>2</WinNumber>
          <ItemText>FZ_NEARBASEID_INDEX</ItemText>
        </Ww>
        <Ww>
          <count>12</count>
          <WinNumber>2</WinNumber>
          <ItemText>gpio_state</ItemText>
        </Ww>
        <Ww>
          <count>13</count>
          <WinNumber>2</WinNumber>
          <ItemText>RX_Buffer</ItemText>
        </Ww>
        <Ww>
          <count>14</count>
          <WinNumber>2</WinNumber>
          <ItemText>lora_sendbuffer</ItemText>
        </Ww>
        <Ww>
          <count>15</count>
          <WinNumber>2</WinNumber>
          <ItemText>Forward_BT_buff</ItemText>
        </Ww>
        <Ww>
          <count>16</count>
          <WinNumber>2</WinNumber>
          <ItemText>DMA_RXBuf_BT</ItemText>
        </Ww>
        <Ww>
          <count>17</count>
          <WinNumber>2</WinNumber>
          <ItemText>buff</ItemText>
        </Ww>
        <Ww>
          <count>18</count>
          <WinNumber>2</WinNumber>
          <ItemText>LORA_RETRANSNUSSION_BT</ItemText>
        </Ww>
        <Ww>
          <count>19</count>
          <WinNumber>2</WinNumber>
          <ItemText>checksum</ItemText>
        </Ww>
        <Ww>
          <count>20</count>
          <WinNumber>2</WinNumber>
          <ItemText>pdata</ItemText>
        </Ww>
        <Ww>
          <count>21</count>
          <WinNumber>2</WinNumber>
          <ItemText>report_ancnum_bt</ItemText>
        </Ww>
        <Ww>
          <count>22</count>
          <WinNumber>2</WinNumber>
          <ItemText>BT_SEND_flag</ItemText>
        </Ww>
        <Ww>
          <count>23</count>
          <WinNumber>2</WinNumber>
          <ItemText>report_ancnum_bt</ItemText>
        </Ww>
        <Ww>
          <count>24</count>
          <WinNumber>2</WinNumber>
          <ItemText>DMA_RXBuf_BT</ItemText>
        </Ww>
      </WatchWindow2>
      <MemoryWindow1>