zhangbo
2025-02-13 b32910bdb85c6e9d19abf97f1465c573a0bf9d38
测试版
已添加4个文件
已修改15个文件
75654 ■■■■ 文件已修改
keil/JLinkLog.txt 52363 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Listings/uwb_simple_example.map 6726 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Objects/uwb_simple_example.build_log.htm 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Objects/uwb_simple_example.hex 10161 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Objects/uwb_simple_example.htm 3462 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Objects/uwb_simple_example.lnp 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Objects/uwb_simple_example_MK8000 Release.dep 184 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/include/components/hal/pan_rf.c 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/include/components/hal/pan_rf.h 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/include/drivers/PCA9555.c 581 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/include/drivers/PCA9555.h 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/include/drivers/uwb_tag_.c 492 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/include/main/main.c 289 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/lora_3029.c 553 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/lora_3029.h 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/uwb_app.c 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/uwb_simple_example.uvoptx 192 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/uwb_simple_example.uvprojx 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/uwb_tag_.c 492 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/JLinkLog.txt
ÎļþÌ«´ó
keil/Listings/uwb_simple_example.map
ÎļþÌ«´ó
keil/Objects/uwb_simple_example.build_log.htm
@@ -21,14 +21,20 @@
Dialog DLL:      TARMCM1.DLL V1.14.2.0
 
<h2>Project:</h2>
D:\zhangbo\2024\Code\ChinaUWB\ChinaUWBProject-标签-RX\keil\uwb_simple_example.uvprojx
Project File Date:  11/11/2024
D:\zhangbo\2024\Code\ChinaUWB\ChinaUWBProject-biaoqian-RX\keil\uwb_simple_example.uvprojx
Project File Date:  12/23/2024
<h2>Output:</h2>
*** Using Compiler 'V6.14', folder: 'D:\keil\ARM\ARMCLANG\Bin'
Build Project 'uwb_simple_example' - Target 'MK8000 Release'
After Build - User command #1: fromelf.exe --bincombined -o "Output\uwb_simple_example.bin" "D:\zhangbo\2024\Code\ChinaUWB\ChinaUWBProject-标签-RX\keil\Objects\uwb_simple_example.axf"
".\Objects\uwb_simple_example.axf" - 0 Error(s), 0 Warning(s).
compiling main.c...
linking...
D:\zhangbo\2024\Code\ChinaUWB\ChinaUWBProject-biaoqian-RX\keil\include\devices\MK800X\Source\ARM\MK800X_ac6_copy.sct(25): warning: L6314W: No section matches pattern *(.XIP_SECTION).
Program Size: Code=77080 RO-data=9772 RW-data=1664 ZI-data=28992
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\keil\Objects\uwb_simple_example.axf"
".\Objects\uwb_simple_example.axf" - 0 Error(s), 1 Warning(s).
<h2>Software Packages used:</h2>
keil/Objects/uwb_simple_example.hex
ÎļþÌ«´ó
keil/Objects/uwb_simple_example.htm
ÎļþÌ«´ó
keil/Objects/uwb_simple_example.lnp
@@ -27,6 +27,7 @@
".\objects\sn74hc595.o"
".\objects\mk_spi.o"
".\objects\mk_timer.o"
".\objects\pca9555.o"
".\objects\usart1.o"
".\objects\usart.o"
".\objects\mk_4g.o"
keil/Objects/uwb_simple_example_MK8000 Release.dep
@@ -16,7 +16,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_mac.h)(0x67206CDD)
I (include\drivers\mk_phy.h)(0x67206CDD)
F (.\include\components\algo\lib\lib_aoa.lib)(0x67206CDE)()
@@ -58,7 +58,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_dma.h)(0x672473BD)
I (include\drivers\mk_clock.h)(0x67206CDC)
I (include\drivers\mk_reset.h)(0x67206CDC)
@@ -81,7 +81,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_dma.h)(0x672473BD)
I (include\drivers\mk_clock.h)(0x67206CDC)
I (include\drivers\mk_reset.h)(0x67206CDC)
@@ -103,7 +103,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_clock.h)(0x67206CDC)
I (include\drivers\mk_reset.h)(0x67206CDC)
I (include\drivers\mk_trace.h)(0x67206CDC)
@@ -130,7 +130,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
F (.\include\drivers\mk_dma.c)(0x672473BD)(-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/mk_dma.o -MD)
I (include\drivers\mk_dma.h)(0x672473BD)
I (include\drivers\mk_common.h)(0x67206CDC)
@@ -146,7 +146,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_clock.h)(0x67206CDC)
I (include\drivers\mk_reset.h)(0x67206CDC)
I (include\drivers\mk_trace.h)(0x67206CDC)
@@ -167,7 +167,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_clock.h)(0x67206CDC)
I (include\drivers\mk_reset.h)(0x67206CDC)
I (include\drivers\mk_trace.h)(0x67206CDC)
@@ -189,7 +189,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_dma.h)(0x672473BD)
I (include\drivers\mk_misc.h)(0x67206CDC)
I (include\drivers\mk_clock.h)(0x67206CDC)
@@ -212,7 +212,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_io.h)(0x67206CDC)
I (include\drivers\mk_clock.h)(0x67206CDC)
I (include\drivers\mk_reset.h)(0x67206CDC)
@@ -235,7 +235,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
F (.\include\drivers\mk_misc.c)(0x67206CDC)(-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/mk_misc.o -MD)
I (include\drivers\mk_misc.h)(0x67206CDC)
I (include\drivers\mk_clock.h)(0x67206CDC)
@@ -252,7 +252,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_dual_timer.h)(0x67206CDC)
I (include\drivers\mk_trace.h)(0x67206CDC)
I (include\drivers\mk_uart.h)(0x672473BD)
@@ -275,7 +275,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_trace.h)(0x67206CDC)
I (include\drivers\mk_uart.h)(0x672473BD)
I (include\drivers\mk_dma.h)(0x672473BD)
@@ -309,7 +309,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_trace.h)(0x67206CDC)
I (include\drivers\mk_uart.h)(0x672473BD)
I (include\drivers\mk_dma.h)(0x672473BD)
@@ -329,7 +329,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_clock.h)(0x67206CDC)
I (include\drivers\mk_reset.h)(0x67206CDC)
I (include\drivers\mk_trace.h)(0x67206CDC)
@@ -352,7 +352,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_trace.h)(0x67206CDC)
I (include\drivers\mk_uart.h)(0x672473BD)
I (include\drivers\mk_dma.h)(0x672473BD)
@@ -374,7 +374,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_uart.h)(0x672473BD)
I (include\drivers\mk_dma.h)(0x672473BD)
I (D:\keil\ARM\ARMCLANG\include\stdarg.h)(0x5DDFFD72)
@@ -399,7 +399,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_dma.h)(0x672473BD)
I (include\drivers\mk_trace.h)(0x67206CDC)
I (D:\keil\ARM\ARMCLANG\include\stdarg.h)(0x5DDFFD72)
@@ -421,7 +421,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_mac.h)(0x67206CDD)
I (include\drivers\mk_phy.h)(0x67206CDD)
I (include\drivers\mk_reset.h)(0x67206CDC)
@@ -452,7 +452,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_clock.h)(0x67206CDC)
I (include\drivers\mk_reset.h)(0x67206CDC)
I (include\drivers\mk_trace.h)(0x67206CDC)
@@ -475,7 +475,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_trace.h)(0x67206CDC)
I (include\drivers\mk_uart.h)(0x672473BD)
I (include\drivers\mk_dma.h)(0x672473BD)
@@ -499,7 +499,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_dma.h)(0x672473BD)
I (include\drivers\mk_trace.h)(0x67206CDC)
I (include\drivers\mk_uart.h)(0x672473BD)
@@ -521,7 +521,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_clock.h)(0x67206CDC)
I (include\drivers\mk_reset.h)(0x67206CDC)
I (include\drivers\mk_trace.h)(0x67206CDC)
@@ -529,6 +529,30 @@
I (include\drivers\mk_dma.h)(0x672473BD)
I (D:\keil\ARM\ARMCLANG\include\stdarg.h)(0x5DDFFD72)
F (.\include\drivers\mk_timer.h)(0x67206CDD)()
F (.\include\drivers\PCA9555.c)(0x67693492)(-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)(0x67693344)
I (include\board\board.h)(0x67206CDC)
I (include\drivers\mk_common.h)(0x67206CDC)
I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x5DDFFD72)
I (D:\keil\ARM\ARMCLANG\include\stdint.h)(0x5DDFFD72)
I (D:\keil\ARM\ARMCLANG\include\stdbool.h)(0x5DDFFD72)
I (D:\keil\ARM\ARMCLANG\include\string.h)(0x5DDFFD6C)
I (include\devices\MK800X\Include\MK800X.h)(0x67206CDC)
I (include\CMSIS\Include\core_cm0.h)(0x67206CDC)
I (include\CMSIS\Include\cmsis_version.h)(0x67206CDC)
I (include\CMSIS\Include\cmsis_compiler.h)(0x67206CDC)
I (include\CMSIS\Include\cmsis_armclang.h)(0x67206CDC)
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_trace.h)(0x67206CDC)
I (include\drivers\mk_uart.h)(0x672473BD)
I (include\drivers\mk_dma.h)(0x672473BD)
I (D:\keil\ARM\ARMCLANG\include\stdarg.h)(0x5DDFFD72)
I (include\drivers\mk_gpio.h)(0x67206CDC)
I (include\drivers\mk_io.h)(0x67206CDC)
F (.\include\drivers\PCA9555.h)(0x67693344)()
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)(0x672050F0)
I (D:\keil\ARM\ARMCLANG\include\stdint.h)(0x5DDFFD72)
@@ -546,7 +570,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_uart.h)(0x672473BD)
I (D:\keil\ARM\ARMCLANG\include\stdio.h)(0x5DDFFD72)
F (.\include\drivers\Usart.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/usart.o -MD)
@@ -566,7 +590,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_dma.h)(0x672473BD)
F (.\mk_4G.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/mk_4g.o -MD)
I (..\keil\mk_4G.h)(0x672050F0)
@@ -584,7 +608,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_trace.h)(0x67206CDC)
I (include\drivers\mk_uart.h)(0x672473BD)
I (include\drivers\mk_dma.h)(0x672473BD)
@@ -597,7 +621,7 @@
I (include\drivers\lis3dh_driver.h)(0x672050F0)
I (D:\keil\ARM\ARMCLANG\include\math.h)(0x5DDFFD6C)
I (D:\keil\ARM\ARMCLANG\include\stdint.h)(0x5DDFFD72)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (D:\keil\ARM\ARMCLANG\include\stdlib.h)(0x5DDFFD6A)
I (include\drivers\mk_io.h)(0x67206CDC)
I (include\drivers\mk_common.h)(0x67206CDC)
@@ -634,7 +658,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_dma.h)(0x672473BD)
I (include\drivers\mk_misc.h)(0x67206CDC)
I (include\drivers\mk_clock.h)(0x67206CDC)
@@ -657,7 +681,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_dma.h)(0x672473BD)
I (include\drivers\mk_misc.h)(0x67206CDC)
I (include\drivers\mk_clock.h)(0x67206CDC)
@@ -682,7 +706,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_trace.h)(0x67206CDC)
I (include\drivers\mk_uart.h)(0x672473BD)
I (include\drivers\mk_dma.h)(0x672473BD)
@@ -713,7 +737,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\board\board.h)(0x67206CDC)
I (include\drivers\mk_trace.h)(0x67206CDC)
I (include\drivers\mk_uart.h)(0x672473BD)
@@ -721,7 +745,7 @@
I (D:\keil\ARM\ARMCLANG\include\stdarg.h)(0x5DDFFD72)
I (include\drivers\mk_gpio.h)(0x67206CDC)
I (include\drivers\Usart.h)(0x672050F0)
F (.\include\main\main.c)(0x674D867D)(-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)(0x67AD8A8E)(-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)
@@ -736,7 +760,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_uart.h)(0x672473BD)
I (include\drivers\mk_dma.h)(0x672473BD)
I (D:\keil\ARM\ARMCLANG\include\stdarg.h)(0x5DDFFD72)
@@ -777,9 +801,10 @@
I (include\src\TCPClient.h)(0x672050F0)
I (include\drivers\mk_spi.h)(0x67206CDD)
I (include\components\hal\pan_port.h)(0x672050F0)
I (include\components\hal\pan_rf.h)(0x67440B80)
I (include\components\hal\pan_rf.h)(0x676935DB)
I (include\drivers\PCA9555.h)(0x67693344)
I (include\drivers\mk_timer.h)(0x67206CDD)
I (..\keil\lora_3029.h)(0x672D87AC)
I (..\keil\lora_3029.h)(0x67AC6E8C)
F (.\include\src\TCPClient.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/tcpclient.o -MD)
I (include\src\TCPClient.h)(0x672050F0)
I (include\components\hido\Include\HIDO_TYpeDef.h)(0x672050F0)
@@ -807,7 +832,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_dma.h)(0x672473BD)
I (..\keil\mk_4G.h)(0x672050F0)
I (include\board\board.h)(0x67206CDC)
@@ -831,14 +856,14 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_trace.h)(0x67206CDC)
I (include\drivers\mk_uart.h)(0x672473BD)
I (include\drivers\mk_dma.h)(0x672473BD)
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)(0x674EB028)(-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)(0x675F8466)(-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)
@@ -853,7 +878,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_uart.h)(0x672473BD)
I (include\drivers\mk_dma.h)(0x672473BD)
I (D:\keil\ARM\ARMCLANG\include\stdarg.h)(0x5DDFFD72)
@@ -870,8 +895,8 @@
I (include\board\board.h)(0x67206CDC)
I (include\drivers\mk_gpio.h)(0x67206CDC)
I (include\drivers\mk_io.h)(0x67206CDC)
F (.\lora_3029.c)(0x67404E72)(-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)(0x672D87AC)
F (.\lora_3029.c)(0x676900C7)(-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)(0x67AC6E8C)
I (include\drivers\mk_io.h)(0x67206CDC)
I (include\drivers\mk_common.h)(0x67206CDC)
I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x5DDFFD72)
@@ -886,7 +911,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_spi.h)(0x67206CDD)
I (include\drivers\mk_dma.h)(0x672473BD)
I (include\drivers\global_param.h)(0x672B0902)
@@ -894,7 +919,13 @@
I (D:\keil\ARM\ARMCLANG\include\stdio.h)(0x5DDFFD72)
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)(0x67440B80)
I (include\components\hal\pan_rf.h)(0x676935DB)
I (include\drivers\PCA9555.h)(0x67693344)
I (include\board\board.h)(0x67206CDC)
I (include\drivers\mk_trace.h)(0x67206CDC)
I (include\drivers\mk_uart.h)(0x672473BD)
I (D:\keil\ARM\ARMCLANG\include\stdarg.h)(0x5DDFFD72)
I (include\drivers\mk_gpio.h)(0x67206CDC)
F (.\include\components\wsf\sources\port\baremetal\wsf_assert.c)(0x67206CDE)(-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/components/wsf/include/platform -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/wsf_assert.o -MD)
I (include\components\wsf\include\wsf_assert.h)(0x67206CDE)
I (include\components\wsf\include\wsf_trace.h)(0x67206CDE)
@@ -915,7 +946,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
F (.\include\components\wsf\sources\port\baremetal\wsf_buf.c)(0x67206CDE)(-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 .. -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/wsf_buf.o -MD)
I (include\components\wsf\include\wsf_types.h)(0x67206CDE)
I (D:\keil\ARM\ARMCLANG\include\stdint.h)(0x5DDFFD72)
@@ -938,7 +969,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\components\wsf\include\wsf_heap.h)(0x67206CDE)
I (include\components\wsf\include\wsf_math.h)(0x67206CDE)
I (include\components\wsf\include\wsf_os.h)(0x67206CDE)
@@ -962,7 +993,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\components\wsf\include\wsf_trace.h)(0x67206CDE)
I (D:\keil\ARM\ARMCLANG\include\stdarg.h)(0x5DDFFD72)
I (include\components\wsf\include\wsf_os.h)(0x67206CDE)
@@ -989,7 +1020,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\components\wsf\include\wsf_buf.h)(0x67206CDE)
I (include\components\wsf\include\wsf_math.h)(0x67206CDE)
I (include\components\wsf\include\wsf_os.h)(0x67206CDE)
@@ -1028,7 +1059,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\components\crc\crc.h)(0x67206CDE)
I (D:\keil\ARM\ARMCLANG\include\stdlib.h)(0x5DDFFD6A)
F (.\include\components\wsf\sources\port\baremetal\wsf_os.c)(0x67206CDE)(-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 .. -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/wsf_os.o -MD)
@@ -1057,7 +1088,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_power.h)(0x67206CDC)
F (.\include\components\wsf\sources\port\baremetal\wsf_queue.c)(0x67206CDE)(-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 .. -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/wsf_queue.o -MD)
I (include\components\wsf\include\wsf_types.h)(0x67206CDE)
@@ -1081,7 +1112,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
F (.\include\components\wsf\sources\port\baremetal\wsf_timer.c)(0x67206CDE)(-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 .. -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/wsf_timer.o -MD)
I (include\components\wsf\include\wsf_queue.h)(0x67206CDE)
I (include\components\wsf\include\wsf_types.h)(0x67206CDE)
@@ -1100,7 +1131,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_misc.h)(0x67206CDC)
I (include\drivers\mk_clock.h)(0x67206CDC)
F (.\include\components\wsf\sources\port\baremetal\wsf_trace.c)(0x67206CDE)(-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 .. -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/wsf_trace.o -MD)
@@ -1124,7 +1155,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\components\wsf\include\wsf_assert.h)(0x67206CDE)
I (include\components\wsf\include\wsf_cs.h)(0x67206CDE)
F (.\include\components\wsf\sources\platform\pal_flash.c)(0x67206CDE)(-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/components/wsf/sources/platform -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/pal_flash.o -MD)
@@ -1143,7 +1174,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_flash.h)(0x67206CDC)
I (include\drivers\mk_dma.h)(0x672473BD)
I (include\drivers\mk_misc.h)(0x67206CDC)
@@ -1164,7 +1195,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\components\wsf\include\platform\pal_uart.h)(0x67206CDE)
I (include\drivers\mk_misc.h)(0x67206CDC)
I (include\drivers\mk_clock.h)(0x67206CDC)
@@ -1184,7 +1215,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
F (.\include\components\crc\crc.c)(0x67206CDE)(-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/components/crc -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/crc.o -MD)
I (include\components\crc\crc.h)(0x67206CDE)
I (D:\keil\ARM\ARMCLANG\include\stdint.h)(0x5DDFFD72)
@@ -1226,7 +1257,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_trace.h)(0x67206CDC)
I (include\drivers\mk_uart.h)(0x672473BD)
I (include\drivers\mk_dma.h)(0x672473BD)
@@ -1258,7 +1289,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_trace.h)(0x67206CDC)
I (include\drivers\mk_uart.h)(0x672473BD)
I (include\drivers\mk_dma.h)(0x672473BD)
@@ -1300,7 +1331,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_trace.h)(0x67206CDC)
I (include\drivers\mk_uart.h)(0x672473BD)
I (include\drivers\mk_dma.h)(0x672473BD)
@@ -1334,7 +1365,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_trace.h)(0x67206CDC)
I (include\drivers\mk_uart.h)(0x672473BD)
I (include\drivers\mk_dma.h)(0x672473BD)
@@ -1373,7 +1404,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_trace.h)(0x67206CDC)
I (include\drivers\mk_uart.h)(0x672473BD)
I (include\drivers\mk_dma.h)(0x672473BD)
@@ -1423,7 +1454,7 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_dma.h)(0x672473BD)
F (.\include\components\hal\pan_port.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 .. -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/pan_port.o -MD)
I (include\components\hal\pan_port.h)(0x672050F0)
@@ -1432,8 +1463,9 @@
I (D:\keil\ARM\ARMCLANG\include\stdlib.h)(0x5DDFFD6A)
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)(0x67440B80)
I (include\drivers\mk_spi.h)(0x67206CDD)
I (include\components\hal\pan_rf.h)(0x676935DB)
I (include\drivers\PCA9555.h)(0x67693344)
I (include\board\board.h)(0x67206CDC)
I (include\drivers\mk_common.h)(0x67206CDC)
I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x5DDFFD72)
I (D:\keil\ARM\ARMCLANG\include\string.h)(0x5DDFFD6C)
@@ -1445,21 +1477,25 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_trace.h)(0x67206CDC)
I (include\drivers\mk_uart.h)(0x672473BD)
I (include\drivers\mk_dma.h)(0x672473BD)
I (..\keil\lora_3029.h)(0x672D87AC)
I (D:\keil\ARM\ARMCLANG\include\stdarg.h)(0x5DDFFD72)
I (include\drivers\mk_gpio.h)(0x67206CDC)
I (include\drivers\mk_io.h)(0x67206CDC)
F (.\include\components\hal\pan_rf.c)(0x672DD919)(-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 .. -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/pan_rf.o -MD)
I (include\drivers\mk_spi.h)(0x67206CDD)
I (..\keil\lora_3029.h)(0x67AC6E8C)
F (.\include\components\hal\pan_rf.c)(0x67693344)(-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 .. -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/pan_rf.o -MD)
I (include\components\hal\pan_port.h)(0x672050F0)
I (D:\keil\ARM\ARMCLANG\include\stdio.h)(0x5DDFFD72)
I (D:\keil\ARM\ARMCLANG\include\stdint.h)(0x5DDFFD72)
I (D:\keil\ARM\ARMCLANG\include\stdlib.h)(0x5DDFFD6A)
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)(0x67440B80)
I (include\components\hal\pan_param.h)(0x672050F0)
I (..\keil\lora_3029.h)(0x672D87AC)
I (include\drivers\mk_io.h)(0x67206CDC)
I (include\components\hal\pan_rf.h)(0x676935DB)
I (include\drivers\PCA9555.h)(0x67693344)
I (include\board\board.h)(0x67206CDC)
I (include\drivers\mk_common.h)(0x67206CDC)
I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x5DDFFD72)
I (D:\keil\ARM\ARMCLANG\include\string.h)(0x5DDFFD6C)
@@ -1471,4 +1507,12 @@
I (D:\keil\ARM\ARMCLANG\include\arm_compat.h)(0x5E0CC2EC)
I (D:\keil\ARM\ARMCLANG\include\arm_acle.h)(0x5E0CC318)
I (include\devices\MK800X\Include\system_MK800X.h)(0x67206CDC)
I (..\user_config.h)(0x672DDFDA)
I (..\user_config.h)(0x6760D510)
I (include\drivers\mk_trace.h)(0x67206CDC)
I (include\drivers\mk_uart.h)(0x672473BD)
I (include\drivers\mk_dma.h)(0x672473BD)
I (D:\keil\ARM\ARMCLANG\include\stdarg.h)(0x5DDFFD72)
I (include\drivers\mk_gpio.h)(0x67206CDC)
I (include\drivers\mk_io.h)(0x67206CDC)
I (include\components\hal\pan_param.h)(0x672050F0)
I (..\keil\lora_3029.h)(0x67AC6E8C)
keil/include/components/hal/pan_rf.c
@@ -9,6 +9,7 @@
#include "pan_port.h"
#include "pan_param.h"
#include "lora_3029.h"
#include "PCA9555.h"
/*
 * flag that indicate if a new packet is received.
*/
@@ -2343,6 +2344,7 @@
 * @param[in] <none>
 * @return result
 */
uint16_t rx_timeout=0;
void rf_irq_process(void)
{
    if(CHECK_IRQ())
@@ -2383,8 +2385,9 @@
        if(irq & REG_IRQ_RX_TIMEOUT)
        {
            rf_refresh();
            irq &= ~REG_IRQ_RX_TIMEOUT;
            rf_clr_irq(REG_IRQ_RX_TIMEOUT);
                irq &= ~REG_IRQ_RX_TIMEOUT;
                rf_clr_irq(REG_IRQ_RX_TIMEOUT);
                    rx_timeout++;
            rf_set_recv_flag(RADIO_FLAG_RXTIMEOUT);
        }
        if(irq & REG_IRQ_TX_DONE)
keil/include/components/hal/pan_rf.h
@@ -8,7 +8,7 @@
*******************************************************************************/
#ifndef __PAN_RF_H
#define __PAN_RF_H
#include "PCA9555.h"
#include "pan_port.h"
//#include "lora_3029.h"
/* result */
@@ -181,9 +181,11 @@
#define DEFAULT_SF                      SF_5
#define DEFAULT_BW                      BW_500K
#define DEFAULT_up_FREQ                 (473000000)
#define DEFAULT_up_FREQ                 (470000000)
#define DEFAULT_up_SF                   SF_5
#define DEFAULT_WG_SET_FREQ                 (478000000)
#define DEFAULT_WG_SET_SF                   SF_7
#define DEFAULT_CR                      CODE_RATE_45
         
keil/include/drivers/PCA9555.c
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,581 @@
#include "PCA9555.h"
uint8_t gps_led_output_state,tts_enbale_output_state,wake_up_output_state,air780e_enable_output_state,sos_enable_output_state,gps_backup_output_state,gps_power_output_state,main_ri_output_state;//1组output IO口从左到右1.0~1.7
uint8_t mcu_a_output_state,chg_g_output_state,lora_irq_output_state,lora_nrst_output_state,adc_minius_output_state,input_5v_output_state,pwr_on_output_state,pwr_enable_output_state;//2组output IO口从左到右0.0~0.7
uint8_t pca9555writedata_config[10];//暂存寄存器所有配置的数组
uint8_t pca9555writedata_output[10];//暂存输出高低电平配置的数组
uint8_t pca9555writedata_input[10];//暂存输入寄存器所有配置的数组
uint8_t pca9555writedata_polarity[10];//暂存输入极性反转寄存器所有配置的数组
void IIC_gpio_pca_init(void)
{
    io_pin_mux_set(SDA_PIN, IO_FUNC0);
    io_pin_mux_set(SCL_PIN, IO_FUNC0);
    gpio_pin_set_dir(SDA_PIN , GPIO_DIR_OUT, 1);
        //io_open_drain_set(SDA_PIN, 1);
    io_pull_set(SDA_PIN , IO_PULL_UP, IO_PULL_UP_LEVEL2);//输出高阻态
    gpio_pin_set_dir(SCL_PIN , GPIO_DIR_OUT, 1);
    //io_open_drain_set(SCL_PIN, 1);
    io_pull_set(SCL_PIN , IO_HIGH_Z, IO_PULL_UP_NONE);
}
void IIC2_pca_Start(void)
{
////        IIC2_SDA_OUT();     //sda线输出
//    SDA_1;
//        delay_us(10);
//    SCL_1;
//        delay_us(10);
//    SDA_0;//START:when CLK is high,DATA change form high to low
//    delay_us(10);
    //        IIC2_SDA_OUT();     //sda线输出
    SDA_1;
//        delay_us(10);
    SCL_1;
//        delay_us(10);
    SDA_0;//START:when CLK is high,DATA change form high to low
    delay_us(10);
    SCL_0;//钳住I2C总线,准备发送或接收数据
}
void IIC_pca_Ready(void)
{
        SCL_1;
      delay_us(10);
        SDA_1;
       delay_us(10);
}
//产生IIC停止信号
void IIC2_pca_Stop(void)
{
//    SDA_0;//STOP:when CLK is high DATA change form low to high
//
//    delay_us(10);
//    SCL_1;
//        delay_us(10);
//    SDA_1;//发送I2C总线结束信号
//    delay_us(10);
            SCL_0;
            SDA_0;//sToP:when ClK is high DATA change form low to high
            delay_us(10);
            SCL_1;
            //delay_us(10);
            SDA_1;//7发送I2C总线结束信号
            delay_us(10);
}
//等待应答信号到来
//返回值:1,接收应答失败
//        0,接收应答成功
uint8_t IIC2_Wait_pca_Ack(void)
{
    uint8_t ucErrTime=0;
//  IIC2_SDA_IN();
    gpio_pin_set_dir(SDA_PIN,GPIO_DIR_IN,1); //SDA设置为输入等待接收端的应答信号
     SDA_1;
    delay_us(6);
    SCL_1;
  delay_us(6);
//    SDA_1;
//    delay_us(6);
    while(IIC2_READ_SDA)
    {
        ucErrTime++;
        if(ucErrTime>250)
        {
            IIC2_pca_Stop();
                        gpio_pin_set_dir(SDA_PIN , GPIO_DIR_OUT, 1);
            return 1;
        }
    }
    gpio_pin_set_dir(SDA_PIN , GPIO_DIR_OUT, 0);
    SCL_0;//时钟输出0
    return 0;
}
//产生ACK应答
void IIC2_pca_send_Ack(void)
{
    SCL_0;
    SDA_0;//读取SDA电平为低则有应答
    delay_us(10);
    SCL_1;
        delay_us(10);
        SCL_0;
}
//不产生ACK应答
void IIC2_pca_send_NAck(void)
{
    SCL_0;
    SDA_1;//读取SDA电平为高则无应答信号
    delay_us(10);
    SCL_1;
        delay_us(10);
        SCL_0;
}
//IIC发送一个字节,WRITE
//返回从机有无应答
//1,有应答
//0,无应答
uint8_t statistic_num;
void IIC2_Send_pca_Byte(uint8_t txd)
{
    uint8_t t;
//        IIC2_SDA_OUT();
    SCL_0;//拉低时钟开始数据传输
//        delay_us(10);
    for(t=0; t<8; t++)
    {
        if((txd&0x80)>>7)
        {
            SDA_1;
        }
        else
        {
            SDA_0;
        }
        txd <<= 1;
        delay_us(10);
        SCL_1;
        delay_us(10);
        SCL_0;
        delay_us(10);
    }
//        statistic_num=txd;
//        SDA_1;//新增sda拉高
//        delay_us(10);
}
//读1个字节,ack=1时,发送ACK,ack=0,发送nACK,不是一样的
uint8_t IIC2_Read_pca_Byte(unsigned char ack)
{
    unsigned char i,receive=0,bit=0;
        gpio_pin_set_dir(SDA_PIN,GPIO_DIR_IN,0); //设置为输入读取电平
//        io_pull_set(SDA_PIN , IO_HIGH_Z, IO_PULL_UP_NONE);
    for(i=0; i<8; i++ )
    {
        SCL_0;
        delay_us(6);//修改时间
        SCL_1;
        //receive<<=1;
        if(IIC2_READ_SDA){
                    bit=1<<i;
                    receive|=bit;
                }
        delay_us(5);
    }
        SCL_0;
        if(ack==2){
        gpio_pin_set_dir(SDA_PIN,GPIO_DIR_OUT,0); //设置为输出恢复ACK
        }else{
        gpio_pin_set_dir(SDA_PIN,GPIO_DIR_OUT,1); //设置为输出恢复ACK
        }
//        io_pull_set(SDA_PIN , IO_PULL_UP, IO_PULL_UP_LEVEL2);//输出高阻态
//    if (!ack)
//        IIC2_pca_send_NAck();//发送nACK
//    else
//        IIC2_pca_send_Ack(); //发送ACK
    return receive;
}
/*********************************************************
//写pca9555第二层驱动,可辅助逻辑不破坏最底层驱动
  addr    èŠ¯ç‰‡åœ°å€ï¼Œ0x40表示第一个芯片地址
  low_byte  å†™å…¥èŠ¯ç‰‡çš„å‰å…«ä½æ•°æ®
  high_byte  å†™å…¥èŠ¯ç‰‡çš„å‰åŽä½æ•°æ®
*********************************************************/
//写pca9555第一层,最底层驱动
int temp_ack3,temp_ack4,temp_ack5,temp_ack6;
void IIC_Write_Pca9555(unsigned char addr,unsigned char reg_addr,unsigned char low_byte,unsigned char high_byte)
{
      IIC2_pca_Start();
      IIC2_Send_pca_Byte(addr & 0xfe);
      temp_ack3=IIC2_Wait_pca_Ack();
      IIC2_Send_pca_Byte(reg_addr);
      temp_ack4=IIC2_Wait_pca_Ack();
      IIC2_Send_pca_Byte(low_byte);
      temp_ack5=IIC2_Wait_pca_Ack();
      IIC2_Send_pca_Byte(high_byte);
      temp_ack6=IIC2_Wait_pca_Ack();
      IIC2_pca_Stop();
//        IIC2_Start();
//    IIC2_Send_Byte(addr & 0xfe);        //发送写命令
//    temp_ack3=IIC2_Wait_pca_Ack();
//    IIC2_Send_Byte(reg_addr);                    //发送地址
//    temp_ack4=IIC2_Wait_pca_Ack();
//    IIC2_Send_Byte(low_byte);     //发送字节
//    temp_ack5=IIC2_Wait_pca_Ack();
//        IIC2_Send_Byte(high_byte);     //发送字节
//        temp_ack6=IIC2_Wait_pca_Ack();
//    IIC2_Stop();//产生一个停止条件
}
/*
  //      IIC2_Start();
//    IIC2_Send_Byte(addr & 0xfe);        //发送写命令
//    temp_ack3=IIC2_Wait_Ack();
//    IIC2_Send_Byte(reg_addr);                    //发送地址
//    temp_ack4=IIC2_Wait_Ack();
//    IIC2_Send_Byte(low_byte);     //发送字节
//    temp_ack5=IIC2_Wait_Ack();
//        IIC2_Send_Byte(high_byte);     //发送字节
//        temp_ack6=IIC2_Wait_Ack();
//    IIC2_Stop();//产生一个停止条件
*/
int temp_ack,temp_ack1,temp_ack2;
 uint8_t temp=0;
void IIC_Read_Pca9555(uint8_t addr,uint8_t reg_addr,uint8_t* pBuffer,uint16_t num)
{
      IIC2_pca_Start();
      IIC2_Send_pca_Byte(addr & 0xfe);
      temp_ack=IIC2_Wait_pca_Ack();
      IIC2_Send_pca_Byte(reg_addr);
      temp_ack1=IIC2_Wait_pca_Ack();
      IIC2_pca_Start();
      IIC2_Send_pca_Byte(addr | 0x01);
      temp_ack2=IIC2_Wait_pca_Ack();
//        if(num==2){
//        pBuffer[0]=IIC2_Read_Byte(1);
//        pBuffer[1]=IIC2_Read_Byte(0);
//        }else{
//        pBuffer[0]=IIC2_Read_Byte(0);
//        }
      while (num)
      {
            *pBuffer = IIC2_Read_pca_Byte(num);
            if (num == 1)
            {
                IIC2_pca_send_NAck();
                //IIC2_NAck();
            }
            else
            {
                IIC2_pca_send_Ack();
                //IIC2_Ack();
            }
            pBuffer++;
            num--;
      }
      IIC2_pca_Stop();
//    IIC2_Start();
//    IIC2_Send_Byte(addr & 0xfe);         //发送写命令
//    IIC2_Wait_pca_Ack();
//    IIC2_Send_Byte(reg_addr);   //发送读地址
//    IIC2_Wait_pca_Ack();
//    IIC2_Start();
//    IIC2_Send_Byte(0x41);       //发送读命令,进入接收模式
//    IIC2_Wait_pca_Ack();
//    temp=IIC2_Read_Byte(0);
//    IIC2_Stop();                                //产生一个停止条件
}
/*写pca9555第二层驱动,可辅助逻辑不破坏最底层驱动,该函数默认配置输出寄存器
  addr    èŠ¯ç‰‡åœ°å€ï¼Œ0x40表示第一个芯片地址
  data_L  å†™å…¥èŠ¯ç‰‡çš„å‰å…«ä½æ•°æ®
  data_H  å†™å…¥èŠ¯ç‰‡çš„å‰åŽä½æ•°æ®
*/
void PCA9555_write_output_port_data(unsigned char addr,unsigned char data_L,unsigned char data_H)
{
        IIC_Write_Pca9555(addr,PCA9555_REG_OUT0,data_L,data_H);//    PCA9555_REG_OUT0 è¾“出寄存器0地址
        pca9555writedata_output[0]=    data_L;//保存该次设置数据
        pca9555writedata_output[1]=    data_H;
}
/*写pca9555第二层驱动,可辅助逻辑不破坏最底层驱动,该函数默认配置输出寄存器
  addr    èŠ¯ç‰‡åœ°å€ï¼Œ0x40表示第一个芯片地址
  data_L  å†™å…¥èŠ¯ç‰‡çš„å‰å…«ä½æ•°æ®
  data_H  å†™å…¥èŠ¯ç‰‡çš„å‰åŽä½æ•°æ®
*/
void PCA9555_write_config_port_data(unsigned char addr,unsigned char data_L,unsigned char data_H)
{
        IIC_Write_Pca9555(addr,PCA9555_REG_CFG0,data_L,data_H);//    PCA9555_REG_OUT0 è¾“出寄存器0地址
        pca9555writedata_config[0]=    data_L;//保存该次设置数据
        pca9555writedata_config[1]=    data_H;
}
/*写pca9555第二层驱动,可辅助逻辑不破坏最底层驱动,该函数默认配置输入极性翻转寄存器 1翻转 2不变
  addr    èŠ¯ç‰‡åœ°å€ï¼Œ0x40表示第一个芯片地址
  data_L  å†™å…¥èŠ¯ç‰‡çš„å‰å…«ä½æ•°æ®
  data_H  å†™å…¥èŠ¯ç‰‡çš„å‰åŽä½æ•°æ®
*/
void PCA9555_write_polarity_port_data(unsigned char addr,unsigned char data_L,unsigned char data_H)
{
        IIC_Write_Pca9555(addr,PCA9555_REG_POL0,data_L,data_H);//    PCA9555_REG_OUT0 è¾“出寄存器0地址
        pca9555writedata_polarity[0]=    data_L;//保存该次设置数据
        pca9555writedata_polarity[1]=    data_H;
}
/*读pca9555第二层驱动,可辅助逻辑不破坏最底层驱动
  addr     èŠ¯ç‰‡åœ°å€ï¼Œ0x40表示第一个芯片地址
  pBuffer  è¯»å‡ºèŠ¯ç‰‡çš„æ•°æ® 2个输入寄存器的值仅限输入模式使用
*/
void PCA9555_readdata(unsigned char addr,unsigned char* pBuffer)
{
        IIC_Read_Pca9555(addr,PCA9555_REG_IN0,pBuffer,2);//2为读出芯片数据组数,9555为2组,全部读出
}
/*读pca9555第二层驱动,可辅助逻辑不破坏最底层驱动
  addr     èŠ¯ç‰‡åœ°å€ï¼Œ0x40表示第一个芯片地址
  pBuffer  è¯»å‡ºèŠ¯ç‰‡çš„æ•°æ® 2个寄存器的值仅限输出模式,此模式下仅回复输入输出的控制模式的值,而非电平值
*/
void PCA9555_readdata_from_output_register(unsigned char addr,unsigned char* pBuffer)
{
        IIC_Read_Pca9555(addr,PCA9555_REG_OUT0,pBuffer,2);//2为读出芯片数据组数,9555为2组,全部读出
}
/*读pca9555第二层驱动,可辅助逻辑不破坏最底层驱动
  addr     èŠ¯ç‰‡åœ°å€ï¼Œ0x40表示第一个芯片地址
  pBuffer  è¯»å‡ºèŠ¯ç‰‡çš„æ•°æ® 2个寄存器的值仅限输出模式,此模式下仅回复输入输出的控制模式的值,而非电平值
*/
void PCA9555_readdata_from_polarity_register(unsigned char addr,unsigned char* pBuffer)
{
        IIC_Read_Pca9555(addr,PCA9555_REG_POL0,pBuffer,2);//2为读出芯片数据组数,9555为2组,全部读出
}
/*读pca9555第二层驱动,可辅助逻辑不破坏最底层驱动
  addr     èŠ¯ç‰‡åœ°å€ï¼Œ0x40表示第一个芯片地址
  pBuffer  è¯»å‡ºèŠ¯ç‰‡çš„æ•°æ® é…ç½®2个寄存器的数值
*/
void PCA9555_readdata_from_config_register(unsigned char addr,unsigned char* pBuffer)
{
        IIC_Read_Pca9555(addr,PCA9555_REG_CFG0,pBuffer,2);//2为读出芯片数据组数,9555为2组,全部读出
}
///*配置芯片的对应管脚输入输出功能
//  addr    èŠ¯ç‰‡åœ°å€ï¼Œ0x40表示第一个芯片地址
//  data_L  å†™å…¥èŠ¯ç‰‡çš„å‰å…«ä½æ•°æ® 1高阻抗输入 0输出 è¾“入寄存器默认上拉
//  data_H  å†™å…¥èŠ¯ç‰‡çš„å‰åŽä½æ•°æ®
//*/
//void PCA9555_config_gpio(unsigned char addr,unsigned char data_L,unsigned char data_H)
//{
//        IIC_Write_Pca9555(addr,PCA9555_REG_CFG0,data_L,data_H);//    PCA9555_REG_OUT0 è¾“出寄存器0地址
//}
/*设置所有输出
  value  æŽ§åˆ¶çš„IO输出状态 0:全部输出低 1:全部输出高
    ä»…限输出模式
*/
void PCA9555_Set_All_Output(unsigned char value)
{
        int i;
        for(i=0;i<4;i++){
            if(value==0)
                pca9555writedata_output[i]=0;
            else
                pca9555writedata_output[i]=0xff;
        }
        PCA9555_write_output_port_data(PCA9555_DEVICE_ADDR,pca9555writedata_output[0],pca9555writedata_output[1]);//全部输出为1或0
        //多芯片
        //PCA9555_writedata(PCA9555_REG_OUT0,pca9555writedata[2],pca9555writedata[3]);
}
/*设置第一个芯片某一通道IO高低输出仅限输出
  num    æŽ§åˆ¶çš„IO序号 1~16
  value  æŽ§åˆ¶çš„IO输出状态 0:低电平 1:高电平
*/
void PCA9555_Set_One_Value_Output(unsigned char num,unsigned char value)
{
     if(num >0 && num <17){//第一个芯片IO1-16控制
         if(num <9){
                if(value)pca9555writedata_output[0] |= 0x01<<(num - 1);//赋值位高
                else pca9555writedata_output[0] &= ~(0x01<<(num - 1));//赋值位低
            }
            else{
                if(value)pca9555writedata_output[1] |= 0x01<<(num - 9);//赋值位高
                else pca9555writedata_output[1] &= ~(0x01<<(num - 9));//赋值位低
            }
            PCA9555_write_output_port_data(PCA9555_DEVICE_ADDR,pca9555writedata_output[0],pca9555writedata_output[1]);
     }else{//超出芯片控制
             //error
     }
     //底下为多芯片逻辑
//     else if(num >16 && num <33){//第二个芯片IO1-16控制,使用更多IO以此类推,最多支持0x000~0x111 å…±8个芯片串联,共128个IO,如果不够可以使用PCA9505,40个IO,最多串联320个IO
//             if(num <25){
//                if(value)pca9555writedata[2] |= 0x01<<(num - 17);//赋值位高
//                else pca9555writedata[2] &= ~(0x01<<(num - 17));//赋值位低
//            }
//            else{
//                if(value)pca9555writedata[3] |= 0x01<<(num - 25);//赋值位高
//                else pca9555writedata[3] &= ~(0x01<<(num - 25));//赋值位低
//            }
//            PCA9555_writedata(PCA9555_REG_OUT1,pca9555writedata[2],pca9555writedata[3]);
//     }
//     else{//超出芯片控制
//             //error
//     }
}
/*设置第一个芯片某一通道IO输入或输出
  num    æŽ§åˆ¶çš„IO序号 1~17
  value  æŽ§åˆ¶çš„IO输出状态 0:输出 1:输入
*/
void PCA9555_Set_One_Value_Config(unsigned char num,unsigned char value)
{
     if(num >0 && num <17){//第一个芯片IO1-16控制
         if(num <9){
                if(value)pca9555writedata_config[0] |= 0x01<<(num - 1);//赋值位高
                else pca9555writedata_config[0] &= ~(0x01<<(num - 1));//赋值位低
            }
            else{
                if(value)pca9555writedata_config[1] |= 0x01<<(num - 9);//赋值位高
                else pca9555writedata_config[1] &= ~(0x01<<(num - 9));//赋值位低
            }
            PCA9555_write_config_port_data(PCA9555_DEVICE_ADDR,pca9555writedata_config[0],pca9555writedata_config[1]);
     }else{//超出芯片控制
             //error
     }
}
/*设置第一个芯片某一通道默认输入的极性
  num    æŽ§åˆ¶çš„IO序号 1~17
  value  æŽ§åˆ¶çš„IO输出状态 0:非使能 1:使能翻转为电平0
*/
void PCA9555_Set_One_Value_Polarity_input(unsigned char num,unsigned char value)
{
     if(num >0 && num <17){//第一个芯片IO1-16控制
         if(num <9){
                if(value)pca9555writedata_polarity[0] |= 0x01<<(num - 1);//赋值位高
                else pca9555writedata_polarity[0] &= ~(0x01<<(num - 1));//赋值位低
            }
            else{
                if(value)pca9555writedata_polarity[1] |= 0x01<<(num - 9);//赋值位高
                else pca9555writedata_polarity[1] &= ~(0x01<<(num - 9));//赋值位低
            }
            PCA9555_write_polarity_port_data(PCA9555_DEVICE_ADDR,pca9555writedata_polarity[0],pca9555writedata_polarity[1]);
     }else{//超出芯片控制
             //error
     }
}
/*读取5V引脚的输入高低电平
  è¿”回值 é«˜1 ä½Ž0 ç”µå¹³
*/
int read_5v_input_pca(void)
{PCA9555_readdata(PCA9555_DEVICE_ADDR,pca9555writedata_input);//读输入寄存器的值
    uint16_t gpio_state;
    gpio_state=(uint16_t)pca9555writedata_input[0]<<8|pca9555writedata_input[1];
    if(INPUT_5V_POSITION&gpio_state)
        return 1;
    else {
        return 0;
    }
}
/*读取供电引脚的输入高低电平
  è¿”回值 é«˜1 ä½Ž0 ç”µå¹³
*/
int read_powerkey_input_pca(void)
{PCA9555_readdata(PCA9555_DEVICE_ADDR,pca9555writedata_input);//读输入寄存器的值
    uint16_t gpio_state;
    gpio_state=(uint16_t)pca9555writedata_input[0]<<8|pca9555writedata_input[1];
    if(PWR_ON_POSITION&gpio_state)
        return 1;
    else {
        return 0;
    }
}
/*读取SOS引脚的输入高低电平
  è¿”回值 é«˜1 ä½Ž0 ç”µå¹³
*/
int read_userkey_input_pca(void)
{PCA9555_readdata(PCA9555_DEVICE_ADDR,pca9555writedata_input);//读输入寄存器的值
    uint16_t gpio_state;
    gpio_state=(uint16_t)pca9555writedata_input[0]<<8|pca9555writedata_input[1];
    if(SOS_ENBALE_POSITION&gpio_state)
    {
        return 1;
    }
    else
    {
        return 0;
    }
}
int read_userkey_input_pca_lora(uint8_t flag)
{
    PCA9555_readdata(PCA9555_DEVICE_ADDR,pca9555writedata_input);//读输入寄存器的值
    uint16_t gpio_state;
    gpio_state=(uint16_t)pca9555writedata_input[0]<<8|pca9555writedata_input[1];
    if(SOS_ENBALE_POSITION&gpio_state)
    {
        return flag=1;
    }
    else
    {
        return flag=0;
    }
}
void PCA9555_init()
{
//IIC_gpio_pca_init();//配置IIC管脚
    //PCA9555_write_config_port_data(PCA9555_DEVICE_ADDR,PCA_OUTPUT_CONFIG_MASK,PCA_OUTPUT_CONFIG_MASK);//全配置为输出
    //PCA9555_Set_One_Value_Polarity_input(PWR_ON,0);
    //PCA9555_write_config_port_data(PCA9555_DEVICE_ADDR,PCA_INPUT_CONFIG_MASK,PCA_INPUT_CONFIG_MASK);//全配置为输入
    //PCA9555_write_polarity_port_data(PCA9555_DEVICE_ADDR,0x00,0x00);//翻转
    //PCA9555_Set_One_Value_Config(WAKE_UP,1);
    //PCA9555_Set_All_Output(1);
    PCA9555_Set_One_Value_Config(GPS_POWER,0);//设置GPS为输出
    PCA9555_Set_One_Value_Output(GPS_POWER,1);//拉高GPS
    PCA9555_Set_One_Value_Config(ADC_MINIUS,0);//设置ADC输出
    PCA9555_Set_One_Value_Output(ADC_MINIUS,1);//默认拉高
    PCA9555_Set_One_Value_Config(MCU_A,0);//设置串口复用芯片切换
    PCA9555_Set_One_Value_Output(MCU_A,1);//输出高电平为uart通讯
    PCA9555_Set_One_Value_Config(INPUT_5V,1);//设置5V输入检测
    PCA9555_Set_One_Value_Config(GPS_LED,0);//设置LED灯输出
    PCA9555_Set_One_Value_Output(GPS_LED,1);//输出高电平开启LED通闪烁
    PCA9555_Set_One_Value_Config(PWR_ENABLE,0);//设置电池上电是否给单片机供电
    PCA9555_Set_One_Value_Output(PWR_ENABLE,1);//高电平默认导通单片机供电
    PCA9555_Set_One_Value_Config(PWR_ON,1);//设置开关机按键输入
    PCA9555_Set_One_Value_Config(SOS_ENBALE,1);//设置SOS按钮输入
//    PCA9555_Set_One_Value_Output(PWR_ON,0);//拉低
    //PCA9555_readdata_from_output_register(PCA9555_DEVICE_ADDR,pca9555writedata_input);
    //PCA9555_Set_One_Value_Output(AIR780E_ENBALE,0);
    //PCA9555_Set_One_Value_Output(PWR_ON,0);
//    PCA9555_Set_All_Output(0);
    //PCA9555_readdata_from_polarity_register(PCA9555_DEVICE_ADDR,pca9555writedata_input);
    PCA9555_readdata(PCA9555_DEVICE_ADDR,pca9555writedata_input);//读输入寄存器的值
    //PCA9555_readdata_from_config_register(PCA9555_DEVICE_ADDR,pca9555writedata_config);
//    PCA9555_Set_All_Output(0);//全部拉低
    //测试
//PCA9555_Set_All_Output(1);//全部拉高
//PCA9555_Set_All_Output(0);//全部拉低
}
void check_input_change(void)
{
        uint16_t gpio_state;
        gpio_state=(uint16_t)pca9555writedata_input[0]<<8|pca9555writedata_input[1];
        if(LORA_IRQ_POSITION&gpio_state)
        {
        }
        //uart_change_check(gpio_state);
}
static void pca_handler(enum IO_PIN_T pin)
{
        PCA9555_readdata(PCA9555_DEVICE_ADDR,pca9555writedata_input);//读输入寄存器的值
        check_input_change();
}
//void pca_input_detection_init(GPIO_IRQ_HANDLER_T irq_handler)
//{
//                pca_input_detect_irq_handler=irq_handler;
//                gpio_pin_set_dir(PCA_INPUT_DETECT , GPIO_DIR_IN, 0);
//        io_pull_set(PCA_INPUT_DETECT, IO_PULL_UP, IO_PULL_UP_LEVEL2);
//        gpio_enable_irq(PCA_INPUT_DETECT, GPIO_IRQ_TYPE_FALLING_EDGE, pca_input_detect_irq_handler);
//        power_wakeup_enable((enum POWER_WAKEUP_SOURCE_T)PCA_INPUT_DETECT, POWER_WAKEUP_LEVEL_LOW);
//}
keil/include/drivers/PCA9555.h
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,86 @@
#include "board.h"
#define IIC2_READ_SDA gpio_pin_get_val(SDA_PIN)
#define SDA_1 gpio_pin_set(SDA_PIN)
#define SCL_1    gpio_pin_set(SCL_PIN)
#define  PCA9555_SLA             (0x40 >> 1)                 //  å®šä¹‰PAC9555的器件地址
#define  PCA9555_REG_IN0         0x00                        //  å®šä¹‰è¾“入寄存器0地址
#define  PCA9555_REG_IN1         0x01                        //  å®šä¹‰è¾“入寄存器1地址
#define  PCA9555_REG_OUT0        0x02                        //  å®šä¹‰è¾“出寄存器0地址
#define  PCA9555_REG_OUT1        0x03                        //  å®šä¹‰è¾“出寄存器1地址
#define  PCA9555_REG_POL0        0x04                        //  å®šä¹‰æžæ€§åè½¬å¯„存器0地址
#define  PCA9555_REG_POL1        0x05                        //  å®šä¹‰æžæ€§åè½¬å¯„存器1地址
#define  PCA9555_REG_CFG0        0x06                        //  å®šä¹‰æ–¹å‘配置寄存器0地址
#define  PCA9555_REG_CFG1        0x07                        //  å®šä¹‰æ–¹å‘配置寄存器1地址
#define  PCA9555_DEVICE_ADDR     0x40                        //  å®šä¹‰PCA9555地址
#define  PCA_OUTPUT_CONFIG_MASK 0x00
#define  PCA_INPUT_CONFIG_MASK 0xff
#define  SDA_0 gpio_pin_clr(SDA_PIN)
#define  SCL_0 gpio_pin_clr(SCL_PIN)
//输出和配置
#define MAX_GPIO_NUM 16
//0组
#define  MCU_A             0x01
#define  CHG_G             0x02
#define  LORA_IRQ     0x03
#define  LORA_NRST     0x04
#define  ADC_MINIUS 0x05
#define  INPUT_5V     0x06
#define  PWR_ON         0x07
#define  PWR_ENABLE 0x08
//1组
#define GPS_LED      0x09
#define TTS_ENABLE 0x0A
#define WAKE_UP      0x0B
#define AIR780E_ENBALE 0x0C
#define SOS_ENBALE 0x0D
#define GPS_BACKUP 0x0E
#define GPS_POWER  0x0F
#define MAIN_RI    0x10
//输入寄存器INT判断数组对应位置
//input 0组
#define MCU_A_POSITION  (1<<(MAX_GPIO_NUM-MCU_A))
#define CHG_G_POSITION  (1<<(MAX_GPIO_NUM-CHG_G))
#define LORA_IRQ_POSITION  (1<<(MAX_GPIO_NUM-LORA_IRQ))
#define LORA_NRST_POSITION  (1<<(MAX_GPIO_NUM-LORA_NRST))
#define ADC_MINIUS_POSITION  (1<<(MAX_GPIO_NUM-ADC_MINIUS))
#define INPUT_5V_POSITION  (1<<(MAX_GPIO_NUM-INPUT_5V))
#define PWR_ON_POSITION  (1<<(MAX_GPIO_NUM-PWR_ON))
#define PWR_ENABLE_POSITION  (1<<(MAX_GPIO_NUM-PWR_ENABLE))
//input 1组
#define GPS_LED_POSITION  (1<<(MAX_GPIO_NUM-GPS_LED))
#define TTS_ENABLE_POSITION  (1<<(MAX_GPIO_NUM-TTS_ENABLE))
#define WAKE_UP_POSITION  (1<<(MAX_GPIO_NUM-WAKE_UP))
#define AIR780E_ENBALE_POSITION  (1<<(MAX_GPIO_NUM-AIR780E_ENBALE))
#define SOS_ENBALE_POSITION  (1<<(MAX_GPIO_NUM-SOS_ENBALE))
#define GPS_BACKUP_POSITION  (1<<(MAX_GPIO_NUM-GPS_BACKUP))
#define GPS_POWER_POSITION  (1<<(MAX_GPIO_NUM-GPS_POWER))
#define MAIN_RI_POSITION  (1<<(MAX_GPIO_NUM-MAIN_RI))
//uint8_t gps_led_output_state,tts_enbale_output_state,wake_up_output_state,air780e_enable_output_state,sos_enable_output_state,gps_backup_output_state,gps_power_output_state,main_ri_output_state;//1组output IO口从左到右1.0~1.7
//uint8_t mcu_a_output_state,chg_g_output_state,lora_irq_output_state,lora_nrst_output_state,adc_minius_output_state,input_5v_output_state,pwr_on_output_state,pwr_enable_output_state;//2组output IO口从左到右0.0~0.7
void IIC_gpio_pca_init(void);
void IIC2_pca_Start(void);
void IIC_pca_Ready(void);
void IIC2_pca_Stop(void);
uint8_t IIC2_Wait_pca_Ack(void);
void IIC2_pca_send_Ack(void);
void IIC2_pca_send_NAck(void);
void IIC2_Send_pca_Byte(uint8_t txd);
uint8_t IIC2_Read_pca_Byte(unsigned char ack);
void IIC_Write_Pca9555(unsigned char addr,unsigned char reg_addr,unsigned char low_byte,unsigned char high_byte);
void IIC_Read_Pca9555(uint8_t addr,uint8_t reg_addr,uint8_t* pBuffer,uint16_t num);
void PCA9555_write_output_port_data(unsigned char addr,unsigned char data_L,unsigned char data_H);
void PCA9555_write_config_port_data(unsigned char addr,unsigned char data_L,unsigned char data_H);
void PCA9555_readdata(unsigned char addr,unsigned char* pBuffer);
void PCA9555_Set_All_Output(unsigned char value);
void PCA9555_Set_One_Value_Output(unsigned char num,unsigned char value);
void PCA9555_Set_One_Value_Config(unsigned char num,unsigned char value);
void PCA9555_Set_One_Value_Polarity_input(unsigned char num,unsigned char value);
void PCA9555_init();
//拓展函数
int read_userkey_input_pca_lora(uint8_t flag);
keil/include/drivers/uwb_tag_.c
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,492 @@
#include "mk_trace.h"
#include "mk_uwb.h"
#include "mk_phy.h"
#include "mk_misc.h"
#include "mk_power.h"
#include "mk_sleep_timer.h"
#include "lib_ranging.h"
#include "dw_app.h"
#include "board.h"
#include "mk_calib.h"
#if defined(MK_SS_TWR_DW_INIT)
extern int TagRange(void);
/* Ranging period: 1s */
#define RANGING_PERIOD_MS (1000)
/* This is the delay from the end of the poll frame transmission to the enable of the receiver */
#define POLL_TX_TO_RESP_RX_DLY_US 750U  //yuan700
#define RESP_RX_TO_FINAL_TX_DLY_US 550U
/* Poll delay: 1s */
#define POLL_DELAY  100U //yuan100U
/* Receive response timeout */
#define RESP_RX_TIMEOUT_US 2500U //Yuan500 10mssuccess 300jixian
/* Field index in frame */
#define MSG_SEQ_NUM_IDX 2
#define FINAL_MSG_POLL_TX_TS_IDX 10
#define FINAL_MSG_RESP_RX_TS_IDX 14
#define FINAL_MSG_FINAL_TX_TS_IDX 18
#define DELAY_DEFAULT 50000
#define DELAY_BETWEEN_TWO_FRAME_UUS 600  //yuan1400
#define HALF_SECOND_TIME 62400000
uint16_t CmpTagInList(uint16_t tagid);
uint16_t AddNewTagIntoList(uint16_t tagid);
void AnchorListUpdate(void);
void Rank_ANchor_list_by_dis(void);
struct mk_uwb_configure
{
    uint8_t phy_work_mode; /* PHY_TX / PHY_RX / PHT_TX|PHY_RX */
    struct UWB_CONFIG_T phy_cfg;
};
uint32_t dev_id;
uint8_t group_id;
/* Default communication configuration. */
static struct mk_uwb_configure config = {//yuan
    .phy_work_mode = (uint8_t)(PHY_TX | PHY_RX),
    .phy_cfg.ch_num = 5,                      /* Channel number.                           */
    .phy_cfg.code_index = 9,                  /* TRX preamble code                         */
    .phy_cfg.mean_prf = MEAN_PRF_64M,         /* Mean prf 64/128/256M                      */
    .phy_cfg.data_bit_rate = DATA_BR_6M8,     /* Data rate 6.8M                            */
    .phy_cfg.sync_sym = PREAM_LEN_128,        /* Preamble duration, length of preamble 128 */
    .phy_cfg.sfd_sym = NON_STD_NSFD5_8,          /* Identifier for SFD sequence               */
    .phy_cfg.ranging_bit = 1,                 /* ranging bit set 1                         */
    .phy_cfg.trx_mode = TRX_MODE_15_4A,  /* IEEE802.15.4z - BPRF mode                 */
    .phy_cfg.sts_pkt_cfg = STS_PKT_CFG_0,     /* SP0 Frame                                 */
    .phy_cfg.sts_segnum = STS_SEGNUM_BPRF_1,  /* Number of STS segments in the frame       */
    .phy_cfg.sts_seglen = STS_SEGLEN_BPRF_64, /* Number of symbols in an STS segment       */
    .phy_cfg.rx_ant_id = UWB_RX_ANT_3,    /* UWB RX antenna port                       */
};
///* Default communication configuration. */
//static struct mk_uwb_configure config = {
//    .phy_work_mode = (uint8_t)(PHY_TX | PHY_RX),
//    .phy_cfg.ch_num = 5,                      /* Channel number.                           */
//    .phy_cfg.code_index = 3,                  /* TX preamble code.                         */
//    .phy_cfg.mean_prf = MEAN_PRF_16M,         /* Data rate 6.8M                            */
//    .phy_cfg.data_bit_rate = DATA_BR_110K,     /* data rate 6.8M.                           */
//    .phy_cfg.sync_sym = PREAM_LEN_1024,        /* Preamble duration, length of preamble 128 */
//    .phy_cfg.sfd_sym = NSFD_64,          /* Identifier for SFD sequence               */
//    .phy_cfg.ranging_bit = 1,                 /* ranging bit set.                          */
//    .phy_cfg.trx_mode = TRX_MODE_15_4A,  /* IEEE802.15.4z - BPRF mode                 */
//    .phy_cfg.sts_pkt_cfg = STS_PKT_CFG_0,     /* SP0 Frame                                 */
//    .phy_cfg.sts_segnum = STS_SEGNUM_BPRF_1,  /* Number of STS segments in the frame       */
//    .phy_cfg.sts_seglen = STS_SEGLEN_BPRF_64, /* Number of symbols in an STS segment       */
//    .phy_cfg.rx_ant_id = UWB_RX_ANT_3,    /* UWB RX antenna port                       */
//};
/* Buffer to store received frame */
static uint8_t rx_buf[150];
static uint8_t uwb_sendbuffer[150];
/*     Frames used in the ranging process
 *     Poll message:
 *     - byte 0 - 1: 0x8841 to indicate a data frame using 16-bit addressing.
 *     - byte 2: sequence number, incremented for each new frame.
 *     - byte 3 - 4: PAN Id 0x4B4d
 *     - byte 5 - 6: Destination address
 *     - byte 7 - 8: Source address
 *     - byte 9: Message type (0x02 RANGING_POLL / 0x03 RANGING_RESPONSE / 0x04 RANGING_FINAL)
 *     Response message:
 *     - byte 10: activity code (0x07 to tell the initiator to go on with the ranging exchange)
 *     Final message:
 *     - byte 10 - 13: poll message transmission timestamp.
 *     - byte 14 - 17: response message reception timestamp.
 *     - byte 18 - 21: final message transmission timestamp.
 */
static uint8_t tx_poll_msg[] = {0x41, 0x88, 0, 0x4D, 0x4B, 0x53, 0x45, 0x4D, 0x49, 0x02};
static uint8_t rx_resp_msg[] = {0x41, 0x88, 0, 0x4D, 0x4B, 0x4D, 0x49, 0x53, 0x45, 0x03, 0x07};
static uint8_t tx_final_msg[] = {0x41, 0x88, 0, 0x4D, 0x4B, 0x53, 0x45, 0x4D, 0x49, 0x04, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
/* Count value of phy counter when transmitting and receiving frames */
static uint32_t poll_tx_en_start_u32;
static uint32_t resp_rx_en_start_u32;
static uint32_t final_tx_en_start_u32;
/* 41 bits timestamps of frames transmission/reception. */
static int64_t poll_tx_ts_i64;
static int64_t resp_rx_ts_i64;
static int64_t final_tx_ts_i64;
/* Frame sequence number, incremented after each transmission. */
static uint8_t frame_seq_nb = 0;
static volatile uint16_t rx_state;
static volatile uint16_t rx_state1;
static volatile uint16_t rx_length;
//DW
uint16_t rec_nearbaseid;
uint8_t temp_tag_num;
int32_t test2;
static uint8_t receive_flag=0;
static uint8_t rec_tag_index,tag_num_tosend;
uint32_t start_receive_count,end_receive_count,poll_timeout,current_count,temp_resp;
uint16_t  taglist_total_num,taglist_current_index;  //当前列表总数量
uint8_t  taglist_keeptime[MAX_TAG_LIST_NUM]; //每个标签存活时间
uint16_t taglist_id[MAX_TAG_LIST_NUM],taglist_dist[MAX_TAG_LIST_NUM]; //标签距离和标签的ID
int32_t mainbase_dist,nearbase_distlist[MAX_NEARBASE_NUM],true_nearbase_distlist[MAX_NEARBASE_NUM],true_exsistbase_list[MAX_NEARBASE_NUM],ancsync_time,nextpoll_delaytime,offsettimeus;
uint8_t anclost_times=0 , mainbase_lost_count=0,exsistbase_list[MAX_NEARBASE_NUM],get_newbase=0,nearbase_num,last_nearbase_num,next_nearbase_num;
uint16_t nearbaseid_list[MAX_NEARBASE_NUM],mainbase_id,true_nearbase_idlist[MAX_NEARBASE_NUM],rec_nearbaseid,rec_nearbasepos;
uint16_t u16_nearbase_distlist[MAX_NEARBASE_NUM];
uint32_t temp_count1=0;
uint32_t temp_count2=0;
uint32_t temp_count3=0;
uint32_t temp_count4=0;
uint32_t tempflag=0;
int32_t freq_offset,freq_offset_filter;
int temp_flag,poll_tx_num,resp_rx_num;
extern double distance;
uint32_t count1,count2;
enum SIMPLE_FSM_T
{
    SIMPLE_IDLE = 0,
    SIMPLE_POLL = 1,
    SIMPLE_RESPONSE = 2,
    SIMPLE_FINAL = 3,
};
void uwb_poll_buffer_construct(void)
{
    for(uint8_t i=0;i<nearbase_num;i++)   //标签距离32位转成16位
{
    u16_nearbase_distlist[i] = nearbase_distlist[i];
}
        uwb_sendbuffer[GROUP_ID_IDX] = group_id;
        memcpy(&uwb_sendbuffer[TAG_ID_IDX],&dev_id,2);
    //uwb_sendbuffer[BATTARY_IDX] = bat_percent;
    uwb_sendbuffer[SEQUENCE_IDX] = frame_seq_nb++;
        uwb_sendbuffer[NEARBASENUM_INDEX] = nearbase_num;
        memcpy(&uwb_sendbuffer[NEARBASEID_INDEX],&nearbaseid_list,nearbase_num*2);//基站id
    memcpy(&uwb_sendbuffer[NEARBASEID_INDEX+nearbase_num*2],&u16_nearbase_distlist,nearbase_num*2);
        uwb_sendbuffer[MESSAGE_TYPE_IDX] = MBX_POLL;
        memcpy(&uwb_sendbuffer[ANCHOR_ID_IDX],&mainbase_id,2);
}
static enum SIMPLE_FSM_T state = SIMPLE_IDLE;
/**
 * @brief Correct TX timestamp of the ranging frame.
 *
 * @param[in] timestamp    PHY timer count of TX
 * @return TX timestamp (unit: 15.65ps)
 */
static int64_t ranging_tx_time_correct(uint32_t timestamp)
{
    int64_t tx_timestamp = ranging_tx_time(timestamp);
    // correct antenna delay (TX using the same antenna as RX)
    tx_timestamp += ranging_ant_delays_get(config.phy_cfg.rx_ant_id) / 2;
    return tx_timestamp;
}
/**
 * @brief Correct RX timestamp of the ranging frame.
 *
 * @param[in] ind    MAC RX report
 * @return RX timestamp (unit: 15.65ps)
 */
static int64_t ranging_rx_time_correct(const struct MAC_HW_REPORT_T *ind)
{
    int64_t rx_timestamp = ranging_rx_time(ind);
    // correct antenna delay
    rx_timestamp -= ranging_ant_delays_get(config.phy_cfg.rx_ant_id) / 2;
    return rx_timestamp;
}
/* RX done process handler. */
static void rx_int_callback(struct MAC_HW_REPORT_T *rx_report)
{
    // Power off radio
    power_off_radio();
    rx_state = rx_report->err_code;
    /** UWB RX success */
    if (rx_state == UWB_RX_OK)
    {
        /* Received data does not contain FCS */
        rx_length = rx_report->pkt_len;
        memcpy(rx_buf, rx_report->pkt_data, rx_length);
        /* Calculate rx timestamp */
        resp_rx_ts_i64 = ranging_rx_time_correct(rx_report);
                temp_count1=phy_timer_count_get();
                    //获取发射端时钟偏差
            resp_rx_num++;
            freq_offset=phy_freq_offset_get();
        //    freq_offset_filter=average_filter(freq_offset);//获取频偏
            //int32_t ppm = freq_offset_filter / (int32_t)(ch_center_freq_map[UWB_CH_NUM] * 1e-6);
            //calib_xtal38m4_load_cap_auto_tune(ppm);//利用电容调整晶振适配频偏应在完整的一包之后调整,需要关闭XTAL_AUTO_TUNE_EN å®å®šä¹‰é¿å…æ”¶åŒ…中途校准导致测距错误
            //LOG_INFO(TRACE_MODULE_APP, "poll_tx_num is %d,resp_rx_num is %d,distance is %lf\r\n",poll_tx_num,resp_rx_num,distance);
            receive_flag=1;
    }
    else
    {
        /* UWB_PLD_ERR     payload error             */
        /* UWB_PHR_ERR     PHR error                 */
        /* UWB_SFD_ERR     Sfd error                 */
        /* UWB_BD_ERR      Preamble detection error  */
        /* UWB_TO_ERR      Receive timeout           */
        /* UWB_STS_ERR     STS error                 */
                rx_state1=rx_report->err_code;
        rx_length = 0;
                receive_flag=2;
            temp_count2=phy_timer_count_get();
    }
}
/* TX done process handler. */
static void tx_int_callback(struct MAC_HW_REPORT_T *tx_report)
{
    // Power off radio
    power_off_radio();
    /** UWB TX success */
    if (tx_report->err_code == UWB_TX_OK)
    {
            poll_tx_num++;
            temp_count4=phy_timer_count_get();//测试
            if(temp_flag){
                count2=phy_timer_count_get();
                temp_flag=0;
                return;
            }
            count1=temp_count1;
                temp_flag=1;
    }
}
//注意:因为新注册的标签并不知道基站已经收到了,所以要在下一包立刻将新的标签ID发出,否则标签会一直抢占基站的poll包。
//方法是将新注册的标签添加到下次发送的标签列表头部,其他标签依次向后挪动。
uint16_t AddNewTagIntoList(uint16_t tagid)
{
     uint16_t newindex_cal = taglist_current_index+25;//当前索引+25,为下次索引要发出的值的最大值,如果总数小于这个值,即可放到最后面。
      if(newindex_cal>=taglist_total_num) //如果当前索引是最后一包,那么就加到总索引的后面,如果不是就加到下一次起始索引位置。
      {
        newindex_cal = taglist_total_num;
      }else{
         for(uint16_t i=taglist_total_num;i>newindex_cal;i--)  //从后往前挪地方??就是插入
            {
                taglist_id[i]=taglist_id[i-1];
                taglist_dist[i]=taglist_dist[i-1];
                taglist_keeptime[i]=taglist_keeptime[i-1];
            }
      }
      taglist_total_num++;
      taglist_id[newindex_cal] = tagid;
      taglist_dist[newindex_cal] = 0;
      taglist_keeptime[newindex_cal] = TAG_KEEPTIMES;
      return newindex_cal;
}
uint8_t FindNearBasePos(uint16_t baseid)//寻找当前列表中的基站返回索引
{
    uint8_t i;
    for(i=0;i<nearbase_num;i++)
    {
        if(baseid==nearbaseid_list[i])
            return i;
    }
    if(i==nearbase_num)
        return nearbase_num;
}
void AnchorListUpdate(void)
{
    next_nearbase_num = 0;
            int j=0;
            for(int i=0;i<nearbase_num;i++)
            {
                if(exsistbase_list[i]>0)
                {
          exsistbase_list[i]--;
                    next_nearbase_num++;
                    true_exsistbase_list[j]=exsistbase_list[i];
                    true_nearbase_idlist[j]=nearbaseid_list[i];
                    true_nearbase_distlist[j++]=nearbase_distlist[i];
                }
            }
            nearbase_num = next_nearbase_num;//更新现存基站数
            last_nearbase_num = next_nearbase_num;//更新当前基站数
}
void Rank_ANchor_list_by_dis(void)//按照目前的基站距离进行冒泡排序用临时数组方式将最近的放到最前面,最远的放到最后面
{
for(int i=0;i<last_nearbase_num-1;i++)
            {
                for(int j=0;j<last_nearbase_num-1;j++)
                {
                    if(true_nearbase_distlist[j]>true_nearbase_distlist[j+1])
                    {
                        uint32_t temp_dist,temp_id,temp_exsis;
                        temp_dist=true_nearbase_distlist[j];
                        temp_id = true_nearbase_idlist[j];
                        temp_exsis=true_exsistbase_list[j];
                        true_nearbase_distlist[j]=true_nearbase_distlist[j+1];
                        true_nearbase_idlist[j]=true_nearbase_idlist[j+1];
                        true_exsistbase_list[j]=true_exsistbase_list[j+1];
                        true_nearbase_distlist[j+1]=temp_dist;
                        true_nearbase_idlist[j+1]=temp_id;
                        true_exsistbase_list[j+1]=temp_exsis;
                    }
                }
            }
            for (int i=0;i<last_nearbase_num;i++)
            {
                nearbaseid_list[i]=true_nearbase_idlist[i];
                nearbase_distlist[i]=true_nearbase_distlist[i];
                exsistbase_list[i] = true_exsistbase_list[i];
            }
}
uint16_t CmpTagInList(uint16_t tagid)//找这个新一包的基站在不在现存的taglist中在的话对应位置更新存活时间,不在就增加(确保有效数量小于最大设置数)
{
    uint16_t temp;
    for(uint8_t i=0;i<taglist_total_num;i++)
    {
        if(memcmp(&tagid,&taglist_id[i],2)==0)
        {
            taglist_keeptime[i] = TAG_KEEPTIMES;
            return i;
        }
    }
    if(taglist_total_num<MAX_TAG_LIST_NUM)
    temp = AddNewTagIntoList(tagid);
    return temp;
}
uint32_t count_index;
int tt=1;
int TagRange(void)
{
    // The following peripherals will be initialized in the uwb_open function
    // phy/mac/aes/lsp/phy timers initialized
    uwb_open();
    // Set calibration parameters
    uwb_calibration_params_set(config.phy_cfg.ch_num);
    // set advanced parameters
     struct PHY_ADV_CONFIG_T adv_config = {
        .thres_fap_detect = 40,
        .nth_scale_factor = 4,
        .ranging_performance_mode = 0,
        .skip_weakest_port_en = 0,
    };
    phy_adv_params_configure(&adv_config);
    // uwb configure
    uwb_configure(config.phy_work_mode, board_param.tx_power_fcc[CALIB_CH(config.phy_cfg.ch_num)], &config.phy_cfg);
    ranging_frame_type_set(config.phy_cfg.sts_pkt_cfg);
    // Register rx interrupt callback function
    mac_register_process_handler(tx_int_callback, rx_int_callback);
//#if LOW_POWER_EN
//    // Initialize low power mode
//    power_init();
//    // Enable sleep timer
//    sleep_timer_open(true, SLEEP_TIMER_MODE_ONESHOT, NULL);
//#endif
        uwb_poll_buffer_construct();
        temp_tag_num=0;//临时数量为0
        poll_tx_en_start_u32 = phy_timer_count_get()+US_TO_PHY_TIMER_COUNT(POLL_DELAY);//发送必须要延时发送才可以用于测距否则立即发送会获取时间戳不对,需要计算程序运行时间,避免设置过去时间
        tempflag=uwb_tx(uwb_sendbuffer,13+4*nearbase_num,1,poll_tx_en_start_u32);//立即发送
        #ifdef BOXING
        gpio_pin_set(IO_PIN_5);//测试
        #endif
        //LOG_INFO(TRACE_MODULE_APP, "进入测距",poll_tx_num,resp_rx_num,distance);
        poll_tx_ts_i64 = ranging_tx_time_correct(poll_tx_en_start_u32 + phy_shr_duration());//修正时间戳
        temp_count1=phy_timer_count_get();
        while(mac_is_busy());//等待发送完成
        gpio_pin_clr(IO_PIN_5);//测试
        gpio_pin_set(IO_PIN_5);//测试
        temp_count2=phy_timer_count_get();
        resp_rx_en_start_u32 =  poll_tx_en_start_u32+ US_TO_PHY_TIMER_COUNT(POLL_TX_TO_RESP_RX_DLY_US);//设置发送多少s后接收按target独立时间起点算+ US_TO_PHY_TIMER_COUNT(POLL_TX_TO_RESP_RX_DLY_US为发送后要多久开启接收时间
        temp_resp=resp_rx_en_start_u32;
    //tempflag=uwb_rx(1, resp_rx_en_start_u32, RESP_RX_TIMEOUT_US);//开启接受并设置接收超时
    tempflag=uwb_rx(0,0, RESP_RX_TIMEOUT_US);
    start_receive_count=phy_timer_count_get();
    poll_timeout=nearbase_num*US_TO_PHY_TIMER_COUNT(DELAY_BETWEEN_TWO_FRAME_UUS)+US_TO_PHY_TIMER_COUNT(RESP_RX_TIMEOUT_US);//多一个多0.4ms默认0.4ms计算为0.125*4*100000,默认开启1mss
    end_receive_count=start_receive_count+poll_timeout;
    if(end_receive_count>=UINT32_MAX)
    {end_receive_count-=UINT32_MAX;}
    current_count=phy_timer_count_get();
    count_index=end_receive_count+HALF_SECOND_TIME;
//    if(tt){
    while(current_count<end_receive_count||current_count>end_receive_count+HALF_SECOND_TIME)//循环接受包体,若为124.8K则是+62400000
        {
        current_count=phy_timer_count_get();//不断刷新当前计数器值
        temp_count2=phy_timer_count_get();
        while(mac_is_busy());//等待接收完成
        temp_count3=phy_timer_count_get();
        if(receive_flag==1)//成功接收数据
        {
            receive_flag=0;
    tempflag=uwb_rx(0, 0, RESP_RX_TIMEOUT_US);//立即开启接受并设置0超时
            //接收成功则判断是否为同一组
            if (rx_buf[MESSAGE_TYPE_IDX] == MBX_RESPONSE&&!memcmp(&rx_buf[TAG_ID_IDX],&dev_id,2)&&rx_buf[GROUP_ID_IDX]==group_id) //判断接收到的数据是否是response数据
                            {
                                    memcpy(&rec_nearbaseid,&rx_buf[ANCHOR_ID_IDX],2);
                                    rec_nearbasepos=FindNearBasePos(rec_nearbaseid);
                                    SetANCTimestap(rec_nearbasepos,&rx_buf[RESP_MSG_POLL_RX_TS_IDX],&rx_buf[RESP_MSG_RESP_TX_TS_IDX],(uint32_t)resp_rx_ts_i64,&rx_buf[RESP_MSG_ANC_DISTOFFSET],test2,(uint32_t)poll_tx_ts_i64);
                                    if(rec_nearbasepos>=nearbase_num)          //发现新的基站
                                    {
                                        //get_newbase=1;
                                        nearbase_num++;
                                        nearbaseid_list[rec_nearbasepos] = rec_nearbaseid;
                                    }
                                    exsistbase_list[rec_nearbasepos]=KEEP_TIMES;//更新存活时间
                            memset(rx_buf, 0, sizeof(rx_buf));//清空接收到的用完的数组
                            rx_length=0;//清0长度
//                            uwb_rx(0, 0, RESP_RX_TIMEOUT_US);//立即开启接受并设置0超时
//                            while(mac_is_busy());
                            //break;//成功接收就退出
        }
//                #ifdef BOXING
//        gpio_pin_clr(IO_PIN_5);//测试
//            #endif
        }else if(receive_flag==2){//接收出错
        receive_flag=0;
        tempflag=uwb_rx(0, 0, RESP_RX_TIMEOUT_US);//立即开启接受并设置0超时
        temp_count3=phy_timer_count_get();
//        while(mac_is_busy());
        temp_count1=phy_timer_count_get();
        }
    #ifdef BOXING
        gpio_pin_clr(IO_PIN_5);//测试
        gpio_pin_set(IO_PIN_5);//测试
        #endif
        }
//    }
        #ifdef BOXING
        gpio_pin_clr(IO_PIN_5);//测试
        #endif
        delay_us(1);
        uwb_rx_force_off(1);
        //dwt_forecetrxoff();
         CalculateDists(poll_tx_ts_i64); //计算距离并更新距离表
         AnchorListUpdate();//更新存活基站列表
    //     Rank_ANchor_list_by_dis();//冒泡排序重新按距离重新排列基站列表最小距离存货基站放到最前面
}
#endif
keil/include/main/main.c
@@ -67,6 +67,8 @@
//#include "pan_param.h"
//#include "pan_rf.h"
#include "lora_3029.h"
#include "pan_rf.h"
#include "PCA9555.h"
#define DEBUG_MODE
extern int simple_main(void);
extern int temp_main(void);
@@ -287,9 +289,16 @@
    nomove_count++;
}
uint8_t flag_sleeptimer,flag_secondtask,secondtask_count;
uint8_t  lora_wg_up=0;
extern uint8_t lora_tx_flag;
static void sleep_timer_callback(void *dev, uint32_t time)
{
    g_start_send_flag=1;
    //        #ifdef DEBUG_BOXING
////        gpio_pin_clr(IO_PIN_5);//测试
    //    gpio_pin_set(IO_PIN_5);//测试
      // lora_wg_up=1;
       lora_tx_flag++;
//    IO_control_init();
//    UWBPoll();
//    
@@ -514,57 +523,194 @@
uint32_t successful_cnt=0;
uint8_t flag_4guart_needinit=0;
#define TX_LEN  10
#define RX_LEN  100
#define RX_LEN  200
uint8_t tx_test_buf[TX_LEN] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
uint8_t RF_RX_temp[RX_LEN]={0};
extern uint8_t RX_Buffer[RX_LEN];
extern uint16_t BufferSize;
static uint16_t source_id;
extern struct RxDoneMsg RxDoneParams;
uint32_t time_flag_lorarx=0;
uint32_t lora_huanxing_count=0;
static void Lora_irq_handler(enum IO_PIN_T pin)
{
   ceshi++;
    rf_irq_process();
          //g_start_send_flag=1;
        if(rf_get_transmit_flag() == RADIO_FLAG_TXDONE)
        {
           rf_set_transmit_flag(RADIO_FLAG_IDLE);
           rf_enter_continous_rx();
        }
        if(rf_get_recv_flag() == RADIO_FLAG_RXDONE)
        {
            rf_set_recv_flag(RADIO_FLAG_IDLE);
uint16_t Lora_wangguanid=0;
extern uint16_t wg_report_freq,wg_report_id;
extern uint32_t wg_lost_count;
wg_state_enum wg_state = WG_Lost;
extern uint16_t current_count;
extern uint8_t rec_index,rec_secdelay;
extern uint8_t  yuyin_no_sleep_flag,no_rx_flag;
uint16_t wangguan_up_id;
uint8_t LoraUp_flag;
uint8_t imu_enable,motor_enable;
extern uint8_t shengji_flag;
uint16_t rec_wenjian_daxiao;
uint16_t recnum[3];
uint16_t recv_flag=0;
uint16_t tx_flag=0;
uint16_t CRC16=0;
uint16_t DEST_ID=0;
uint16_t rec_value,rec_delaytime,rx_count,datalen_offset;
//                      memcpy(RF_RX_temp,RxDoneParams.Payload,RxDoneParams.Size);
//                      //OnRxDone();
//                      if(RF_RX_temp[0]==0x04&&RF_RX_temp[1]=='I'&&RF_RX_temp[2]=='N'&&RF_RX_temp[3]=='G')
//                        {
              lora_huanxing_count++;
                            time_flag_lorarx=phy_timer_count_get();
                        //LORA_REV_uwb_up=1;
                            UwbRange();
//                        }
                        rf_enter_continous_rx(); //重新进入接收模式
                    //                    gpio_pin_set(IO_PIN_5);//测试
        gpio_pin_clr(IO_PIN_5);
                      //UwbRange();
//            DDL_Printf("Rx : SNR: %f ,RSSI: %d \r\n", RxDoneParams.Snr, RxDoneParams.Rssi);
              //int i=0;
//            for(i = 0; i < RxDoneParams.Size; i++)
//            {
//                printf("0x%02x ", RxDoneParams.Payload[i]);
//            }
           // error_cnt ++;
        }
        if((rf_get_recv_flag() == RADIO_FLAG_RXTIMEOUT) || (rf_get_recv_flag() == RADIO_FLAG_RXERR))
//
uint16_t Loratx_flag=0;
uint16_t Lorarx_flag=0;
uint16_t Lorarx_time_out_flag=0;
static void Lora_irq_handler(enum IO_PIN_T pin)
{
            uint16_t checksum1;
            rf_irq_process();
            //这里根据SDK的那个逻辑 ç”¨ä½ çš„æŽ¥å£çœ‹çœ‹
        tx_flag=rf_get_transmit_flag();
        recv_flag=rf_get_recv_flag();
            if(recv_flag == RADIO_FLAG_RXDONE)
        {
            rf_set_recv_flag(RADIO_FLAG_IDLE);
                 rf_set_recv_flag(RADIO_FLAG_IDLE);
                 memcpy(RX_Buffer,RxDoneParams.Payload,RxDoneParams.Size);
                    BufferSize=RxDoneParams.Size;
                     lora_huanxing_count++;
                    if(RX_Buffer[0]==0x04&&RX_Buffer[1]=='I'&&RX_Buffer[2]=='N'&&RX_Buffer[3]=='G')
                        {
                            time_flag_lorarx=phy_timer_count_get();
                            UwbRange();
                        //rf_enter_continous_rx(); //重新进入接收模式
                        //LORA_REV_uwb_up=1;
                        }
                 if(RX_Buffer[MSG_TYPE_IDX]==LORA_MSGTYPE_WGRESPTAG)
                        {
                            checksum1=Checksum_u16(RX_Buffer,BufferSize-2);
              memcpy(&DEST_ID,&RX_Buffer[DEST_ID_IDX],2);
                            memcpy(&CRC16,&RX_Buffer[BufferSize-2],2);
                            if(!memcmp(&checksum1,&RX_Buffer[BufferSize-2],2))
                            if(!memcmp(&dev_id,&RX_Buffer[DEST_ID_IDX],2))
                            {
                                memcpy(&source_id,&RX_Buffer[SOURCE_ID_IDX],2);
                                if(wg_state==WG_Lost)
                                    {
                                     wg_state = WG_Connected;
                                     wg_report_id = source_id;
                                    }
                                if(!memcmp(&wg_report_id,&RX_Buffer[SOURCE_ID_IDX],2))
                                {
                                        wg_lost_count = 0;
                                        switch(RX_Buffer[PWTAG_RW_FLAG_IDX])
                                        {
                                                case WGRSP_RWTAG_NONE:
//                        current_count = HAL_LPTIM_ReadCounter(&hlptim1);
//                        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;
//                        }
//
//                        target_count = current_count + rec_delaytime*3.2768 - delaytime-datalen_offset;
//                        while(target_count>=32768)
//                            target_count-=32768;
//                        __HAL_LPTIM_COMPARE_SET(&hlptim1, target_count);
                       // rx_count = HAL_LPTIM_ReadCounter(&hlptim1);
                     //   printf("tx %d,rx %d,delay %d",current_count>>5,rx_count>>5,rec_delaytime);
                        break;
                                                case WGRSP_RWTAG_READ:
                                                            no_rx_flag = 1;
                                                            LoraSendComMap(WGRSP_RWTAG_READ);
                                                            break;
                                                case WGRSP_RWTAG_WRITE:
                                                        rec_index = RX_Buffer[PWTAG_WRITE_IDX_IDX];
                                                    switch(rec_index)
                                                            {
                                                                    case 0xdd:  //语音下发
                                                                            break;
//                        case 0x20:  //蜂鸣
//                            memcpy(&rec_value,&RX_Buffer[PWTAG_WRITE_VALUE_IDX],2);
//                            motor_keeptime = rec_value;
//                            break;
                        default :
                            memcpy(&rec_value,&RX_Buffer[PWTAG_WRITE_VALUE_IDX],2);
                            g_com_map[rec_index/2] = rec_value;
                            save_com_map_to_flash();
                            LoraRspWriteCommap(SUBMSG_WRITE_ANCPARA);
                            //flag_writepara_needreset = 1;
                            no_rx_flag = 1;
                                                            }
                                                            break;
                                                case WGRSP_RWTAG_UPDATE:
                                                rec_index = RX_Buffer[PWTAG_WRITE_IDX_IDX];
                                                switch(rec_index)
                                                {
                                                        case 0xaa:  //升级下发
                                                        memcpy(&rec_wenjian_daxiao,&RX_Buffer[WRITEPARA_VALUE_IDX],2);//文件大小
                                                        if(rec_wenjian_daxiao>0XAC00||rec_wenjian_daxiao==0)
                                                        {}//文件过大,超出范围
                                                        else
                                                        {
                                                                memcpy(&wangguan_up_id,&RX_Buffer[SOURCE_ID_IDX],2);//网关ID å ç”¨2个字节
                                                                shengji_flag=1;
                                                                LoraUp_flag=1;
                                                                imu_enable=0;
                                                        }
//                              LoraUp_Poll();
                                                                break;
                                                }
                                                        break;
                                        }
                                    }
                                }
                            }
      }
            if(tx_flag == RADIO_FLAG_TXDONE)
        {
                 //rf_set_mode(RF_MODE_STB3);
                 rf_set_transmit_flag(RADIO_FLAG_IDLE);
                    Loratx_flag++;
//                #ifdef DEBUG_BOXING
//            //gpio_pin_clr(IO_PIN_5);//测试
//            gpio_pin_set(IO_PIN_5);//测试
//                #endif
                rf_enter_single_timeout_rx(100);
             // rf_enter_single_rx();
            //        rf_enter_continous_rx();
        }
        if((recv_flag == RADIO_FLAG_RXTIMEOUT))
        {
//                            #ifdef DEBUG_BOXING
//                            gpio_pin_clr(IO_PIN_5);//测试
//                //        gpio_pin_set(IO_PIN_5);//测试
//                            #endif
                    //这个超时接收是会自动重启的,所以必须将芯片状态置成STB3这样就退出了连续接收状态
                      rf_set_mode(RF_MODE_STB3);
                    //这个超时接收是会自动重启的,所以必须将芯片状态置成STB3这样就退出了连续接收状态
                        Lorarx_time_out_flag++;
                      rf_set_recv_flag(RADIO_FLAG_IDLE);
                    //  rf_clr_irq(REG_IRQ_RX_TIMEOUT);
                 //  rf_enter_single_timeout_rx(100);
        }
                if((recv_flag == RADIO_FLAG_RXERR))
                {
                    rf_set_recv_flag(RADIO_FLAG_IDLE);
                }
}
void Board_LORA_NVIC_Init(GPIO_IRQ_HANDLER_T irq_handler)  //LORA ä¸­æ–­é…ç½®
{
//        io_pin_mux_set(_4G_USART_RX_Pin,IO_FUNC0);//把原先io å˜ä¸ºæ™®é€šGPIO
@@ -574,7 +720,10 @@
}
uint8_t io14_state;
uint16_t  lora_freq=0;
uint16_t  lora_up_count=0;
uint8_t TXBuffer[8]={0,1,2,3,4,5,6,7};
uint8_t test_buf[10]={0,1,1,1,1,1,1,1,1,1};
int main(void)
{
    board_clock_run();
@@ -628,12 +777,22 @@
    //board_led_init();
    spi_init();
        //PCA9555_init();
    Board_LORA_NVIC_Init(Lora_irq_handler);
    Lora_init();
    rf_set_default_para(DEFAULT_up_FREQ,DEFAULT_up_SF);
        //lora_freq=DEFAULT_up_FREQ+g_com_map[GROUP_ID];
    // rf_set_default_para(DEFAULT_up_FREQ+g_com_map[GROUP_ID],DEFAULT_up_SF);
        rf_set_default_para(DEFAULT_WG_SET_FREQ,DEFAULT_WG_SET_SF);
        //rf_enter_continous_rx();
    //    rf_enter_continous_rx();
//        if((rf_single_tx_data(TXBuffer,10,0))!= OK)
//    {
//
//    }
        //rf_set_default_para(DEFAULT_WG_SET_FREQ,DEFAULT_WG_SET_SF);
    //    rf_set_default_para(DEFAULT_up_FREQ,DEFAULT_up_SF);
//    
    rf_enter_continous_rx();
    //rf_enter_continous_tx();
//    rf_set_transmit_flag(RADIO_FLAG_TXDONE);
//    rf_set_transmit_flag(RADIO_FLAG_TXDONE);
//    if(rf_continous_tx_send_data(tx_test_buf, TX_LEN) != 0)
@@ -661,6 +820,9 @@
////加速度计初始化必须在IO_control_init之前因为复用SDA引脚
//    adc_get(&sample[0], NUM_SAMPLES, adc_callback);//adc采样
           Program_Init();
      // rf_single_tx_data(TXBuffer,10,2);
//    uart_receive(UART_ID1,m_EUART_DMA_RXBuf,EUART_RX_BUF_SIZE,uart_receive_callback);
//    
//// Initialize low power mode
@@ -668,20 +830,38 @@
//      AIR780E_Reset(); //4G模块重启,耗时1.5秒,这个是无法同步的关键
    sleep_timer_open(true, SLEEP_TIMER_MODE_RELOAD, sleep_timer_callback);
 //  sleep_timer_start(__MS_TO_32K_CNT(1000));//测试
        sleep_timer_start(__MS_TO_32K_CNT(1000));//测试
#ifdef DEBUG_BOXING
        io_pin_mux_set(IO_PIN_5,IO_FUNC0);
        gpio_pin_set_dir(IO_PIN_5,GPIO_DIR_OUT,0);
        io_pull_set(IO_PIN_5,IO_PULL_DOWN,IO_PULL_UP_LEVEL4);
#endif
    //rf_enter_single_timeout_rx(1000);
//    board_acceleration_detection_init(move_handler);
          //rf_enter_single_timeout_rx(900);
        //rf_enter_single_timeout_rx(500);
      //rf_enter_single_rx();
    Uwbinit();
    while (1)
    {
    {
//     rf_irq_process();
     //rf_enter_single_rx();
        Lora_Tx_Poll();
//        if((rf_single_tx_data(TXBuffer,10,0))!= OK)
//    {
//
//    }
            //        #ifdef DEBUG_BOXING
//         gpio_pin_clr(IO_PIN_5);//测试
//        gpio_pin_set(IO_PIN_5);//测试
//        test_Delay_us(1000);
//        gpio_pin_set(IO_PIN_5);//测试
//      test_Delay_us(1000);
//         test_Delay_us(100000);
//             test_Delay_us(100000);
//             test_Delay_us(100000);
//        gpio_pin_clr(IO_PIN_5);//测试
//        test_Delay_us(2000);
//        gpio_pin_set(IO_PIN_5);//测试
@@ -693,13 +873,8 @@
//                UwbRange();
//            }
//        if(g_start_send_flag)
//        {
//            g_start_send_flag=0;
//           // Lora_Report_poll();
//                     // Lora_UploadHeartBeartPoll();
//        }
        
       // UwbRange();
//        rf_irq_process();
keil/lora_3029.c
@@ -2,6 +2,7 @@
#include "mk_spi.h"
#include "global_param.h"
#include "pan_port.h"
#include "pan_rf.h"
//#include "WS2812.h"
//#include "pan_port.h"
//#include "pan_param.h"
@@ -41,7 +42,8 @@
     uint32_t ret = 0;
   uint32_t cnt = 0;
     ret=rf_init();
   set_test_mode1_reg();
     set_test_mode1_reg();
           if(ret== 1)
    {
//        printf("LORA Init Fail");
@@ -52,7 +54,7 @@
//                printf("LORA Init OK\r\n");
    }
}
wg_state_enum wg_state = WG_Lost;
extern wg_state_enum wg_state;
uint8_t lora_sendbuffer[200];
uint8_t seq_num;
extern uint16_t lora_up_uwb_flag;
@@ -89,6 +91,8 @@
            wg_report_id = DEFAULT_WG_ID;
            wg_report_freq = REPORT_MANGE_CHANNEL_FRQ; //如果丢失链接就进入WG管理信道。
            wg_report_sf = REPORT_CHANNEL_SF;
//                        wg_report_freq = TEST_MANAGE_CHANNEL_FRQ;
//                      wg_report_sf = TEST_MANAGE_CHANNEL_SF;
                }
    } else {
        if(wg_lost_count>WG_LOST_SWITCH_THRES)
@@ -101,13 +105,12 @@
//uint16_t wg_report_freq,wg_report_id;
uint8_t lora_sendbuffer[200];
void Lora_UploadHeartBeartPoll(void)
void LoraHeartBeartPoll(void)
{
//    lora_up_uwb_flag=2;
//  rf_set_default_para();
         rf_enter_continous_tx();
/*****************************心跳包上传内容************************************/        
    lora_sendbuffer[MSG_TYPE_IDX] = LORA_MSGTYPE_TAGHEARTBEAT;
    lora_sendbuffer[MSG_LENGTH] = 14;
@@ -117,50 +120,45 @@
    lora_sendbuffer[HB_UWBPOWER_IDX] = g_com_map[POWER];
    lora_sendbuffer[HB_LORAPOWER_IDX] = g_com_map[LORA_POWER];
    checksum = Checksum_u16(lora_sendbuffer,14);
    memcpy(&lora_sendbuffer[14],&checksum,2);
    memcpy(&lora_sendbuffer[14],&checksum,2);
    LORA_3029_SINGLE_SEND(lora_sendbuffer,16,0);
/*****************************心跳包上传内容*************************************/    
        rf_set_transmit_flag(RADIO_FLAG_TXDONE);
         if(rf_get_transmit_flag()==RADIO_FLAG_TXDONE)
            {
                if(rf_continous_tx_send_data(lora_sendbuffer, 16)==OK)
                {
                    //LOG_INFO(TRACE_MODULE_APP,"设备ID: %x .\r\n");
                }
                while (rf_get_transmit_flag() == RADIO_FLAG_IDLE)
                ;
                //rf_enter_continous_rx();;
                rf_set_transmit_flag(RADIO_FLAG_IDLE);
            }
}
#define HEATBEAT_UPDATE_TIME   3600
#define HEATBEAT_UPDATE_TIME   100
uint16_t heatbeat_count = HEATBEAT_UPDATE_TIME-1 ;
uint16_t flag_getwgresp = 0;
uint16_t test_temp[10]={0x1306,9688,1000};
uint16_t test_temp2[10]={0xff,0xcd,0x19};
int16_t intheight;            //气压
void Lora_Report_poll(void)
extern uint16_t recnum[3];
void LoraReportPoll(void)
{
    LoraReportFreqPoll();
  flag_getwgresp = 0;                                        //网关回复标志位  && WG_Connected == wg_state
    uint32_t ret = 0;
    ret = rf_init();
    set_test_mode1_reg();
    if(ret==OK)
    {
    rf_set_default_para(wg_report_freq*1000000,wg_report_sf);
    }
//
//
    if(heatbeat_count++>HEATBEAT_UPDATE_TIME) //如果心跳包到达上传时间,并且网关处于链接状态,就上传心跳包
  {
     heatbeat_count = 0;
     Lora_UploadHeartBeartPoll();
     //rf_irq_process();
     return;
    }
    for(uint16_t i=0; i<report_ancnum-1; i++)
  {
    // delay_ms(100);
#ifdef _USE_BAR
    GetPressAndHeight();
    intheight = Height*100;
#endif
#ifdef _SMT_TEST
    printf("气压值:%d",intheight);
#endif
    TagListUpdate();
    LoraReportFreqPoll();
    flag_getwgresp = 0;
   // wg_report_freq = REPORT_MANGE_CHANNEL_FRQ;
      rf_set_default_para(wg_report_freq,REPORT_CHANNEL_SF);
   // SwitchLoraSettings(wg_report_freq,REPORT_CHANNEL_SF,g_com_map[LORA_POWER]);
    if(heatbeat_count++>HEATBEAT_UPDATE_TIME && WG_Connected == wg_state) //如果心跳包到达上传时间,并且网关处于链接状态,就上传心跳包
    {
        heatbeat_count = 0;
        LoraHeartBeartPoll();
        return;
    }
    for(uint16_t i=0; i<report_ancnum-1; i++)
    {
        for(uint16_t j=0; j<report_ancnum-1-i; j++)
        {
            if(report_ancdist[j]>report_ancdist[j+1])
@@ -175,200 +173,189 @@
                report_ancdist[j+1] = dist;
            }
        }
  }
    if(report_ancnum>0)
  {
    //uwbled=0x11; //blue
  }
    else
    {
    //uwbled=0x1100;    //red
  }
    if(report_ancnum>LORA_REPORT_MAXANC_NUM)    //考虑lora传输时间,最多发送10个基站数据。
     report_ancnum = LORA_REPORT_MAXANC_NUM;
    }
    if(report_ancnum>LORA_REPORT_MAXANC_NUM)    //考虑lora传输时间,最多发送10个基站数据。
        report_ancnum = LORA_REPORT_MAXANC_NUM;
#ifdef USE_GPS
    lora_sendbuffer[MSG_TYPE_IDX] = LORA_MSGTYPE_TAGMSGTOWG_GPS;
    lora_sendbuffer[MSG_LENGTH] = 4*report_ancnum+ANCID_IDX;
    lora_sendbuffer[MSG_LENGTH] = 4*report_ancnum+30;
#else
    lora_sendbuffer[MSG_TYPE_IDX] = LORA_MSGTYPE_TAGMSGTOWG;
    lora_sendbuffer[MSG_LENGTH] = 4*report_ancnum+ANCID_IDX;
#endif
//    2000f026   02020002  //000220200
    memcpy(&lora_sendbuffer[SOURCE_ID_IDX],&g_com_map[DEV_ID],2);
    memcpy(&lora_sendbuffer[DEST_ID_IDX],&wg_report_id,2);
    lora_sendbuffer[SEQNUM_IDX] = seq_num++;
    lora_sendbuffer[BAT_IDX] = bat_percent;
        //GET_USERKEY这个是那个lora——busy那个引脚
   // lora_sendbuffer[STATE_IDX] = !GET_USERKEY|stationary_flag<<1;
#ifdef USE_GPS
    memcpy(&lora_sendbuffer[GPS_JINGDU_IDX],&gps_jingdu,8);
    memcpy(&lora_sendbuffer[GPS_WEIDU_IDX],&gps_weidu,8);
    memcpy(&lora_sendbuffer[GPS_WEIDU_IDX],&gps_jingdu,8);
    memcpy(&lora_sendbuffer[GPS_HEIGHT_IDX],&gps_height,8);
    lora_sendbuffer[GPS_STATE_IDX] = gps_state;
    lora_sendbuffer[GPS_SATEL_NUM_IDX] = gps_satel_num;
    lora_sendbuffer[GPS_SPOWER_IDX] = gps_signalpower;
    lora_sendbuffer[GPS_CHAFENLINGQI] = gps_chafenlingqi;
#endif
    memcpy(&lora_sendbuffer[BAR_HEIGHT_IDX],&intheight,2);
    //  memcpy(&lora_sendbuffer[BAR_HEIGHT_IDX],&bar_height,2);
        memcpy(&report_ancid,test_temp,10);
        memcpy(&report_ancdist,test_temp2,10);
        report_ancnum=3;
    lora_sendbuffer[ANCNUM_IDX] = report_ancnum;
    memcpy(&lora_sendbuffer[ANCID_IDX],report_ancid,report_ancnum*2);
    memcpy(&lora_sendbuffer[ANCID_IDX+report_ancnum*2],report_ancdist,report_ancnum*2);
    checksum = Checksum_u16(lora_sendbuffer,4*report_ancnum+ANCID_IDX);
    memcpy(&lora_sendbuffer[ANCID_IDX+report_ancnum*4],&checksum,2);
      rf_enter_continous_tx();
        //rf_irq_process();
        rf_set_transmit_flag(RADIO_FLAG_TXDONE);
         if(rf_get_transmit_flag()==RADIO_FLAG_TXDONE)
            {
                if(rf_continous_tx_send_data(lora_sendbuffer,ANCID_IDX+report_ancnum*4+2)==OK)
                {
                    //LOG_INFO(TRACE_MODULE_APP,"设备ID: %x .\r\n");
                }
                while (rf_get_transmit_flag() == RADIO_FLAG_IDLE)
                ;
                //rf_enter_continous_rx();;
                rf_set_transmit_flag(RADIO_FLAG_IDLE);
            }
        // rf_enter_continous_rx();
        //rf_enter_continous_tx();
//    LORA_3029_SEND(lora_sendbuffer,ANCID_IDX+report_ancnum*4+2);
    LORA_3029_SINGLE_SEND(lora_sendbuffer,ANCID_IDX+report_ancnum*4+2,0);
//            rf_single_tx_data(lora_sendbuffer,ANCID_IDX+report_ancnum*4+2,2);
    //rf_enter_continous_rx();
    //LED_TB_ON;
   // bat_percent=Get_Battary();
    for(uint8_t i=0;i<3;i++)
    recnum[i] = 0;
}
extern uint8_t report_ancnum;
static uint16_t delaytime = 1200;
static uint16_t source_id;
uint8_t rec_index,rec_secdelay;
uint16_t rec_value,rec_delaytime,rx_count;
uint16_t rec_value,rec_delaytime,rx_count,datalen_offset;
//uint16_t rec_value,rec_delaytime,rx_count;
//uint16_t rec_value,rec_delaytime,rx_count,datalen_offset;
int32_t target_count;
uint8_t shengji_flag,time=5;
extern uint32_t uwbled,gpsled,loraled,powerled;
extern struct RxDoneMsg RxDoneParams;
void OnRxDone( uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr )
{         uint16_t checksum1;
        BufferSize = size;
          memcpy(RX_Buffer,RxDoneParams.Payload,RxDoneParams.Size);
       // memcpy( RX_Buffer, payload, BufferSize );
        RssiValue = rssi;
        SnrValue = snr;
        //Radio.Standby();
        no_rx_flag = 0;
        lora_up_rec_flag=1;
//    if(RX_Buffer[MSG_TYPE_IDX]==LORA_MSGTYPE_RANGEPOLL)
//void OnRxDone( uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr )
//{         uint16_t checksum1;
//        BufferSize = size;
//          memcpy(RX_Buffer,RxDoneParams.Payload,RxDoneParams.Size);
//       // memcpy( RX_Buffer, payload, BufferSize );
//        RssiValue = rssi;
//        SnrValue = snr;
//        //Radio.Standby();
//        no_rx_flag = 0;
//        lora_up_rec_flag=1;
////    if(RX_Buffer[MSG_TYPE_IDX]==LORA_MSGTYPE_RANGEPOLL)
////    {
////            UwbRange();
////            rf_delay_us(time*1000);
////       // UWB_RXStart(10);
////       // delay_ms(time);
////    }
//    if(RX_Buffer[MSG_TYPE_IDX]==LORA_MSGTYPE_WGRESPTAG)
//    {
//            UwbRange();
//            rf_delay_us(time*1000);
//       // UWB_RXStart(10);
//       // delay_ms(time);
//    }
    if(RX_Buffer[MSG_TYPE_IDX]==LORA_MSGTYPE_WGRESPTAG)
    {
        checksum1=Checksum_u16(RX_Buffer,BufferSize-2);
        if(!memcmp(&checksum1,&RX_Buffer[BufferSize-2],2))
        if(!memcmp(&dev_id,&RX_Buffer[DEST_ID_IDX],2))
        {
           memcpy(&source_id,&RX_Buffer[SOURCE_ID_IDX],2);
            if(wg_state==WG_Lost)
            {
                wg_state = WG_Connected;
                wg_report_id = source_id;
            }
            if(!memcmp(&wg_report_id,&RX_Buffer[SOURCE_ID_IDX],2))
            {
                wg_lost_count = 0;
                // loraled=GREEN;
                switch(RX_Buffer[PWTAG_RW_FLAG_IDX])
                {
                    case WGRSP_RWTAG_NONE:
                       // current_count = HAL_LPTIM_ReadCounter(&hlptim1);
                        wg_report_freq = RX_Buffer[POLL_FREQ_IDX]+400;
                        memcpy(&rec_delaytime,&RX_Buffer[NEXTPOLL_TIME_IDX],2);
                    rec_secdelay = RX_Buffer[PWTAG_SECDELAY_IDX];
                    if(BufferSize!=13||rec_secdelay>20)
                    {
                        rec_secdelay = 0;
                    }
                    if(report_ancnum<2)
                    {
                        datalen_offset = report_ancnum*85;
                    }else{
                        datalen_offset = (report_ancnum-1)*46+85;
                    }
                        target_count = current_count + rec_delaytime*3.2768 - delaytime-datalen_offset;
                        while(target_count>=32768)
                            target_count-=32768;
//                         __HAL_LPTIM_COMPARE_SET(&hlptim1, target_count);
//                        rx_count = HAL_LPTIM_ReadCounter(&hlptim1);
                     //   printf("tx %d,rx %d,delay %d",current_count>>5,rx_count>>5,rec_delaytime);
                        break;
                    case WGRSP_RWTAG_READ:
                        no_rx_flag = 1;
                        //LoraSendComMap(WGRSP_RWTAG_READ);
                        break;
                    case WGRSP_RWTAG_WRITE:
                        rec_index = RX_Buffer[PWTAG_WRITE_IDX_IDX];
                        if(rec_index<=DEV_ID)
                            return;
                        if(rec_index==0xDD)
                        {
//                             if(usart5_state==1)
//                             {
//                                Usart5Init();
//                                usart5_state=0;
//                             }
//                            HAL_GPIO_WritePin(GPIOC, GPIO_PIN_7, GPIO_PIN_SET);
//                            HAL_GPIO_WritePin(GPIOC, GPIO_PIN_13, GPIO_PIN_SET);
//                            memcpy(&xiafayuyin_data,&RX_Buffer[PWTAG_WRITE_VALUE_IDX],BufferSize-PWTAG_WRITE_VALUE_IDX-2);
//                            yuyin_sendflag=1;
//                            yuyinzidongguan_time=0;
//                            yuyin_no_sleep_flag=1;
//                            SYN_FrameInfo(0,xiafayuyin_data); //播放内容
//                            memset(xiafayuyin_data,0,sizeof(xiafayuyin_data));
                           // LoraRspWriteCommap(SUBMSG_WRITE_ANCPARA);
                              no_rx_flag = 1;
                        }else{
                            memcpy(&rec_value,&RX_Buffer[PWTAG_WRITE_VALUE_IDX],2);
                            g_com_map[rec_index/2] = rec_value;
                            save_com_map_to_flash();
                          //  LoraRspWriteCommap(SUBMSG_WRITE_ANCPARA);
//                            flag_writepara_needreset = 1;
                            no_rx_flag = 1;
                        }
                        break;
                    case WGRSP_RWTAG_UPDATE:
                    rec_index = RX_Buffer[PWTAG_WRITE_IDX_IDX];
                    switch(rec_index)
                    {
                        case 0xaa:  //升级下发
//                        memcpy(&rec_wenjian_daxiao,&RX_Buffer[WRITEPARA_VALUE_IDX],2);//文件大小
//                        if(rec_wenjian_daxiao>APP_SIZE||rec_wenjian_daxiao==0)
//                        {}//文件过大,超出范围
//                        else
//        checksum1=Checksum_u16(RX_Buffer,BufferSize-2);
//        if(!memcmp(&checksum1,&RX_Buffer[BufferSize-2],2))
//        if(!memcmp(&dev_id,&RX_Buffer[DEST_ID_IDX],2))
//        {
//           memcpy(&source_id,&RX_Buffer[SOURCE_ID_IDX],2);
//            if(wg_state==WG_Lost)
//            {
//                wg_state = WG_Connected;
//                wg_report_id = source_id;
//            }
//            if(!memcmp(&wg_report_id,&RX_Buffer[SOURCE_ID_IDX],2))
//            {
//                wg_lost_count = 0;
//                // loraled=GREEN;
//                switch(RX_Buffer[PWTAG_RW_FLAG_IDX])
//                {
//                    case WGRSP_RWTAG_NONE:
//                       // current_count = HAL_LPTIM_ReadCounter(&hlptim1);
//                        wg_report_freq = RX_Buffer[POLL_FREQ_IDX]+400;
//                        memcpy(&rec_delaytime,&RX_Buffer[NEXTPOLL_TIME_IDX],2);
//                    rec_secdelay = RX_Buffer[PWTAG_SECDELAY_IDX];
//                    if(BufferSize!=13||rec_secdelay>20)
//                    {
//                        rec_secdelay = 0;
//                    }
//
//                    if(report_ancnum<2)
//                    {
//                        datalen_offset = report_ancnum*85;
//                    }else{
//                        datalen_offset = (report_ancnum-1)*46+85;
//                    }
//
//                        target_count = current_count + rec_delaytime*3.2768 - delaytime-datalen_offset;
//                        while(target_count>=32768)
//                            target_count-=32768;
////                         __HAL_LPTIM_COMPARE_SET(&hlptim1, target_count);
////                        rx_count = HAL_LPTIM_ReadCounter(&hlptim1);
//                     //   printf("tx %d,rx %d,delay %d",current_count>>5,rx_count>>5,rec_delaytime);
//                        break;
//                    case WGRSP_RWTAG_READ:
//                        no_rx_flag = 1;
//                        //LoraSendComMap(WGRSP_RWTAG_READ);
//                        break;
//                    case WGRSP_RWTAG_WRITE:
//                        rec_index = RX_Buffer[PWTAG_WRITE_IDX_IDX];
//                        if(rec_index<=DEV_ID)
//                            return;
//                        if(rec_index==0xDD)
//                        {
//                        memcpy(&wangguan_up_id,&RX_Buffer[SOURCE_ID_IDX],2);//网关ID å ç”¨2个字节
//                        shengji_flag=1;
//                        LoraUp_flag=1;
////                             if(usart5_state==1)
////                             {
////                                Usart5Init();
////                                usart5_state=0;
////                             }
////                            HAL_GPIO_WritePin(GPIOC, GPIO_PIN_7, GPIO_PIN_SET);
////                            HAL_GPIO_WritePin(GPIOC, GPIO_PIN_13, GPIO_PIN_SET);
////                            memcpy(&xiafayuyin_data,&RX_Buffer[PWTAG_WRITE_VALUE_IDX],BufferSize-PWTAG_WRITE_VALUE_IDX-2);
////                            yuyin_sendflag=1;
////                            yuyinzidongguan_time=0;
////                            yuyin_no_sleep_flag=1;
////                            SYN_FrameInfo(0,xiafayuyin_data); //播放内容
////                            memset(xiafayuyin_data,0,sizeof(xiafayuyin_data));
//                           // LoraRspWriteCommap(SUBMSG_WRITE_ANCPARA);
//                              no_rx_flag = 1;
//                        }else{
//                            memcpy(&rec_value,&RX_Buffer[PWTAG_WRITE_VALUE_IDX],2);
//                            g_com_map[rec_index/2] = rec_value;
//                            save_com_map_to_flash();
//                          //  LoraRspWriteCommap(SUBMSG_WRITE_ANCPARA);
////                            flag_writepara_needreset = 1;
//                            no_rx_flag = 1;
//                        }
                            break;
                    }
                        break;
                }
            }
        }
    }
//    if(!no_rx_flag&&LoraUp_flag==0)
//    {
//        if(RX_Buffer[MSG_TYPE_IDX]!=LORA_MSGTYPE_RANGEPOLL)
//        SwitchLoraSettings(UWB_CHANNEL_FRQ+g_com_map[GROUP_ID],UWB_CHANNEL_SF,0);
//        Radio.Rx(0);
//    }
}
//                        break;
//                    case WGRSP_RWTAG_UPDATE:
//                    rec_index = RX_Buffer[PWTAG_WRITE_IDX_IDX];
//                    switch(rec_index)
//                    {
//                        case 0xaa:  //升级下发
////                        memcpy(&rec_wenjian_daxiao,&RX_Buffer[WRITEPARA_VALUE_IDX],2);//文件大小
////                        if(rec_wenjian_daxiao>APP_SIZE||rec_wenjian_daxiao==0)
////                        {}//文件过大,超出范围
////                        else
////                        {
////                        memcpy(&wangguan_up_id,&RX_Buffer[SOURCE_ID_IDX],2);//网关ID å ç”¨2个字节
////                        shengji_flag=1;
////                        LoraUp_flag=1;
////                        }
//                            break;
//                    }
//                        break;
//                }
//            }
//        }
//    }
////    if(!no_rx_flag&&LoraUp_flag==0)
////    {
////        if(RX_Buffer[MSG_TYPE_IDX]!=LORA_MSGTYPE_RANGEPOLL)
////        SwitchLoraSettings(UWB_CHANNEL_FRQ+g_com_map[GROUP_ID],UWB_CHANNEL_SF,0);
////        Radio.Rx(0);
////    }
//}
//void LORA_mode_select(void)
//{
//    if(TX_RX_SELECT==1)
@@ -522,11 +509,177 @@
//}
//extern     uint8_t Lora_tx_ancnum;
//extern   u8 lora_seq_nb2;
extern uint16_t lora_yingda_num;
uint8_t lora_tx_flag=0;
uint8_t lora_txanchor_power_flag;
extern uint16_t Lora_tx_ancid[50];
extern uint16_t Lora_tx_ancdist[50];
extern uint8_t Lora_tx_anc_electricity[50];
uint8_t lora_seq_nb1;
extern uint8_t lora_sendbuffer[200];
void LoraSendComMap(uint8_t cmd)
{
        uint8_t data_length = 0x50;
        uint16_t checksum = 0;
        lora_sendbuffer[MSG_TYPE_IDX] = LORA_MSGTYPE_READPARARESP;
        lora_sendbuffer[MSG_LENGTH] = data_length+11;
                memcpy(&lora_sendbuffer[SOURCE_ID_IDX],&g_com_map[DEV_ID],2);
                memcpy(&lora_sendbuffer[DEST_ID_IDX],&wg_report_id,2);
        lora_sendbuffer[RP_CMD_IDX] = cmd;
        lora_sendbuffer[RP_INDEX_IDX] = 2;
        lora_sendbuffer[RP_LEN_IDX] = data_length;
        memcpy(&lora_sendbuffer[9], &g_com_map[1], data_length);
        checksum = Checksum_u16(lora_sendbuffer,11+data_length);
        memcpy(&lora_sendbuffer[11+data_length],&checksum,2);
        LORA_3029_SINGLE_SEND(lora_sendbuffer,data_length+13,0);
  //  Delay_Ms(100);
}
void LoraRspWriteCommap(uint8_t index)
{
    uint8_t data_length = 2;
    uint16_t checksum = 0;
    lora_sendbuffer[MSG_TYPE_IDX] = LORA_MSGTYPE_READPARARESP;
    lora_sendbuffer[MSG_LENGTH] = data_length+9;
    memcpy(&lora_sendbuffer[SOURCE_ID_IDX],&g_com_map[DEV_ID],2);
    memcpy(&lora_sendbuffer[DEST_ID_IDX],&wg_report_id,2);
    lora_sendbuffer[RP_CMD_IDX] = WGRSP_RWTAG_WRITE;
    lora_sendbuffer[RP_INDEX_IDX] = index;
    lora_sendbuffer[RP_LEN_IDX] = data_length;
    memcpy(&lora_sendbuffer[7], &g_com_map[index/2], data_length);
    checksum = Checksum_u16(lora_sendbuffer,9+data_length);
    memcpy(&lora_sendbuffer[9+data_length],&checksum,2);
  //   Radio.Send(lora_sendbuffer,data_length+11);
     LORA_3029_SINGLE_SEND(lora_sendbuffer,data_length+11,0);
  //  Delay_Ms(100);
}
uint8_t t22[20],ti;
uint8_t no_yingdaflag;
uint8_t aRxBuffer[1];
extern uint8_t group_id;
uint16_t lora_send_count;
uint8_t mode_flag=0;
void Lora_Tx_Poll()
{
//    if(lora_tx_flag)
//    {
//     OnMaster();
////
//            //rf_enter_continous_rx();
//        }
 if(lora_tx_flag)
    {
        if(lora_send_count++%10==0||lora_jianting_flag)
        {
            lora_tx_flag=0;
#ifdef GROUPID_SWITCH
            if(rec_secdelay>0)
            {
                rec_secdelay--;
//                if(lora_jianting_flag)
//                {
//                    if(++group_id>GROUP_NUM)
//                    {
//                        group_id = 1;
//                    }
//                    t22[ti++] = group_id;
//                    if(ti>=20)
//                        ti=0;
//                    group_min_dist[group_id] = 0xffff;
//                    Radio.Standby();
//                    SwitchLoraSettings(UWB_CHANNEL_FRQ+group_id,UWB_CHANNEL_SF,0);
//                    Radio.Rx(0);
//                }
                return;
            }
//            //找3个小组中最近距离最大的小组,上传报文后切换到这个小组,因为上传报文会时间占用。
//            if(group_min_dist[1]>group_min_dist[2])  //如果1大于2
//            {
//                group_maxdist_index = group_min_dist[1]>group_min_dist[3]?1:3; //取 1和3 æœ€å¤§å€¼
//                group_mindist_index = group_min_dist[2]<group_min_dist[3]?2:3;//取 2和3 æœ€å°å€¼
//
//            }else{
//                group_maxdist_index = group_min_dist[2]>group_min_dist[3]?2:3; //取 2和3 æœ€å¤§å€¼
//                group_mindist_index = group_min_dist[1]<group_min_dist[3]?1:3;//取 1和3 æœ€å°å€¼
//            }
////            group_id = 1;
//            group_id = group_maxdist_index;
#endif
            t22[ti++] = group_id;
            if(ti>=20)
                ti=0;
         //  group_min_dist[group_id] = 0xffff;
         //   Radio.Standby();
                        //rf_set_default_para(UWB_CHANNEL_FRQ+group_id,UWB_CHANNEL_SF);
           // SwitchLoraSettings(UWB_CHANNEL_FRQ+group_id,UWB_CHANNEL_SF,0);
                        //rf_enter_single_timeout_rx(0);
//            rf_enter_continous_rx();
            //LedTask();
                        //LoraHeartBeartPoll();
                    //    rf_get_mode();
            LoraReportPoll();
            // LedOff_task();
        }
    }
}
uint8_t TX_RX_SELECT=0;
//void OnMaster()
//{
//
//    rf_set_default_para(DEFAULT_WG_SET_FREQ,DEFAULT_WG_SET_SF);
//  rf_enter_continous_tx();//send_frame1, 19
// // LORA_3029_SEND(send_frame1, 19);
//
//}
int LORA_3029_SINGLE_SEND(uint8_t *buffer, uint8_t size,uint8_t time)
{
    if((rf_single_tx_data(lora_sendbuffer,size,time))!= OK)
        {
      //while(1);
        }
        rf_delay_us(1);
        //rf_enter_single_rx();
        //rf_enter_single_timeout_rx(700);
}
int LORA_3029_CONTINOUS_SEND(uint8_t *buffer, uint8_t size)
{
}
//            rf_enter_continous_tx();
//            //rf_set_default_para(DEFAULT_WG_SET_FREQ,DEFAULT_WG_SET_SF);
//
//
//
//         rf_set_transmit_flag(RADIO_FLAG_TXDONE);
//
//
//             if(rf_get_transmit_flag() == RADIO_FLAG_TXDONE)
//        {
//          //
//                    if(rf_continous_tx_send_data(send_frame1, 20) == OK)
//                    {
//                    //printf("tx ok!\n");
//                    }
////                    while (rf_get_transmit_flag() ==!RADIO_FLAG_TXDONE)
////                    ;
//                while (rf_get_transmit_flag() ==!RADIO_FLAG_TXDONE)
//                ;
//
//        }
//
keil/lora_3029.h
@@ -2,11 +2,11 @@
#define __LORA_3029_H
#include "mk_io.h"
#define LORA_CS IO_PIN_14
#define LORA_CS IO_PIN_8
#define LORA_MOSI IO_PIN_11
#define LORA_MISO IO_PIN_12
#define LORA_CLK IO_PIN_13
#define LORA_DIO IO_PIN_4
#define LORA_DIO IO_PIN_7
#define ANC_MAX_NUM           50
#define LORA_REPORT_MAXANC_NUM  7
//#define TEST_FREQ
@@ -25,7 +25,7 @@
#define REPORT_CHANNEL_SF 7
#else
#define LORA_UPCHANNEL_FRQ 476
#define LORA_UPCHANNEL_SF 7
#define LORA_UPCHANNEL_SF 8
    
#define UWB_CHANNEL_FRQ 470
#define UWB_CHANNEL_SF 5
@@ -35,6 +35,10 @@
#define LR_DATA_CHANNEL_FRQ 475
#define LR_DATA_CHANNEL_SF 9
//#define TEST_MANAGE_CHANNEL_FRQ 457
//#define TEST_MANAGE_CHANNEL_SF 5
#endif
//LORA æ•°æ®æ ¼å¼
@@ -142,5 +146,9 @@
                WG_Connected,// ä¸ŠæŠ¥ä¸­       å’Œç½‘关通讯正常
}wg_state_enum;
void Lora_UploadHeartBeartPoll(void);
void LoraHeartBeartPoll(void);
void Lora_Tx_Poll();
void OnMaster();
int LORA_3029_SINGLE_SEND(uint8_t *buffer, uint8_t size,uint8_t time);
int LORA_3029_CONTINOUS_SEND(uint8_t *buffer, uint8_t size);
#endif
keil/uwb_app.c
@@ -358,7 +358,7 @@
    while(mac_is_busy());
    gpio_pin_clr(SCL_PIN);
}
uint16_t uwb_searchcount,range_timeout_us = 1700;
uint16_t uwb_searchcount,range_timeout_us = 2000;
uint8_t flag_recsuccess;
extern uint8_t g_start_send_flag,search_open_flag = 1,link_success_flag;
@@ -370,7 +370,7 @@
uint32_t UWB_shoudao_count=0;
uint32_t UWB_fachu_count=0;
uint32_t UWB_qiangzhanfachu_count=0;
uint32_t UWB_1003_count,UWB_6666_count=0;
int UwbRange(void)
{
    uint8_t i;
@@ -404,7 +404,7 @@
//    temp_count3=phy_timer_count_get();
    //gpio_pin_set(SCL_PIN);
        time_count_dkjs=phy_timer_count_get();
        gpio_pin_set(IO_PIN_5);//测试
//        gpio_pin_set(IO_PIN_5);//测试
//        gpio_pin_clr(IO_PIN_5);
    uwb_rxflag=uwb_rx(0, 0, range_timeout_us);//开启接收
//        gpio_pin_clr(IO_PIN_5);//测试
@@ -442,7 +442,7 @@
        time_count_sdsj=phy_timer_count_get();
            UWB_shoudao_count++;
//                    gpio_pin_set(IO_PIN_5);//测试
        gpio_pin_clr(IO_PIN_5);
//        gpio_pin_clr(IO_PIN_5);
        #ifdef DEBUG_BOXING
//        gpio_pin_set(IO_PIN_5);//测试
//        gpio_pin_clr(IO_PIN_5);//测试
@@ -462,6 +462,7 @@
                      //rec_nearbase_num=25;  
                    
            memcpy(&tag_id_recv,&rx_buf[TAG_ID_IDX],2);
            memcpy(rec_ancidlist,&rx_buf[FZ_NEARBASEID_INDEX],2*rec_nearbase_num);
            memcpy(rec_ancdistlist,&rx_buf[FZ_NEARBASEID_INDEX+2*rec_nearbase_num],2*rec_nearbase_num);
            memcpy(&rec_antdelay,&rx_buf[FZ_NEARBASEID_INDEX+rec_nearbase_num*4],2);
@@ -473,6 +474,14 @@
                {
                    rec_ancdistlist[i]+=(int16_t)g_com_map[DIST_OFFSET];
                    PushAnchorDataArray(tag_id_recv,rec_ancdistlist[i],battary);
                                        if(tag_id_recv==0x1003)
                                        {
                                            UWB_1003_count++;
                                        }
                                        else if(tag_id_recv==0x6666)
                                        {
                                        UWB_6666_count++;
                                        }
                                      UWB_fachu_count++;
//        #ifdef DEBUG_BOXING
////        gpio_pin_clr(IO_PIN_5);//测试
@@ -508,7 +517,7 @@
      //  uwb_rxflag=uwb_rx(0, 0, range_timeout_us);
    }    
        #ifdef DEBUG_BOXING
        gpio_pin_clr(IO_PIN_5);//测试
//        gpio_pin_clr(IO_PIN_5);//测试
//        gpio_pin_set(IO_PIN_5);//测试
        #endif
    
keil/uwb_simple_example.uvoptx
@@ -148,7 +148,24 @@
          <Name></Name>
        </SetRegEntry>
      </TargetDriverDllRegistry>
      <Breakpoint/>
      <Breakpoint>
        <Bp>
          <Number>0</Number>
          <Type>0</Type>
          <LineNumber>676</LineNumber>
          <EnabledFlag>1</EnabledFlag>
          <Address>10844</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\676</Expression>
        </Bp>
      </Breakpoint>
      <WatchWindow1>
        <Ww>
          <count>0</count>
@@ -360,107 +377,132 @@
        <Ww>
          <count>0</count>
          <WinNumber>2</WinNumber>
          <ItemText>RF_RX_temp</ItemText>
          <ItemText>packet_transmit</ItemText>
        </Ww>
        <Ww>
          <count>1</count>
          <WinNumber>2</WinNumber>
          <ItemText>RX_Buffer</ItemText>
          <ItemText>RADIO_FLAG_IDLE</ItemText>
        </Ww>
        <Ww>
          <count>2</count>
          <WinNumber>2</WinNumber>
          <ItemText>DEFAULT_FREQ</ItemText>
          <ItemText>tx_flag</ItemText>
        </Ww>
        <Ww>
          <count>3</count>
          <WinNumber>2</WinNumber>
          <ItemText>DEFAULT_SF</ItemText>
          <ItemText>wg_report_freq,0x0A</ItemText>
        </Ww>
        <Ww>
          <count>4</count>
          <WinNumber>2</WinNumber>
          <ItemText>RF_RX_temp</ItemText>
          <ItemText>REPORT_CHANNEL_SF</ItemText>
        </Ww>
        <Ww>
          <count>5</count>
          <WinNumber>2</WinNumber>
          <ItemText>rx_buf</ItemText>
          <ItemText>RX_Buffer</ItemText>
        </Ww>
        <Ww>
          <count>6</count>
          <WinNumber>2</WinNumber>
          <ItemText>uwb_rxflag</ItemText>
          <ItemText>CRC16</ItemText>
        </Ww>
        <Ww>
          <count>7</count>
          <WinNumber>2</WinNumber>
          <ItemText>rec_nearbase_num</ItemText>
          <ItemText>DEST_ID</ItemText>
        </Ww>
        <Ww>
          <count>8</count>
          <WinNumber>2</WinNumber>
          <ItemText>send_buffer</ItemText>
          <ItemText>wg_state</ItemText>
        </Ww>
        <Ww>
          <count>9</count>
          <WinNumber>2</WinNumber>
          <ItemText>tag_id_recv</ItemText>
          <ItemText>SOURCE_ID_IDX</ItemText>
        </Ww>
        <Ww>
          <count>10</count>
          <WinNumber>2</WinNumber>
          <ItemText>resp_tx_en_start_u32,0x0A</ItemText>
          <ItemText>lora_sendbuffer</ItemText>
        </Ww>
        <Ww>
          <count>11</count>
          <WinNumber>2</WinNumber>
          <ItemText>range_timeout_us,0x0A</ItemText>
          <ItemText>Loratx_flag</ItemText>
        </Ww>
        <Ww>
          <count>12</count>
          <WinNumber>2</WinNumber>
          <ItemText>time_count_dkjs,0x0A</ItemText>
          <ItemText>Lorarx_time_out_flag,0x0A</ItemText>
        </Ww>
        <Ww>
          <count>13</count>
          <WinNumber>2</WinNumber>
          <ItemText>time_flag_lorarx,0x0A</ItemText>
          <ItemText>recv_flag</ItemText>
        </Ww>
        <Ww>
          <count>14</count>
          <WinNumber>2</WinNumber>
          <ItemText>UwbRange</ItemText>
          <ItemText>rx_timeout,0x0A</ItemText>
        </Ww>
        <Ww>
          <count>15</count>
          <WinNumber>2</WinNumber>
          <ItemText>time_count_sdsj,0x0A</ItemText>
          <ItemText>wg_report_id</ItemText>
        </Ww>
        <Ww>
          <count>16</count>
          <WinNumber>2</WinNumber>
          <ItemText>UWB_fachu_count</ItemText>
          <ItemText>wg_report_freq,0x0A</ItemText>
        </Ww>
        <Ww>
          <count>17</count>
          <WinNumber>2</WinNumber>
          <ItemText>UWB_shoudao_count</ItemText>
          <ItemText>wg_report_sf</ItemText>
        </Ww>
        <Ww>
          <count>18</count>
          <WinNumber>2</WinNumber>
          <ItemText>lora_huanxing_count</ItemText>
          <ItemText>REG_OP_MODE</ItemText>
        </Ww>
        <Ww>
          <count>19</count>
          <WinNumber>2</WinNumber>
          <ItemText>UWB_qiangzhanfachu_count</ItemText>
          <ItemText>temreg</ItemText>
        </Ww>
        <Ww>
          <count>20</count>
          <WinNumber>2</WinNumber>
          <ItemText>rec_nearbase_num</ItemText>
          <ItemText>lora_huanxing_count</ItemText>
        </Ww>
        <Ww>
          <count>21</count>
          <WinNumber>2</WinNumber>
          <ItemText>lora_sendbuffer</ItemText>
        </Ww>
        <Ww>
          <count>22</count>
          <WinNumber>2</WinNumber>
          <ItemText>report_ancid</ItemText>
        </Ww>
        <Ww>
          <count>23</count>
          <WinNumber>2</WinNumber>
          <ItemText>report_ancdist</ItemText>
        </Ww>
        <Ww>
          <count>24</count>
          <WinNumber>2</WinNumber>
          <ItemText>tx_flag</ItemText>
        </Ww>
        <Ww>
          <count>25</count>
          <WinNumber>2</WinNumber>
          <ItemText>lora_sendbuffer</ItemText>
        </Ww>
      </WatchWindow2>
      <MemoryWindow1>
@@ -910,6 +952,30 @@
      <RteFlg>0</RteFlg>
      <bShared>0</bShared>
    </File>
    <File>
      <GroupNumber>3</GroupNumber>
      <FileNumber>32</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
      <bDave2>0</bDave2>
      <PathWithFileName>.\include\drivers\PCA9555.c</PathWithFileName>
      <FilenameWithoutPath>PCA9555.c</FilenameWithoutPath>
      <RteFlg>0</RteFlg>
      <bShared>0</bShared>
    </File>
    <File>
      <GroupNumber>3</GroupNumber>
      <FileNumber>33</FileNumber>
      <FileType>5</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
      <bDave2>0</bDave2>
      <PathWithFileName>.\include\drivers\PCA9555.h</PathWithFileName>
      <FilenameWithoutPath>PCA9555.h</FilenameWithoutPath>
      <RteFlg>0</RteFlg>
      <bShared>0</bShared>
    </File>
  </Group>
  <Group>
@@ -920,7 +986,7 @@
    <RteFlg>0</RteFlg>
    <File>
      <GroupNumber>4</GroupNumber>
      <FileNumber>32</FileNumber>
      <FileNumber>34</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -932,7 +998,7 @@
    </File>
    <File>
      <GroupNumber>4</GroupNumber>
      <FileNumber>33</FileNumber>
      <FileNumber>35</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -944,7 +1010,7 @@
    </File>
    <File>
      <GroupNumber>4</GroupNumber>
      <FileNumber>34</FileNumber>
      <FileNumber>36</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -956,7 +1022,7 @@
    </File>
    <File>
      <GroupNumber>4</GroupNumber>
      <FileNumber>35</FileNumber>
      <FileNumber>37</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -968,7 +1034,7 @@
    </File>
    <File>
      <GroupNumber>4</GroupNumber>
      <FileNumber>36</FileNumber>
      <FileNumber>38</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -980,7 +1046,7 @@
    </File>
    <File>
      <GroupNumber>4</GroupNumber>
      <FileNumber>37</FileNumber>
      <FileNumber>39</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -992,7 +1058,7 @@
    </File>
    <File>
      <GroupNumber>4</GroupNumber>
      <FileNumber>38</FileNumber>
      <FileNumber>40</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1004,7 +1070,7 @@
    </File>
    <File>
      <GroupNumber>4</GroupNumber>
      <FileNumber>39</FileNumber>
      <FileNumber>41</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1016,7 +1082,7 @@
    </File>
    <File>
      <GroupNumber>4</GroupNumber>
      <FileNumber>40</FileNumber>
      <FileNumber>42</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1028,7 +1094,7 @@
    </File>
    <File>
      <GroupNumber>4</GroupNumber>
      <FileNumber>41</FileNumber>
      <FileNumber>43</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1040,7 +1106,7 @@
    </File>
    <File>
      <GroupNumber>4</GroupNumber>
      <FileNumber>42</FileNumber>
      <FileNumber>44</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1052,7 +1118,7 @@
    </File>
    <File>
      <GroupNumber>4</GroupNumber>
      <FileNumber>43</FileNumber>
      <FileNumber>45</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1064,7 +1130,7 @@
    </File>
    <File>
      <GroupNumber>4</GroupNumber>
      <FileNumber>44</FileNumber>
      <FileNumber>46</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1076,7 +1142,7 @@
    </File>
    <File>
      <GroupNumber>4</GroupNumber>
      <FileNumber>45</FileNumber>
      <FileNumber>47</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1096,7 +1162,7 @@
    <RteFlg>0</RteFlg>
    <File>
      <GroupNumber>5</GroupNumber>
      <FileNumber>46</FileNumber>
      <FileNumber>48</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1108,7 +1174,7 @@
    </File>
    <File>
      <GroupNumber>5</GroupNumber>
      <FileNumber>47</FileNumber>
      <FileNumber>49</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1120,7 +1186,7 @@
    </File>
    <File>
      <GroupNumber>5</GroupNumber>
      <FileNumber>48</FileNumber>
      <FileNumber>50</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1132,7 +1198,7 @@
    </File>
    <File>
      <GroupNumber>5</GroupNumber>
      <FileNumber>49</FileNumber>
      <FileNumber>51</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1144,7 +1210,7 @@
    </File>
    <File>
      <GroupNumber>5</GroupNumber>
      <FileNumber>50</FileNumber>
      <FileNumber>52</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1156,7 +1222,7 @@
    </File>
    <File>
      <GroupNumber>5</GroupNumber>
      <FileNumber>51</FileNumber>
      <FileNumber>53</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1168,7 +1234,7 @@
    </File>
    <File>
      <GroupNumber>5</GroupNumber>
      <FileNumber>52</FileNumber>
      <FileNumber>54</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1180,7 +1246,7 @@
    </File>
    <File>
      <GroupNumber>5</GroupNumber>
      <FileNumber>53</FileNumber>
      <FileNumber>55</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1192,7 +1258,7 @@
    </File>
    <File>
      <GroupNumber>5</GroupNumber>
      <FileNumber>54</FileNumber>
      <FileNumber>56</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1204,7 +1270,7 @@
    </File>
    <File>
      <GroupNumber>5</GroupNumber>
      <FileNumber>55</FileNumber>
      <FileNumber>57</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1224,7 +1290,7 @@
    <RteFlg>0</RteFlg>
    <File>
      <GroupNumber>6</GroupNumber>
      <FileNumber>56</FileNumber>
      <FileNumber>58</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1236,7 +1302,7 @@
    </File>
    <File>
      <GroupNumber>6</GroupNumber>
      <FileNumber>57</FileNumber>
      <FileNumber>59</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1248,9 +1314,9 @@
    </File>
    <File>
      <GroupNumber>6</GroupNumber>
      <FileNumber>58</FileNumber>
      <FileNumber>60</FileNumber>
      <FileType>1</FileType>
      <tvExp>1</tvExp>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
      <bDave2>0</bDave2>
      <PathWithFileName>.\include\components\wsf\sources\platform\pal_uart.c</PathWithFileName>
@@ -1276,7 +1342,7 @@
    <RteFlg>0</RteFlg>
    <File>
      <GroupNumber>8</GroupNumber>
      <FileNumber>59</FileNumber>
      <FileNumber>61</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1288,7 +1354,7 @@
    </File>
    <File>
      <GroupNumber>8</GroupNumber>
      <FileNumber>60</FileNumber>
      <FileNumber>62</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1308,7 +1374,7 @@
    <RteFlg>0</RteFlg>
    <File>
      <GroupNumber>9</GroupNumber>
      <FileNumber>61</FileNumber>
      <FileNumber>63</FileNumber>
      <FileType>4</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1328,7 +1394,7 @@
    <RteFlg>0</RteFlg>
    <File>
      <GroupNumber>10</GroupNumber>
      <FileNumber>62</FileNumber>
      <FileNumber>64</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1340,7 +1406,7 @@
    </File>
    <File>
      <GroupNumber>10</GroupNumber>
      <FileNumber>63</FileNumber>
      <FileNumber>65</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1352,7 +1418,7 @@
    </File>
    <File>
      <GroupNumber>10</GroupNumber>
      <FileNumber>64</FileNumber>
      <FileNumber>66</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1364,7 +1430,7 @@
    </File>
    <File>
      <GroupNumber>10</GroupNumber>
      <FileNumber>65</FileNumber>
      <FileNumber>67</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1376,7 +1442,7 @@
    </File>
    <File>
      <GroupNumber>10</GroupNumber>
      <FileNumber>66</FileNumber>
      <FileNumber>68</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1388,7 +1454,7 @@
    </File>
    <File>
      <GroupNumber>10</GroupNumber>
      <FileNumber>67</FileNumber>
      <FileNumber>69</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1400,7 +1466,7 @@
    </File>
    <File>
      <GroupNumber>10</GroupNumber>
      <FileNumber>68</FileNumber>
      <FileNumber>70</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1420,7 +1486,7 @@
    <RteFlg>0</RteFlg>
    <File>
      <GroupNumber>11</GroupNumber>
      <FileNumber>69</FileNumber>
      <FileNumber>71</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1432,7 +1498,7 @@
    </File>
    <File>
      <GroupNumber>11</GroupNumber>
      <FileNumber>70</FileNumber>
      <FileNumber>72</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
@@ -1444,7 +1510,7 @@
    </File>
    <File>
      <GroupNumber>11</GroupNumber>
      <FileNumber>71</FileNumber>
      <FileNumber>73</FileNumber>
      <FileType>1</FileType>
      <tvExp>0</tvExp>
      <tvExpOptDlg>0</tvExpOptDlg>
keil/uwb_simple_example.uvprojx
@@ -755,6 +755,16 @@
              <FileType>5</FileType>
              <FilePath>.\include\drivers\mk_timer.h</FilePath>
            </File>
            <File>
              <FileName>PCA9555.c</FileName>
              <FileType>1</FileType>
              <FilePath>.\include\drivers\PCA9555.c</FilePath>
            </File>
            <File>
              <FileName>PCA9555.h</FileName>
              <FileType>5</FileType>
              <FilePath>.\include\drivers\PCA9555.h</FilePath>
            </File>
          </Files>
        </Group>
        <Group>
keil/uwb_tag_.c
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,492 @@
#include "mk_trace.h"
#include "mk_uwb.h"
#include "mk_phy.h"
#include "mk_misc.h"
#include "mk_power.h"
#include "mk_sleep_timer.h"
#include "lib_ranging.h"
#include "dw_app.h"
#include "board.h"
#include "mk_calib.h"
#if defined(MK_SS_TWR_DW_INIT)
extern int TagRange(void);
/* Ranging period: 1s */
#define RANGING_PERIOD_MS (1000)
/* This is the delay from the end of the poll frame transmission to the enable of the receiver */
#define POLL_TX_TO_RESP_RX_DLY_US 750U  //yuan700
#define RESP_RX_TO_FINAL_TX_DLY_US 550U
/* Poll delay: 1s */
#define POLL_DELAY  100U //yuan100U
/* Receive response timeout */
#define RESP_RX_TIMEOUT_US 2500U //Yuan500 10mssuccess 300jixian
/* Field index in frame */
#define MSG_SEQ_NUM_IDX 2
#define FINAL_MSG_POLL_TX_TS_IDX 10
#define FINAL_MSG_RESP_RX_TS_IDX 14
#define FINAL_MSG_FINAL_TX_TS_IDX 18
#define DELAY_DEFAULT 50000
#define DELAY_BETWEEN_TWO_FRAME_UUS 600  //yuan1400
#define HALF_SECOND_TIME 62400000
uint16_t CmpTagInList(uint16_t tagid);
uint16_t AddNewTagIntoList(uint16_t tagid);
void AnchorListUpdate(void);
void Rank_ANchor_list_by_dis(void);
struct mk_uwb_configure
{
    uint8_t phy_work_mode; /* PHY_TX / PHY_RX / PHT_TX|PHY_RX */
    struct UWB_CONFIG_T phy_cfg;
};
uint32_t dev_id;
uint8_t group_id;
/* Default communication configuration. */
static struct mk_uwb_configure config = {//yuan
    .phy_work_mode = (uint8_t)(PHY_TX | PHY_RX),
    .phy_cfg.ch_num = 5,                      /* Channel number.                           */
    .phy_cfg.code_index = 9,                  /* TRX preamble code                         */
    .phy_cfg.mean_prf = MEAN_PRF_64M,         /* Mean prf 64/128/256M                      */
    .phy_cfg.data_bit_rate = DATA_BR_6M8,     /* Data rate 6.8M                            */
    .phy_cfg.sync_sym = PREAM_LEN_128,        /* Preamble duration, length of preamble 128 */
    .phy_cfg.sfd_sym = NON_STD_NSFD5_8,          /* Identifier for SFD sequence               */
    .phy_cfg.ranging_bit = 1,                 /* ranging bit set 1                         */
    .phy_cfg.trx_mode = TRX_MODE_15_4A,  /* IEEE802.15.4z - BPRF mode                 */
    .phy_cfg.sts_pkt_cfg = STS_PKT_CFG_0,     /* SP0 Frame                                 */
    .phy_cfg.sts_segnum = STS_SEGNUM_BPRF_1,  /* Number of STS segments in the frame       */
    .phy_cfg.sts_seglen = STS_SEGLEN_BPRF_64, /* Number of symbols in an STS segment       */
    .phy_cfg.rx_ant_id = UWB_RX_ANT_3,    /* UWB RX antenna port                       */
};
///* Default communication configuration. */
//static struct mk_uwb_configure config = {
//    .phy_work_mode = (uint8_t)(PHY_TX | PHY_RX),
//    .phy_cfg.ch_num = 5,                      /* Channel number.                           */
//    .phy_cfg.code_index = 3,                  /* TX preamble code.                         */
//    .phy_cfg.mean_prf = MEAN_PRF_16M,         /* Data rate 6.8M                            */
//    .phy_cfg.data_bit_rate = DATA_BR_110K,     /* data rate 6.8M.                           */
//    .phy_cfg.sync_sym = PREAM_LEN_1024,        /* Preamble duration, length of preamble 128 */
//    .phy_cfg.sfd_sym = NSFD_64,          /* Identifier for SFD sequence               */
//    .phy_cfg.ranging_bit = 1,                 /* ranging bit set.                          */
//    .phy_cfg.trx_mode = TRX_MODE_15_4A,  /* IEEE802.15.4z - BPRF mode                 */
//    .phy_cfg.sts_pkt_cfg = STS_PKT_CFG_0,     /* SP0 Frame                                 */
//    .phy_cfg.sts_segnum = STS_SEGNUM_BPRF_1,  /* Number of STS segments in the frame       */
//    .phy_cfg.sts_seglen = STS_SEGLEN_BPRF_64, /* Number of symbols in an STS segment       */
//    .phy_cfg.rx_ant_id = UWB_RX_ANT_3,    /* UWB RX antenna port                       */
//};
/* Buffer to store received frame */
static uint8_t rx_buf[150];
static uint8_t uwb_sendbuffer[150];
/*     Frames used in the ranging process
 *     Poll message:
 *     - byte 0 - 1: 0x8841 to indicate a data frame using 16-bit addressing.
 *     - byte 2: sequence number, incremented for each new frame.
 *     - byte 3 - 4: PAN Id 0x4B4d
 *     - byte 5 - 6: Destination address
 *     - byte 7 - 8: Source address
 *     - byte 9: Message type (0x02 RANGING_POLL / 0x03 RANGING_RESPONSE / 0x04 RANGING_FINAL)
 *     Response message:
 *     - byte 10: activity code (0x07 to tell the initiator to go on with the ranging exchange)
 *     Final message:
 *     - byte 10 - 13: poll message transmission timestamp.
 *     - byte 14 - 17: response message reception timestamp.
 *     - byte 18 - 21: final message transmission timestamp.
 */
static uint8_t tx_poll_msg[] = {0x41, 0x88, 0, 0x4D, 0x4B, 0x53, 0x45, 0x4D, 0x49, 0x02};
static uint8_t rx_resp_msg[] = {0x41, 0x88, 0, 0x4D, 0x4B, 0x4D, 0x49, 0x53, 0x45, 0x03, 0x07};
static uint8_t tx_final_msg[] = {0x41, 0x88, 0, 0x4D, 0x4B, 0x53, 0x45, 0x4D, 0x49, 0x04, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
/* Count value of phy counter when transmitting and receiving frames */
static uint32_t poll_tx_en_start_u32;
static uint32_t resp_rx_en_start_u32;
static uint32_t final_tx_en_start_u32;
/* 41 bits timestamps of frames transmission/reception. */
static int64_t poll_tx_ts_i64;
static int64_t resp_rx_ts_i64;
static int64_t final_tx_ts_i64;
/* Frame sequence number, incremented after each transmission. */
static uint8_t frame_seq_nb = 0;
static volatile uint16_t rx_state;
static volatile uint16_t rx_state1;
static volatile uint16_t rx_length;
//DW
uint16_t rec_nearbaseid;
uint8_t temp_tag_num;
int32_t test2;
static uint8_t receive_flag=0;
static uint8_t rec_tag_index,tag_num_tosend;
uint32_t start_receive_count,end_receive_count,poll_timeout,current_count,temp_resp;
uint16_t  taglist_total_num,taglist_current_index;  //当前列表总数量
uint8_t  taglist_keeptime[MAX_TAG_LIST_NUM]; //每个标签存活时间
uint16_t taglist_id[MAX_TAG_LIST_NUM],taglist_dist[MAX_TAG_LIST_NUM]; //标签距离和标签的ID
int32_t mainbase_dist,nearbase_distlist[MAX_NEARBASE_NUM],true_nearbase_distlist[MAX_NEARBASE_NUM],true_exsistbase_list[MAX_NEARBASE_NUM],ancsync_time,nextpoll_delaytime,offsettimeus;
uint8_t anclost_times=0 , mainbase_lost_count=0,exsistbase_list[MAX_NEARBASE_NUM],get_newbase=0,nearbase_num,last_nearbase_num,next_nearbase_num;
uint16_t nearbaseid_list[MAX_NEARBASE_NUM],mainbase_id,true_nearbase_idlist[MAX_NEARBASE_NUM],rec_nearbaseid,rec_nearbasepos;
uint16_t u16_nearbase_distlist[MAX_NEARBASE_NUM];
uint32_t temp_count1=0;
uint32_t temp_count2=0;
uint32_t temp_count3=0;
uint32_t temp_count4=0;
uint32_t tempflag=0;
int32_t freq_offset,freq_offset_filter;
int temp_flag,poll_tx_num,resp_rx_num;
extern double distance;
uint32_t count1,count2;
enum SIMPLE_FSM_T
{
    SIMPLE_IDLE = 0,
    SIMPLE_POLL = 1,
    SIMPLE_RESPONSE = 2,
    SIMPLE_FINAL = 3,
};
void uwb_poll_buffer_construct(void)
{
    for(uint8_t i=0;i<nearbase_num;i++)   //标签距离32位转成16位
{
    u16_nearbase_distlist[i] = nearbase_distlist[i];
}
        uwb_sendbuffer[GROUP_ID_IDX] = group_id;
        memcpy(&uwb_sendbuffer[TAG_ID_IDX],&dev_id,2);
    //uwb_sendbuffer[BATTARY_IDX] = bat_percent;
    uwb_sendbuffer[SEQUENCE_IDX] = frame_seq_nb++;
        uwb_sendbuffer[NEARBASENUM_INDEX] = nearbase_num;
        memcpy(&uwb_sendbuffer[NEARBASEID_INDEX],&nearbaseid_list,nearbase_num*2);//基站id
    memcpy(&uwb_sendbuffer[NEARBASEID_INDEX+nearbase_num*2],&u16_nearbase_distlist,nearbase_num*2);
        uwb_sendbuffer[MESSAGE_TYPE_IDX] = MBX_POLL;
        memcpy(&uwb_sendbuffer[ANCHOR_ID_IDX],&mainbase_id,2);
}
static enum SIMPLE_FSM_T state = SIMPLE_IDLE;
/**
 * @brief Correct TX timestamp of the ranging frame.
 *
 * @param[in] timestamp    PHY timer count of TX
 * @return TX timestamp (unit: 15.65ps)
 */
static int64_t ranging_tx_time_correct(uint32_t timestamp)
{
    int64_t tx_timestamp = ranging_tx_time(timestamp);
    // correct antenna delay (TX using the same antenna as RX)
    tx_timestamp += ranging_ant_delays_get(config.phy_cfg.rx_ant_id) / 2;
    return tx_timestamp;
}
/**
 * @brief Correct RX timestamp of the ranging frame.
 *
 * @param[in] ind    MAC RX report
 * @return RX timestamp (unit: 15.65ps)
 */
static int64_t ranging_rx_time_correct(const struct MAC_HW_REPORT_T *ind)
{
    int64_t rx_timestamp = ranging_rx_time(ind);
    // correct antenna delay
    rx_timestamp -= ranging_ant_delays_get(config.phy_cfg.rx_ant_id) / 2;
    return rx_timestamp;
}
/* RX done process handler. */
static void rx_int_callback(struct MAC_HW_REPORT_T *rx_report)
{
    // Power off radio
    power_off_radio();
    rx_state = rx_report->err_code;
    /** UWB RX success */
    if (rx_state == UWB_RX_OK)
    {
        /* Received data does not contain FCS */
        rx_length = rx_report->pkt_len;
        memcpy(rx_buf, rx_report->pkt_data, rx_length);
        /* Calculate rx timestamp */
        resp_rx_ts_i64 = ranging_rx_time_correct(rx_report);
                temp_count1=phy_timer_count_get();
                    //获取发射端时钟偏差
            resp_rx_num++;
            freq_offset=phy_freq_offset_get();
        //    freq_offset_filter=average_filter(freq_offset);//获取频偏
            //int32_t ppm = freq_offset_filter / (int32_t)(ch_center_freq_map[UWB_CH_NUM] * 1e-6);
            //calib_xtal38m4_load_cap_auto_tune(ppm);//利用电容调整晶振适配频偏应在完整的一包之后调整,需要关闭XTAL_AUTO_TUNE_EN å®å®šä¹‰é¿å…æ”¶åŒ…中途校准导致测距错误
            //LOG_INFO(TRACE_MODULE_APP, "poll_tx_num is %d,resp_rx_num is %d,distance is %lf\r\n",poll_tx_num,resp_rx_num,distance);
            receive_flag=1;
    }
    else
    {
        /* UWB_PLD_ERR     payload error             */
        /* UWB_PHR_ERR     PHR error                 */
        /* UWB_SFD_ERR     Sfd error                 */
        /* UWB_BD_ERR      Preamble detection error  */
        /* UWB_TO_ERR      Receive timeout           */
        /* UWB_STS_ERR     STS error                 */
                rx_state1=rx_report->err_code;
        rx_length = 0;
                receive_flag=2;
            temp_count2=phy_timer_count_get();
    }
}
/* TX done process handler. */
static void tx_int_callback(struct MAC_HW_REPORT_T *tx_report)
{
    // Power off radio
    power_off_radio();
    /** UWB TX success */
    if (tx_report->err_code == UWB_TX_OK)
    {
            poll_tx_num++;
            temp_count4=phy_timer_count_get();//测试
            if(temp_flag){
                count2=phy_timer_count_get();
                temp_flag=0;
                return;
            }
            count1=temp_count1;
                temp_flag=1;
    }
}
//注意:因为新注册的标签并不知道基站已经收到了,所以要在下一包立刻将新的标签ID发出,否则标签会一直抢占基站的poll包。
//方法是将新注册的标签添加到下次发送的标签列表头部,其他标签依次向后挪动。
uint16_t AddNewTagIntoList(uint16_t tagid)
{
     uint16_t newindex_cal = taglist_current_index+25;//当前索引+25,为下次索引要发出的值的最大值,如果总数小于这个值,即可放到最后面。
      if(newindex_cal>=taglist_total_num) //如果当前索引是最后一包,那么就加到总索引的后面,如果不是就加到下一次起始索引位置。
      {
        newindex_cal = taglist_total_num;
      }else{
         for(uint16_t i=taglist_total_num;i>newindex_cal;i--)  //从后往前挪地方??就是插入
            {
                taglist_id[i]=taglist_id[i-1];
                taglist_dist[i]=taglist_dist[i-1];
                taglist_keeptime[i]=taglist_keeptime[i-1];
            }
      }
      taglist_total_num++;
      taglist_id[newindex_cal] = tagid;
      taglist_dist[newindex_cal] = 0;
      taglist_keeptime[newindex_cal] = TAG_KEEPTIMES;
      return newindex_cal;
}
uint8_t FindNearBasePos(uint16_t baseid)//寻找当前列表中的基站返回索引
{
    uint8_t i;
    for(i=0;i<nearbase_num;i++)
    {
        if(baseid==nearbaseid_list[i])
            return i;
    }
    if(i==nearbase_num)
        return nearbase_num;
}
void AnchorListUpdate(void)
{
    next_nearbase_num = 0;
            int j=0;
            for(int i=0;i<nearbase_num;i++)
            {
                if(exsistbase_list[i]>0)
                {
          exsistbase_list[i]--;
                    next_nearbase_num++;
                    true_exsistbase_list[j]=exsistbase_list[i];
                    true_nearbase_idlist[j]=nearbaseid_list[i];
                    true_nearbase_distlist[j++]=nearbase_distlist[i];
                }
            }
            nearbase_num = next_nearbase_num;//更新现存基站数
            last_nearbase_num = next_nearbase_num;//更新当前基站数
}
void Rank_ANchor_list_by_dis(void)//按照目前的基站距离进行冒泡排序用临时数组方式将最近的放到最前面,最远的放到最后面
{
for(int i=0;i<last_nearbase_num-1;i++)
            {
                for(int j=0;j<last_nearbase_num-1;j++)
                {
                    if(true_nearbase_distlist[j]>true_nearbase_distlist[j+1])
                    {
                        uint32_t temp_dist,temp_id,temp_exsis;
                        temp_dist=true_nearbase_distlist[j];
                        temp_id = true_nearbase_idlist[j];
                        temp_exsis=true_exsistbase_list[j];
                        true_nearbase_distlist[j]=true_nearbase_distlist[j+1];
                        true_nearbase_idlist[j]=true_nearbase_idlist[j+1];
                        true_exsistbase_list[j]=true_exsistbase_list[j+1];
                        true_nearbase_distlist[j+1]=temp_dist;
                        true_nearbase_idlist[j+1]=temp_id;
                        true_exsistbase_list[j+1]=temp_exsis;
                    }
                }
            }
            for (int i=0;i<last_nearbase_num;i++)
            {
                nearbaseid_list[i]=true_nearbase_idlist[i];
                nearbase_distlist[i]=true_nearbase_distlist[i];
                exsistbase_list[i] = true_exsistbase_list[i];
            }
}
uint16_t CmpTagInList(uint16_t tagid)//找这个新一包的基站在不在现存的taglist中在的话对应位置更新存活时间,不在就增加(确保有效数量小于最大设置数)
{
    uint16_t temp;
    for(uint8_t i=0;i<taglist_total_num;i++)
    {
        if(memcmp(&tagid,&taglist_id[i],2)==0)
        {
            taglist_keeptime[i] = TAG_KEEPTIMES;
            return i;
        }
    }
    if(taglist_total_num<MAX_TAG_LIST_NUM)
    temp = AddNewTagIntoList(tagid);
    return temp;
}
uint32_t count_index;
int tt=1;
int TagRange(void)
{
    // The following peripherals will be initialized in the uwb_open function
    // phy/mac/aes/lsp/phy timers initialized
    uwb_open();
    // Set calibration parameters
    uwb_calibration_params_set(config.phy_cfg.ch_num);
    // set advanced parameters
     struct PHY_ADV_CONFIG_T adv_config = {
        .thres_fap_detect = 40,
        .nth_scale_factor = 4,
        .ranging_performance_mode = 0,
        .skip_weakest_port_en = 0,
    };
    phy_adv_params_configure(&adv_config);
    // uwb configure
    uwb_configure(config.phy_work_mode, board_param.tx_power_fcc[CALIB_CH(config.phy_cfg.ch_num)], &config.phy_cfg);
    ranging_frame_type_set(config.phy_cfg.sts_pkt_cfg);
    // Register rx interrupt callback function
    mac_register_process_handler(tx_int_callback, rx_int_callback);
//#if LOW_POWER_EN
//    // Initialize low power mode
//    power_init();
//    // Enable sleep timer
//    sleep_timer_open(true, SLEEP_TIMER_MODE_ONESHOT, NULL);
//#endif
        uwb_poll_buffer_construct();
        temp_tag_num=0;//临时数量为0
        poll_tx_en_start_u32 = phy_timer_count_get()+US_TO_PHY_TIMER_COUNT(POLL_DELAY);//发送必须要延时发送才可以用于测距否则立即发送会获取时间戳不对,需要计算程序运行时间,避免设置过去时间
        tempflag=uwb_tx(uwb_sendbuffer,13+4*nearbase_num,1,poll_tx_en_start_u32);//立即发送
        #ifdef BOXING
        gpio_pin_set(IO_PIN_5);//测试
        #endif
        //LOG_INFO(TRACE_MODULE_APP, "进入测距",poll_tx_num,resp_rx_num,distance);
        poll_tx_ts_i64 = ranging_tx_time_correct(poll_tx_en_start_u32 + phy_shr_duration());//修正时间戳
        temp_count1=phy_timer_count_get();
        while(mac_is_busy());//等待发送完成
        gpio_pin_clr(IO_PIN_5);//测试
        gpio_pin_set(IO_PIN_5);//测试
        temp_count2=phy_timer_count_get();
        resp_rx_en_start_u32 =  poll_tx_en_start_u32+ US_TO_PHY_TIMER_COUNT(POLL_TX_TO_RESP_RX_DLY_US);//设置发送多少s后接收按target独立时间起点算+ US_TO_PHY_TIMER_COUNT(POLL_TX_TO_RESP_RX_DLY_US为发送后要多久开启接收时间
        temp_resp=resp_rx_en_start_u32;
    //tempflag=uwb_rx(1, resp_rx_en_start_u32, RESP_RX_TIMEOUT_US);//开启接受并设置接收超时
    tempflag=uwb_rx(0,0, RESP_RX_TIMEOUT_US);
    start_receive_count=phy_timer_count_get();
    poll_timeout=nearbase_num*US_TO_PHY_TIMER_COUNT(DELAY_BETWEEN_TWO_FRAME_UUS)+US_TO_PHY_TIMER_COUNT(RESP_RX_TIMEOUT_US);//多一个多0.4ms默认0.4ms计算为0.125*4*100000,默认开启1mss
    end_receive_count=start_receive_count+poll_timeout;
    if(end_receive_count>=UINT32_MAX)
    {end_receive_count-=UINT32_MAX;}
    current_count=phy_timer_count_get();
    count_index=end_receive_count+HALF_SECOND_TIME;
//    if(tt){
    while(current_count<end_receive_count||current_count>end_receive_count+HALF_SECOND_TIME)//循环接受包体,若为124.8K则是+62400000
        {
        current_count=phy_timer_count_get();//不断刷新当前计数器值
        temp_count2=phy_timer_count_get();
        while(mac_is_busy());//等待接收完成
        temp_count3=phy_timer_count_get();
        if(receive_flag==1)//成功接收数据
        {
            receive_flag=0;
    tempflag=uwb_rx(0, 0, RESP_RX_TIMEOUT_US);//立即开启接受并设置0超时
            //接收成功则判断是否为同一组
            if (rx_buf[MESSAGE_TYPE_IDX] == MBX_RESPONSE&&!memcmp(&rx_buf[TAG_ID_IDX],&dev_id,2)&&rx_buf[GROUP_ID_IDX]==group_id) //判断接收到的数据是否是response数据
                            {
                                    memcpy(&rec_nearbaseid,&rx_buf[ANCHOR_ID_IDX],2);
                                    rec_nearbasepos=FindNearBasePos(rec_nearbaseid);
                                    SetANCTimestap(rec_nearbasepos,&rx_buf[RESP_MSG_POLL_RX_TS_IDX],&rx_buf[RESP_MSG_RESP_TX_TS_IDX],(uint32_t)resp_rx_ts_i64,&rx_buf[RESP_MSG_ANC_DISTOFFSET],test2,(uint32_t)poll_tx_ts_i64);
                                    if(rec_nearbasepos>=nearbase_num)          //发现新的基站
                                    {
                                        //get_newbase=1;
                                        nearbase_num++;
                                        nearbaseid_list[rec_nearbasepos] = rec_nearbaseid;
                                    }
                                    exsistbase_list[rec_nearbasepos]=KEEP_TIMES;//更新存活时间
                            memset(rx_buf, 0, sizeof(rx_buf));//清空接收到的用完的数组
                            rx_length=0;//清0长度
//                            uwb_rx(0, 0, RESP_RX_TIMEOUT_US);//立即开启接受并设置0超时
//                            while(mac_is_busy());
                            //break;//成功接收就退出
        }
//                #ifdef BOXING
//        gpio_pin_clr(IO_PIN_5);//测试
//            #endif
        }else if(receive_flag==2){//接收出错
        receive_flag=0;
        tempflag=uwb_rx(0, 0, RESP_RX_TIMEOUT_US);//立即开启接受并设置0超时
        temp_count3=phy_timer_count_get();
//        while(mac_is_busy());
        temp_count1=phy_timer_count_get();
        }
    #ifdef BOXING
        gpio_pin_clr(IO_PIN_5);//测试
        gpio_pin_set(IO_PIN_5);//测试
        #endif
        }
//    }
        #ifdef BOXING
        gpio_pin_clr(IO_PIN_5);//测试
        #endif
        delay_us(1);
        uwb_rx_force_off(1);
        //dwt_forecetrxoff();
         CalculateDists(poll_tx_ts_i64); //计算距离并更新距离表
         AnchorListUpdate();//更新存活基站列表
    //     Rank_ANchor_list_by_dis();//冒泡排序重新按距离重新排列基站列表最小距离存货基站放到最前面
}
#endif