测试阶段:可以跟多个UWB基站测距,以及蓝牙协议转发,现在上传协议是强制写进去的,然后还有那个基站,标签时间同步没有调试正常,
| | |
| | | Dialog DLL: TARMCM1.DLL V1.14.2.0 |
| | | |
| | | <h2>Project:</h2> |
| | | D:\zhangbo\2024\Code\ChinaUWB\ChinaUWBProject-biaoqian-RX - BT\keil\uwb_simple_example.uvprojx |
| | | D:\zhangbo\2024\Code\ChinaUWB\ChinaUWBProject-biaoqian-RX - BT-zuixinceshi\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-biaoqian-RX - BT\keil\Objects\uwb_simple_example.axf" |
| | | ".\Objects\uwb_simple_example.axf" - 0 Error(s), 0 Warning(s). |
| | | compiling lora_3029.c... |
| | | linking... |
| | | D:\zhangbo\2024\Code\ChinaUWB\ChinaUWBProject-biaoqian-RX - BT-zuixinceshi\keil\include\devices\MK800X\Source\ARM\MK800X_ac6_copy.sct(25): warning: L6314W: No section matches pattern *(.XIP_SECTION). |
| | | Program Size: Code=74028 RO-data=9452 RW-data=1628 ZI-data=28056 |
| | | Finished: 0 information, 1 warning and 0 error messages. |
| | | FromELF: creating hex file... |
| | | After Build - User command #1: fromelf.exe --bincombined -o "Output\uwb_simple_example.bin" "D:\zhangbo\2024\Code\ChinaUWB\ChinaUWBProject-biaoqian-RX - BT-zuixinceshi\keil\Objects\uwb_simple_example.axf" |
| | | ".\Objects\uwb_simple_example.axf" - 0 Error(s), 1 Warning(s). |
| | | |
| | | <h2>Software Packages used:</h2> |
| | | |
| | |
| | | D:\keil\pack\MKSEMI\MK800X_DFP\1.0.3\Device\Include |
| | | |
| | | <h2>Collection of Component Files used:</h2> |
| | | Build Time Elapsed: 00:00:00 |
| | | Build Time Elapsed: 00:00:03 |
| | | </pre> |
| | | </body> |
| | | </html> |
| | |
| | | I (include\drivers\mk_gpio.h)(0x67206CDC)
|
| | | I (include\drivers\mk_io.h)(0x67206CDC)
|
| | | I (include\drivers\mk_power.h)(0x67206CDC)
|
| | | I (..\keil\lora_3029.h)(0x67A9CCFF)
|
| | | I (..\keil\lora_3029.h)(0x67BBDB00)
|
| | | F (.\include\drivers\PCA9555.h)(0x67909B96)()
|
| | | 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)(0x67AC72E5)
|
| | | I (include\drivers\Usart.h)(0x67B4382E)
|
| | | I (D:\keil\ARM\ARMCLANG\include\stdint.h)(0x5DDFFD72)
|
| | | I (include\drivers\Usart1.h)(0x672050F0)
|
| | | I (include\drivers\mk_dma.h)(0x672473BD)
|
| | |
| | | I (..\user_config.h)(0x67AC72E5)
|
| | | 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)
|
| | | I (include\drivers\Usart.h)(0x67AC72E5)
|
| | | F (.\include\drivers\Usart.c)(0x67B437EF)(-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)
|
| | | I (include\drivers\Usart.h)(0x67B4382E)
|
| | | I (D:\keil\ARM\ARMCLANG\include\stdint.h)(0x5DDFFD72)
|
| | | I (D:\keil\ARM\ARMCLANG\include\string.h)(0x5DDFFD6C)
|
| | | I (D:\keil\ARM\ARMCLANG\include\stdio.h)(0x5DDFFD72)
|
| | |
| | | I (include\drivers\mk_dma.h)(0x672473BD)
|
| | | I (include\drivers\mk_misc.h)(0x67206CDC)
|
| | | I (include\drivers\mk_clock.h)(0x67206CDC)
|
| | | F (.\include\drivers\serial_at_cmd_app.c)(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/drivers -I ./include/board -I ../keil -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter
-I./RTE/_MK8000_Release
-ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include
-ID:/keil/ARM/CMSIS/Include
-D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC
-o ./objects/serial_at_cmd_app.o -MD)
|
| | | F (.\include\drivers\serial_at_cmd_app.c)(0x67B59A1C)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c
-fno-rtti -funsigned-char
-D__MICROLIB -gdwarf-3 -O0 -ffunction-sections -w -I ./include/drivers -I ./include/board -I ../keil -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter
-I./RTE/_MK8000_Release
-ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include
-ID:/keil/ARM/CMSIS/Include
-D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC
-o ./objects/serial_at_cmd_app.o -MD)
|
| | | I (include\drivers\serial_at_cmd_app.h)(0x672050F0)
|
| | | I (D:\keil\ARM\ARMCLANG\include\stdint.h)(0x5DDFFD72)
|
| | | I (include\drivers\global_param.h)(0x672B0902)
|
| | | I (D:\keil\ARM\ARMCLANG\include\string.h)(0x5DDFFD6C)
|
| | | I (D:\keil\ARM\ARMCLANG\include\stdio.h)(0x5DDFFD72)
|
| | | I (include\drivers\Usart.h)(0x67AC72E5)
|
| | | I (include\drivers\Usart.h)(0x67B4382E)
|
| | | I (include\drivers\mk_flash.h)(0x67206CDC)
|
| | | I (include\drivers\mk_common.h)(0x67206CDC)
|
| | | I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x5DDFFD72)
|
| | |
| | | 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\Usart.h)(0x67AC72E5)
|
| | | I (..\keil\lora_3029.h)(0x67A9CCFF)
|
| | | F (.\include\main\main.c)(0x67B2A1AB)(-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\Usart.h)(0x67B4382E)
|
| | | I (..\keil\lora_3029.h)(0x67BBDB00)
|
| | | F (.\include\main\main.c)(0x67B59611)(-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)
|
| | |
| | | I (include\components\wsf\include\wsf_nvm.h)(0x67206CDE)
|
| | | I (include\components\wsf\include\wsf_types.h)(0x67206CDE)
|
| | | I (include\drivers\mk_power.h)(0x67206CDC)
|
| | | I (include\drivers\Usart.h)(0x67AC72E5)
|
| | | I (include\drivers\Usart.h)(0x67B4382E)
|
| | | I (include\drivers\mk_adc.h)(0x67206CDC)
|
| | | I (include\drivers\mk_sleep_timer.h)(0x67206CDC)
|
| | | I (include\drivers\lis3dh_driver.h)(0x672050F0)
|
| | |
| | | I (include\components\hal\pan_rf.h)(0x676E1685)
|
| | | I (include\drivers\PCA9555.h)(0x67909B96)
|
| | | I (include\drivers\mk_timer.h)(0x67206CDD)
|
| | | I (..\keil\lora_3029.h)(0x67A9CCFF)
|
| | | I (..\keil\lora_3029.h)(0x67BBDB00)
|
| | | I (include\drivers\mk_phy.h)(0x67206CDD)
|
| | | 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 (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)(0x67B29747)(-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)(0x67B425C5)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c
-fno-rtti -funsigned-char
-D__MICROLIB -gdwarf-3 -O0 -ffunction-sections -w -I ./include/board -I ../keil -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter
-I./RTE/_MK8000_Release
-ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include
-ID:/keil/ARM/CMSIS/Include
-D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC
-o ./objects/uwb_app.o -MD)
|
| | | I (include\drivers\mk_trace.h)(0x67206CDC)
|
| | | I (include\drivers\mk_common.h)(0x67206CDC)
|
| | | I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x5DDFFD72)
|
| | |
| | | I (include\board\board.h)(0x67AC74B2)
|
| | | I (include\drivers\mk_gpio.h)(0x67206CDC)
|
| | | I (include\drivers\mk_io.h)(0x67206CDC)
|
| | | I (..\keil\lora_3029.h)(0x67A9CCFF)
|
| | | F (.\lora_3029.c)(0x67B2DCA2)(-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)(0x67A9CCFF)
|
| | | I (..\keil\lora_3029.h)(0x67BBDB00)
|
| | | F (.\lora_3029.c)(0x67BC2CC3)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c
-fno-rtti -funsigned-char
-D__MICROLIB -gdwarf-3 -O0 -ffunction-sections -w -I ./include/board -I ../keil -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter
-I./RTE/_MK8000_Release
-ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include
-ID:/keil/ARM/CMSIS/Include
-D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC
-o ./objects/lora_3029.o -MD)
|
| | | I (..\keil\lora_3029.h)(0x67BBDB00)
|
| | | I (include\drivers\mk_io.h)(0x67206CDC)
|
| | | I (include\drivers\mk_common.h)(0x67206CDC)
|
| | | I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x5DDFFD72)
|
| | |
| | | I (include\drivers\mk_gpio.h)(0x67206CDC)
|
| | | I (include\drivers\mk_io.h)(0x67206CDC)
|
| | | I (include\drivers\mk_spi.h)(0x67206CDD)
|
| | | I (..\keil\lora_3029.h)(0x67A9CCFF)
|
| | | I (..\keil\lora_3029.h)(0x67BBDB00)
|
| | | F (.\include\components\hal\pan_rf.c)(0x6780BCB9)(-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 (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)(0x67A9CCFF)
|
| | | I (..\keil\lora_3029.h)(0x67BBDB00)
|
| | |
| | | |
| | | } |
| | | |
| | | |
| | | void UART0_CheckReceive(void) |
| | | { |
| | | int32_t DMACnt = 0; |
| | | int32_t MaxDataLen = EUART_RX_BUF_SIZE; |
| | | cndtr=get_uart0_dma_cndtr(); |
| | | //缺å°checkä¿æ¤ |
| | | //妿æ£å¨å¾åééå䏿·»å æ°æ®ï¼éåº |
| | | if(m_bEUARTPushingFrms) |
| | | return; |
| | | //夿æ¯å¦æ£å¨Check |
| | | if(m_bEUARTCheckingRec) |
| | | return; |
| | | m_bEUARTCheckingRec = 1; |
| | | if(cndtr== 0) |
| | | { |
| | | m_bEUARTCheckingRec = 0; |
| | | return; |
| | | } |
| | | DMACnt = EUART_RX_BUF_SIZE - cndtr; |
| | | while( m_EUART_DMA_RXPtr != DMACnt && MaxDataLen > 0) |
| | | { |
| | | Usart1ParseDataCallback(m_EUART_DMA_RXBuf[m_EUART_DMA_RXPtr]); |
| | | //waitusart_timer = tag_frequency*USART_KEEPWAKE_TIME; |
| | | m_EUART_DMA_RXPtr++; |
| | | if( m_EUART_DMA_RXPtr >= EUART_RX_BUF_SIZE ) |
| | | { |
| | | m_EUART_DMA_RXPtr = 0; |
| | | } |
| | | DMACnt = EUART_RX_BUF_SIZE - cndtr; |
| | | MaxDataLen--; |
| | | } |
| | | m_bEUARTCheckingRec = 0; |
| | | |
| | | } |
| | | |
| | | #ifndef EXUART_USE_TXDMA |
| | | //æ¥è¯¢æ¹å¼åéæ°æ® |
| | |
| | | void Uart1_Init(void); |
| | | |
| | | void UART_CheckReceive(void); |
| | | void UART0_CheckReceive(void); |
| | | void UART_CheckSend(void); |
| | | void UART_PushFrame(uint8_t* pdata, int32_t data_len); |
| | | void UART_PopFrame(void); |
| | |
| | | |
| | | } |
| | | double d_value; |
| | | #define buff_lenth 1024 |
| | | #define MAX_BASE_STATIONS 10 |
| | | uint8_t DMA_RXBuf_BT[200]={0}; |
| | | uint8_t Forward_BT_buff[buff_lenth]={0}; |
| | | uint8_t report_ancnum_bt=0; |
| | | |
| | | void UsartParseDataHandler(uint8_t data) |
| | | { |
| | | if(state5V_prase_flag&&!g_com_map[MODBUS_MODE]) |
| | | { //å级ç¨åº |
| | | static UsartRecvPackState usart_receive_state = UsartReceiveWaitHead0; |
| | | uint16_t checksum = 0; |
| | | static uint8_t pack_datalen = 0,pack_length = 0,pack_index = 0,pack_msgtype = 0,pack_cmd = CMD_READ; |
| | | static uint8_t index = 0; |
| | | |
| | | |
| | | |
| | | |
| | | if(usart_receive_state == UsartReceiveWaitChecksum) |
| | | { //è¥æ¶å°æ ¡éªåå
|
| | | checksum = 0; |
| | | for(int i = 0; i<pack_length-5; i++) { |
| | | checksum += mUsartReceivePack[i]; |
| | | } |
| | | checksum += pack_cmd; |
| | | checksum += pack_length; |
| | | checksum += pack_index; |
| | | checksum += pack_datalen; |
| | | checksum += pack_msgtype; |
| | | if(((data + checksum)&0xff) == 0xFF) //æ ¡éªéè¿ |
| | | { |
| | | switch(pack_cmd) |
| | | { |
| | | case CMD_WRITE: |
| | | if(pack_index==MODBUS_MODE*2) |
| | | { |
| | | Uart1GpsRecDebugSend(); |
| | | g_com_map[MODBUS_MODE] = 1; |
| | | return; |
| | | } |
| | | //ä»mUsartReceivePackä¸è¯»åpack_lengthé¿åº¦çåèï¼æ¾å°å
¨å±åéä¸,èµå¼ä¿åçåæ°å¹¶ä¸åå
¥flash |
| | | memcpy((uint8_t*)&g_com_map + pack_index, mUsartReceivePack, pack_datalen); |
| | | if(mUsartReceivePack[0]==1) |
| | | UpdateProcess(pack_index); |
| | | //è¿åä¸ä¸ªerrorç¶æ |
| | | //SendComMap(pack_datalen,pack_index); |
| | | save_com_map_to_flash(); |
| | | //delay_ms(100); |
| | | NVIC_SystemReset(); |
| | | break; |
| | | case CMD_READ: |
| | | //readå
ä¸dataåèï¼å³mUsartReceivePack[0]è¡¨ç¤ºæ°æ®é¿åº¦ï¼ |
| | | //ä»g_com_dataç»æä½ä¸ç第indexä½ç½®è¯»åé¿åº¦ä¸ºmUsartReceivePack[0]çåèï¼åéåºæ¥ |
| | | SendComMap(pack_datalen,pack_index>>1); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | usart_receive_state = UsartReceiveWaitHead0; |
| | | pack_index = 0; |
| | | pack_length = 0; |
| | | index=0; |
| | | } else if((usart_receive_state == UsartReceiveWaitData) ) { //è¥ææ¶å°çæ¯æ£å¸¸é讯å
|
| | | mUsartReceivePack[index] = data; |
| | | index++; |
| | | if(index == pack_length-5) { //妿æ¶å°çindexä¸é¿åº¦ç¸ç |
| | | usart_receive_state = UsartReceiveWaitChecksum; |
| | | } |
| | | } else if(usart_receive_state == UsartReceiveWaitDataLen) { //æ¶å°æä»¤ç±»ååè |
| | | pack_datalen = data; |
| | | usart_receive_state = UsartReceiveWaitData; |
| | | } else if(usart_receive_state == UsartReceiveWaitIndex) { //æ¶å°æä»¤ç±»ååè |
| | | pack_index = data; |
| | | usart_receive_state = UsartReceiveWaitDataLen; |
| | | } else if(usart_receive_state == UsartReceiveWaitCMD) { //æ¶å°æä»¤ç±»ååè |
| | | pack_cmd = data; |
| | | usart_receive_state = UsartReceiveWaitIndex; |
| | | } else if(usart_receive_state == UsartReceiveWaitLength) { //æ¶å°é¿åº¦åè |
| | | |
| | | pack_length = data; |
| | | pack_index = 0; |
| | | usart_receive_state = UsartReceiveWaitCMD; |
| | | |
| | | } else if((usart_receive_state == UsartReceiveWaitHead0) && (data == 0x55)) { //æ¶å°ç¬¬ä¸ä¸ªå
头 |
| | | usart_receive_state = UsartReceiveWaitHead1; |
| | | } else if((usart_receive_state == UsartReceiveWaitHead1) && (data == 0xAA)) { //æ¶å°ç¬¬äºä¸ªå
头 |
| | | usart_receive_state = UsartReceiveWaitMsgType; |
| | | } else if ((usart_receive_state == UsartReceiveWaitMsgType) && (data == 0x3)) { |
| | | usart_receive_state = UsartReceiveWaitLength; |
| | | pack_msgtype = data; |
| | | } |
| | | else { |
| | | usart_receive_state = UsartReceiveWaitHead0; |
| | | pack_index = 0; |
| | | pack_length = 0; |
| | | } |
| | | } else if(gps_prase_flag) |
| | | uint8_t buff[buff_lenth] = {0}; |
| | | uint8_t length = 0; |
| | | uint8_t base_station_count = 0; |
| | | memcpy(buff, m_EUART_DMA_RXBuf, 1024); |
| | | //memcpy(buff, Forward_BT_buff, 1024); |
| | | // éå |
| | | for (int n = 0; n < 1024 - 6; n++) |
| | | { |
| | | static uint8_t index = 0; |
| | | //GPSè§£ææ°æ® |
| | | // static ST_BLERecv BLE_recvive; |
| | | GGA_DataStruct jdrecv,wdrecv,Posstate; |
| | | |
| | | //æ¥æ¶æ°æ®å¼å§åæ |
| | | mUsart2ReceivePack[index] = data; //charæ°ç»ä¼ è¿æ¥åæ°data |
| | | mUsart2ReceivePack_before = mUsart2ReceivePack_now; |
| | | mUsart2ReceivePack_now=data; |
| | | index++; |
| | | if( mUsart2ReceivePack_before == 0x0D && mUsart2ReceivePack_now==0x0A )//æ¥æ¶æ°æ®å°â0x0D 0x0Aâç»æ |
| | | // å
头 0x55 0xAA 0x41 |
| | | if (buff[n] == 0x55 && buff[n+1] == 0xAA && buff[n+2] == 0x41) |
| | | { |
| | | //è§£æè¯¥æ¡GPSæ¥æ |
| | | |
| | | analysis_num=sscanf((char*)mUsart2ReceivePack,"$%[^,],%*[^,],%[^,],%*[^,],%[^,],%*[^,],%[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*s",gps_header,wdrecv.m_pData,jdrecv.m_pData,Posstate.m_pData); |
| | | if(!memcmp(gps_header,"GNGGA",5)) |
| | | { |
| | | if(g_com_map[MODBUS_MODE]) |
| | | LOG_INFO(TRACE_MODULE_APP,"%s", mUsart2ReceivePack); |
| | | d_value = strtod(wdrecv.m_pData,NULL); |
| | | if(d_value>1) |
| | | { |
| | | blink_led(&gps_success_state); |
| | | wd=strtod(wdrecv.m_pData,NULL); |
| | | jd=strtod(jdrecv.m_pData,NULL); |
| | | pos_state=atoi(Posstate.m_pData); |
| | | } |
| | | } |
| | | index = 0; |
| | | if(pos_state!=0) |
| | | { |
| | | //4g.jd=jd; |
| | | //4g.wd=wd; |
| | | gps_timeout_flag=1;//ä¸è¶
æ¶æ¥æ¶ç¶æ |
| | | gps_need_data_flag=0;//æ¥æ¶æ°æ®å®æ |
| | | gps_wait_count=0;//æ¸
0æ¥æ¶ç¶æ |
| | | // gps_enable_flag=0;//æ¶å°æææ°æ®å
³éGPS |
| | | report_ancnum_bt=buff[n+4]; |
| | | length = buff[n+3]; |
| | | if (n + 6 + report_ancnum_bt * 6 + length > 1024) { |
| | | continue; // å¦ææ°æ®è¶çï¼è·³è¿è¯¥å
|
| | | } |
| | | memset(mUsart2ReceivePack,0,sizeof(mUsart2ReceivePack)); |
| | | memset(wdrecv.m_pData,0,sizeof(wdrecv.m_pData)); |
| | | memset(jdrecv.m_pData,0,sizeof(jdrecv.m_pData)); |
| | | memset(Posstate.m_pData,0,sizeof(Posstate.m_pData)); |
| | | index=0; |
| | | mUsart2ReceivePack_before=0; |
| | | mUsart2ReceivePack_now=0; |
| | | |
| | | // å°æ°æ®å¤å¶å° DMA ç¼å²åº |
| | | memcpy(DMA_RXBuf_BT, &buff[n+4], length); |
| | | |
| | | // 为äºé¿å
夿¬¡éå¤è§£æåä¸ä¸ªæ°æ®å
ï¼å¯ä»¥å¨è¿éæ·»å è·³è· |
| | | n += 6 + report_ancnum_bt * 6 + length - 1; // è·³è¿å½åæ°æ®å
|
| | | } |
| | | } |
| | | |
| | | // æ¸
é¤ä¸´æ¶ç¼å²åº |
| | | memset(buff, 0, buff_lenth); |
| | | |
| | | // if(state5V_prase_flag&&!g_com_map[MODBUS_MODE]) |
| | | // { //å级ç¨åº |
| | | // static UsartRecvPackState usart_receive_state = UsartReceiveWaitHead0; |
| | | // uint16_t checksum = 0; |
| | | // static uint8_t pack_datalen = 0,pack_length = 0,pack_index = 0,pack_msgtype = 0,pack_cmd = CMD_READ; |
| | | // static uint8_t index = 0; |
| | | |
| | | |
| | | |
| | | |
| | | // if(usart_receive_state == UsartReceiveWaitChecksum) |
| | | // { //è¥æ¶å°æ ¡éªåå
|
| | | // checksum = 0; |
| | | // for(int i = 0; i<pack_length-5; i++) { |
| | | // checksum += mUsartReceivePack[i]; |
| | | // } |
| | | // checksum += pack_cmd; |
| | | // checksum += pack_length; |
| | | // checksum += pack_index; |
| | | // checksum += pack_datalen; |
| | | // checksum += pack_msgtype; |
| | | // if(((data + checksum)&0xff) == 0xFF) //æ ¡éªéè¿ |
| | | // { |
| | | // switch(pack_cmd) |
| | | // { |
| | | // case CMD_WRITE: |
| | | // if(pack_index==MODBUS_MODE*2) |
| | | // { |
| | | // Uart1GpsRecDebugSend(); |
| | | // g_com_map[MODBUS_MODE] = 1; |
| | | // return; |
| | | // } |
| | | // //ä»mUsartReceivePackä¸è¯»åpack_lengthé¿åº¦çåèï¼æ¾å°å
¨å±åéä¸,èµå¼ä¿åçåæ°å¹¶ä¸åå
¥flash |
| | | // memcpy((uint8_t*)&g_com_map + pack_index, mUsartReceivePack, pack_datalen); |
| | | // if(mUsartReceivePack[0]==1) |
| | | // UpdateProcess(pack_index); |
| | | // //è¿åä¸ä¸ªerrorç¶æ |
| | | // //SendComMap(pack_datalen,pack_index); |
| | | // save_com_map_to_flash(); |
| | | // //delay_ms(100); |
| | | // NVIC_SystemReset(); |
| | | // break; |
| | | // case CMD_READ: |
| | | // //readå
ä¸dataåèï¼å³mUsartReceivePack[0]è¡¨ç¤ºæ°æ®é¿åº¦ï¼ |
| | | // //ä»g_com_dataç»æä½ä¸ç第indexä½ç½®è¯»åé¿åº¦ä¸ºmUsartReceivePack[0]çåèï¼åéåºæ¥ |
| | | // SendComMap(pack_datalen,pack_index>>1); |
| | | // break; |
| | | // default: |
| | | // break; |
| | | // } |
| | | // } |
| | | // usart_receive_state = UsartReceiveWaitHead0; |
| | | // pack_index = 0; |
| | | // pack_length = 0; |
| | | // index=0; |
| | | // } else if((usart_receive_state == UsartReceiveWaitData) ) { //è¥ææ¶å°çæ¯æ£å¸¸é讯å
|
| | | // mUsartReceivePack[index] = data; |
| | | // index++; |
| | | // if(index == pack_length-5) { //妿æ¶å°çindexä¸é¿åº¦ç¸ç |
| | | // usart_receive_state = UsartReceiveWaitChecksum; |
| | | // } |
| | | // } else if(usart_receive_state == UsartReceiveWaitDataLen) { //æ¶å°æä»¤ç±»ååè |
| | | // pack_datalen = data; |
| | | // usart_receive_state = UsartReceiveWaitData; |
| | | // } else if(usart_receive_state == UsartReceiveWaitIndex) { //æ¶å°æä»¤ç±»ååè |
| | | // pack_index = data; |
| | | // usart_receive_state = UsartReceiveWaitDataLen; |
| | | // } else if(usart_receive_state == UsartReceiveWaitCMD) { //æ¶å°æä»¤ç±»ååè |
| | | // pack_cmd = data; |
| | | // usart_receive_state = UsartReceiveWaitIndex; |
| | | // } else if(usart_receive_state == UsartReceiveWaitLength) { //æ¶å°é¿åº¦åè |
| | | |
| | | // pack_length = data; |
| | | // pack_index = 0; |
| | | // usart_receive_state = UsartReceiveWaitCMD; |
| | | |
| | | // } else if((usart_receive_state == UsartReceiveWaitHead0) && (data == 0x55)) { //æ¶å°ç¬¬ä¸ä¸ªå
头 |
| | | // usart_receive_state = UsartReceiveWaitHead1; |
| | | // } else if((usart_receive_state == UsartReceiveWaitHead1) && (data == 0xAA)) { //æ¶å°ç¬¬äºä¸ªå
头 |
| | | // usart_receive_state = UsartReceiveWaitMsgType; |
| | | // } else if ((usart_receive_state == UsartReceiveWaitMsgType) && (data == 0x3)) { |
| | | // usart_receive_state = UsartReceiveWaitLength; |
| | | // pack_msgtype = data; |
| | | // } |
| | | // else { |
| | | // usart_receive_state = UsartReceiveWaitHead0; |
| | | // pack_index = 0; |
| | | // pack_length = 0; |
| | | // } |
| | | // } else if(gps_prase_flag) |
| | | // { |
| | | // static uint8_t index = 0; |
| | | ////GPSè§£ææ°æ® |
| | | //// static ST_BLERecv BLE_recvive; |
| | | // GGA_DataStruct jdrecv,wdrecv,Posstate; |
| | | // |
| | | // //æ¥æ¶æ°æ®å¼å§åæ |
| | | // mUsart2ReceivePack[index] = data; //charæ°ç»ä¼ è¿æ¥åæ°data |
| | | // mUsart2ReceivePack_before = mUsart2ReceivePack_now; |
| | | // mUsart2ReceivePack_now=data; |
| | | // index++; |
| | | // if( mUsart2ReceivePack_before == 0x0D && mUsart2ReceivePack_now==0x0A )//æ¥æ¶æ°æ®å°â0x0D 0x0Aâç»æ |
| | | // { |
| | | // //è§£æè¯¥æ¡GPSæ¥æ |
| | | // |
| | | // analysis_num=sscanf((char*)mUsart2ReceivePack,"$%[^,],%*[^,],%[^,],%*[^,],%[^,],%*[^,],%[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*s",gps_header,wdrecv.m_pData,jdrecv.m_pData,Posstate.m_pData); |
| | | // if(!memcmp(gps_header,"GNGGA",5)) |
| | | // { |
| | | // if(g_com_map[MODBUS_MODE]) |
| | | // LOG_INFO(TRACE_MODULE_APP,"%s", mUsart2ReceivePack); |
| | | // d_value = strtod(wdrecv.m_pData,NULL); |
| | | // if(d_value>1) |
| | | // { |
| | | // blink_led(&gps_success_state); |
| | | // wd=strtod(wdrecv.m_pData,NULL); |
| | | // jd=strtod(jdrecv.m_pData,NULL); |
| | | // pos_state=atoi(Posstate.m_pData); |
| | | // } |
| | | // } |
| | | // index = 0; |
| | | // if(pos_state!=0) |
| | | // { |
| | | // //4g.jd=jd; |
| | | // //4g.wd=wd; |
| | | // gps_timeout_flag=1;//ä¸è¶
æ¶æ¥æ¶ç¶æ |
| | | // gps_need_data_flag=0;//æ¥æ¶æ°æ®å®æ |
| | | // gps_wait_count=0;//æ¸
0æ¥æ¶ç¶æ |
| | | //// gps_enable_flag=0;//æ¶å°æææ°æ®å
³éGPS |
| | | // } |
| | | // memset(mUsart2ReceivePack,0,sizeof(mUsart2ReceivePack)); |
| | | // memset(wdrecv.m_pData,0,sizeof(wdrecv.m_pData)); |
| | | // memset(jdrecv.m_pData,0,sizeof(jdrecv.m_pData)); |
| | | // memset(Posstate.m_pData,0,sizeof(Posstate.m_pData)); |
| | | // index=0; |
| | | // mUsart2ReceivePack_before=0; |
| | | // mUsart2ReceivePack_now=0; |
| | | // } |
| | | // } |
| | | |
| | | } |
| | | |
| | |
| | | { |
| | | lora_tx_flag++; |
| | | } |
| | | uint8_t DMA_RXBuf_BT[200]={0}; |
| | | |
| | | |
| | | //void uart0_receive_callback() |
| | | //{ |
| | | // uint8_t buff[buff_lenth]={0}; |
| | | // uint8_t lenth=0; |
| | | // |
| | | // uart_receive(UART_ID0,Forward_BT_buff,buff_lenth,uart0_receive_callback); |
| | | // memcpy(buff,Forward_BT_buff,1024); |
| | | // for(int n=0;n<1024;n++) |
| | | // { |
| | | // if(buff[n]==0x55) |
| | | // { |
| | | // if(buff[n+1]==0xAA) |
| | | // { |
| | | // if(buff[n+2]==0x41) |
| | | // { |
| | | // lenth=buff[n+4]; |
| | | // memcpy(DMA_RXBuf_BT,&buff[n+4],lenth); |
| | | // } |
| | | // } |
| | | // |
| | | // } |
| | | // } |
| | | // memset(buff, 0, buff_lenth); |
| | | // memset(DMA_RXBuf_BT, 0, buff_lenth); |
| | | // if(buff[0]==0x55||buff[1]==0xAA||buff[2]==0x41) |
| | | // { |
| | | // uint8_t lenth=0; |
| | | // lenth=((buff[4]*2)+(buff[4]*2)+1); |
| | | // memcpy(DMA_RXBuf_BT,&buff[4],lenth); |
| | | // } |
| | | //} |
| | | |
| | | //uint8_t base_station_count = 0; |
| | | //uint8_t last_ids[MAX_BASE_STATIONS] = {0}; |
| | | void uart0_receive_callback() |
| | | { |
| | | uint8_t buff[200]={0}; |
| | | memcpy(buff,m_EUART_DMA_RXBuf,100); |
| | | if(buff[0]==0x55||buff[1]==0xAA||buff[2]==0x41) |
| | | { |
| | | uint8_t lenth=0; |
| | | lenth=((buff[4]*2)+(buff[4]*2)+1); |
| | | memcpy(DMA_RXBuf_BT,&buff[4],lenth); |
| | | } |
| | | uart_receive(UART_ID0,m_EUART_DMA_RXBuf,EUART_RX_BUF_SIZE,uart0_receive_callback); |
| | | } |
| | | |
| | | |
| | | static void voltage_input_handler(enum IO_PIN_T pin) |
| | | { |
| | | |
| | |
| | | |
| | | |
| | | void IdleTask(void) |
| | | { |
| | | if(gpio_pin_get_val(INPUT_5V_Pin)) |
| | | { |
| | | |
| | | if(state5v==0) |
| | | { |
| | | state5v=1; |
| | | state5V_prase_flag=state5v; |
| | | gps_prase_flag=0;//è§£é¤gpsè§£æ |
| | | uart1_change_from_gps_to_debug();//æµè¯ |
| | | // uart_receive(UART_ID1,m_EUART_DMA_RXBuf,EUART_RX_BUF_SIZE,uart_receive_callback);//å¼å¯dma |
| | | //UartInit(); |
| | | } |
| | | |
| | | //UART_CheckSend(); |
| | | } else { |
| | | if(state5v==1) |
| | | { |
| | | g_com_map[MODBUS_MODE] = 0; |
| | | state5v=0; |
| | | state5V_prase_flag=state5v; |
| | | gps_prase_flag=1;//æ¢å¤gpsè§£æ |
| | | uart1_change_from_debug_to_gps();//æµè¯ |
| | | // uart_receive(UART_ID1,m_EUART_DMA_RXBuf,EUART_RX_BUF_SIZE,uart_receive_callback);//å¼å¯dma |
| | | //UartDeinit(); |
| | | } |
| | | } |
| | | UART_CheckReceive(); |
| | | { |
| | | UART0_CheckReceive(); |
| | | } |
| | | int bind_check(void) |
| | | { |
| | |
| | | io_pin_mux_set(LORA_CLK, IO_FUNC2); |
| | | io_pin_mux_set(LORA_DIO, IO_FUNC0); |
| | | |
| | | // io_pin_mux_set(LORA_DIO, IO_FUNC0); |
| | | // gpio_pin_set_dir(LORA_DIO , GPIO_DIR_OUT, 0); |
| | | // io_pull_set(LORA_DIO, IO_HIGH_Z, IO_PULL_UP_NONE); |
| | | |
| | | |
| | | // io_pin_mux_set(LORA_CS2, IO_FUNC0); |
| | | // gpio_pin_set_dir(LORA_CS2 , GPIO_DIR_OUT, 0); |
| | | // io_pull_set(LORA_CS2, IO_HIGH_Z, IO_PULL_UP_NONE); |
| | | |
| | | // //ADC |
| | | // io_pin_mux_set(ADC_PIN, IO_FUNC1); |
| | | // io_pull_set(ADC_PIN, IO_HIGH_Z, IO_PULL_UP_NONE); |
| | | // //串å£0 |
| | | // io_pin_mux_set(UART0_RX, IO_FUNC4); |
| | | // io_pin_mux_set(UART0_TX, IO_FUNC4); |
| | | // board_debug_console_open(TRACE_PORT_UART0); |
| | | // uart_receive(UART_ID0,m_EUART_DMA_RXBuf,EUART_RX_BUF_SIZE,uart0_receive_callback);//å¼å¯dma |
| | | // |
| | | // //串å£1 |
| | | // io_pin_mux_set(UART1_RX, IO_FUNC4); |
| | | // io_pin_mux_set(UART1_TX, IO_FUNC4); |
| | | //串å£0 |
| | | io_pin_mux_set(UART0_RX, IO_FUNC4); |
| | | io_pin_mux_set(UART0_TX, IO_FUNC4); |
| | | |
| | | board_debug_console_open(TRACE_PORT_UART0); |
| | | // uart_receive(UART_ID0,Forward_BT_buff,buff_lenth,uart0_receive_callback); |
| | | uart_receive(UART_ID0,m_EUART_DMA_RXBuf,EUART_RX_BUF_SIZE,uart0_receive_callback);//å¼å¯dma |
| | | // uart_receive(UART_ID0,&uart0_buffer,1024,uart0_receive_callback); |
| | | // uart_receive(UART_ID0,DMA_RXBuf_BT,buff_lenth,uart0_receive_callback); |
| | | |
| | | //串å£1 |
| | | io_pin_mux_set(UART1_RX, IO_FUNC4); |
| | | io_pin_mux_set(UART1_TX, IO_FUNC4); |
| | | } |
| | | void spi_init() |
| | | { |
| | |
| | | if(RX_Buffer[MSG_TYPE_IDX]==LORA_MSGTYPE_RANGEPOLL) |
| | | { |
| | | |
| | | // time_flag_lorarx=phy_timer_count_get(); |
| | | uwb_open(); |
| | | //gpio_pin_clr(IO_PIN_5);//æµè¯ |
| | | |
| | | UwbRange(); |
| | | |
| | | uwb_ceju_count++; |
| | |
| | | switch(RX_Buffer[PWTAG_RW_FLAG_IDX]) |
| | | { |
| | | case WGRSP_RWTAG_NONE: |
| | | // current_count = HAL_LPTIM_ReadCounter(&hlptim1); |
| | | // sleep_time_count=xtal_38m4_off_time(); |
| | | wg_report_freq = RX_Buffer[POLL_FREQ_IDX]+400; |
| | | memcpy(&rec_delaytime,&RX_Buffer[NEXTPOLL_TIME_IDX],2); |
| | | if(report_ancnum<2) |
| | | { |
| | | datalen_offset = report_ancnum*85; |
| | | }else{ |
| | | datalen_offset = (report_ancnum-1)*46+85; |
| | | } |
| | | rec_secdelay = RX_Buffer[PWTAG_SECDELAY_IDX]; |
| | | if(BufferSize!=13||rec_secdelay>20) |
| | | { |
| | | rec_secdelay = 0; |
| | | } |
| | | |
| | | sleep_time_count = rec_delaytime*3.2768 - delaytime-datalen_offset; |
| | | while(sleep_time_count>=32768) |
| | | sleep_time_count-=32768; |
| | | sleep_timer_start(sleep_time_count); |
| | | //sleep_timer_start(sleep_time_count);sleep_timer_start(__MS_TO_32K_CNT(1000));//æµè¯ |
| | | // #define __MS_TO_32K_CNT(ms) ((uint32_t)((float)(ms)*32768.0f / 1000.0f)) |
| | | // __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); |
| | | |
| | | // wg_report_freq = RX_Buffer[POLL_FREQ_IDX]+400; |
| | | // memcpy(&rec_delaytime,&RX_Buffer[NEXTPOLL_TIME_IDX],2); |
| | | // if(report_ancnum<2) |
| | | // { |
| | | // datalen_offset = report_ancnum*85; |
| | | // }else{ |
| | | // datalen_offset = (report_ancnum-1)*46+85; |
| | | // } |
| | | // rec_secdelay = RX_Buffer[PWTAG_SECDELAY_IDX]; |
| | | // if(BufferSize!=13||rec_secdelay>20) |
| | | // { |
| | | // rec_secdelay = 0; |
| | | // } |
| | | // |
| | | // sleep_time_count = rec_delaytime*3.2768 - delaytime-datalen_offset; |
| | | // while(sleep_time_count>=32768) |
| | | // sleep_time_count-=32768; |
| | | // sleep_timer_start(sleep_time_count); |
| | | |
| | | break; |
| | | case WGRSP_RWTAG_READ: |
| | | no_rx_flag = 1; |
| | |
| | | { |
| | | // io_pin_mux_set(_4G_USART_RX_Pin,IO_FUNC0);//æåå
io å为æ®éGPIO |
| | | gpio_pin_set_dir(LORA_DIO , GPIO_DIR_IN, 0); |
| | | io_pull_set(LORA_DIO, IO_HIGH_Z, IO_PULL_UP_LEVEL4); |
| | | io_pull_set(LORA_DIO, IO_HIGH_Z, IO_PULL_UP_NONE); |
| | | gpio_enable_irq(LORA_DIO, GPIO_IRQ_TYPE_RISING_EDGE, irq_handler); |
| | | } |
| | | extern uint8_t pca9555writedata_input[10];//æåè¾å
¥å¯å卿æé
ç½®çæ°ç» |
| | |
| | | int main(void) |
| | | { |
| | | board_clock_run(); |
| | | // boot_deinit(); |
| | | board_debug_console_open(TRACE_PORT_UART1); |
| | | // boot_deinit(); |
| | | // board_debug_console_open(TRACE_PORT_UART1); |
| | | // Reset reason |
| | | reset_cause_get(); |
| | | reset_cause_clear(); |
| | |
| | | Board_LORA_NVIC_Init(Lora_irq_handler); |
| | | Lora_init(); |
| | | rf_set_default_para(DEFAULT_WG_SET_FREQ,DEFAULT_WG_SET_SF); |
| | | // IIC2_Init(); |
| | | // Accelerometer_Init(); |
| | | IIC2_Init(); |
| | | Accelerometer_Init(); |
| | | //LIS3DH_Data_Init(); |
| | | // PCA9555_init(); |
| | | PCA9555_init(); |
| | | |
| | | // adc_get(&sample[0], NUM_SAMPLES, adc_callback);//adcéæ · |
| | | Program_Init(); |
| | |
| | | //#endif |
| | | |
| | | // rf_single_tx_data(TXBuffer,10,2); |
| | | // uart_receive(UART_ID1,m_EUART_DMA_RXBuf,EUART_RX_BUF_SIZE,uart_receive_callback); |
| | | // uart_receive(UART_ID0,m_EUART_DMA_RXBuf,EUART_RX_BUF_SIZE,uart0_receive_callback); |
| | | // |
| | | //// Initialize low power mode |
| | | // power_init(); |
| | |
| | | |
| | | |
| | | |
| | | // pca_input_detection_init(pca_handler); |
| | | //#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 |
| | | |
| | | |
| | | Uwbinit(); |
| | | while (1) |
| | |
| | | // RED_LED_OFF; |
| | | // BT_LED_OFF; |
| | | // // gpio_pin_clr(IO_PIN_5); |
| | | |
| | | Lora_Tx_Poll(); |
| | | |
| | | IdleTask(); |
| | | // UwbRange(); |
| | | |
| | | // if(flag_TCP_reconnectting||IfTCPConnected()) |
| | |
| | | // flag_secondtask = 0; |
| | | // SecondTask(); |
| | | // } |
| | | // IdleTask(); |
| | | |
| | | // //3ç§æ
åµåé½è¦åå
åä¼ç |
| | | // //if(send_flag){ |
| | | // //message_construct(); |
| | |
| | | extern uint32_t freq_list[4]; |
| | | extern uint8_t DMA_RXBuf_BT[200]; |
| | | extern uint8_t report_ancnum; |
| | | extern uint8_t report_ancnum_bt; |
| | | void LoraReportPoll(void) |
| | | { |
| | | // delay_ms(100); |
| | | uint8_t report_ancnum_bt=0; |
| | | |
| | | #ifdef _USE_BAR |
| | | GetPressAndHeight(); |
| | | intheight = Height*100; |
| | |
| | | } |
| | | } |
| | | |
| | | 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+30; |
| | | #else |
| | | lora_sendbuffer[MSG_TYPE_IDX] = LORA_MSGTYPE_TAGMSGTOWG; |
| | | lora_sendbuffer[MSG_LENGTH] = 4*report_ancnum+4*report_ancnum_bt+ANCID_IDX; |
| | | lora_sendbuffer[MSG_LENGTH] = 4*report_ancnum+ANCID_IDX; |
| | | #endif |
| | | 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]=0x01; |
| | | // lora_sendbuffer[GATEWAY_CHANL]=0x02; |
| | | // lora_sendbuffer[CHANL_NUM]=0x03; |
| | | // lora_sendbuffer[STATE_IDX] = !GET_USERKEY|stationary_flag<<1; |
| | | #ifdef USE_GPS |
| | | memcpy(&lora_sendbuffer[GPS_JINGDU_IDX],&gps_jingdu,8); |
| | |
| | | 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); |
| | | |
| | | uint8_t LORA_RETRANSNUSSION_BT=0; |
| | | LORA_RETRANSNUSSION_BT=ANCID_IDX+report_ancnum*2+1; |
| | | uint8_t LORA_RETRANSNUSSION_BT=0; |
| | | if(0<report_ancnum_bt&&report_ancnum_bt<11) |
| | | { |
| | | lora_sendbuffer[MSG_TYPE_IDX] = LORA_MSGTYPE_TAGMSGTOWG_BT; |
| | | LORA_RETRANSNUSSION_BT=ANCID_IDX+report_ancnum*4; |
| | | //LORA_RETRANSNUSSION_BT report_ancnum_bt |
| | | lora_sendbuffer[LORA_RETRANSNUSSION_BT] = 0x2D; //èçä¸ä¼ æ è¯ç¬¦ |
| | | DMA_RXBuf_BT[0]=report_ancnum_bt; //èçåºç«æ°é |
| | | memcpy(&lora_sendbuffer[LORA_RETRANSNUSSION_BT],&DMA_RXBuf_BT[1],report_ancnum_bt*2); //åºç«ID |
| | | memcpy(&lora_sendbuffer[LORA_RETRANSNUSSION_BT+report_ancnum_bt*2],&DMA_RXBuf_BT[1+report_ancnum_bt*2],report_ancnum_bt*2);//åºç«è·ç¦» |
| | | lora_sendbuffer[LORA_RETRANSNUSSION_BT] = 0x2D; //èçä¸ä¼ æ è¯ç¬¦ |
| | | memcpy(&lora_sendbuffer[LORA_RETRANSNUSSION_BT+1],&DMA_RXBuf_BT[0],report_ancnum_bt*2+1); //åºç«ID |
| | | memcpy(&lora_sendbuffer[LORA_RETRANSNUSSION_BT+report_ancnum_bt*2+2],&DMA_RXBuf_BT[1+report_ancnum_bt*2],report_ancnum_bt*2);//åºç«è·ç¦» |
| | | lora_sendbuffer[MSG_LENGTH] = 4*report_ancnum+4*report_ancnum_bt+ANCID_IDX+4; |
| | | } |
| | | if(lora_sendbuffer[LORA_RETRANSNUSSION_BT]==0x2D) |
| | | { |
| | | checksum = Checksum_u16(lora_sendbuffer,4*report_ancnum_bt+4*report_ancnum+ANCID_IDX+1); |
| | | checksum = Checksum_u16(lora_sendbuffer,4*report_ancnum_bt+4*report_ancnum+ANCID_IDX+2); |
| | | memcpy(&lora_sendbuffer[ANCID_IDX+report_ancnum_bt*4+report_ancnum*4+2],&checksum,2); |
| | | } |
| | | else |
| | |
| | | checksum = Checksum_u16(lora_sendbuffer,4*report_ancnum+ANCID_IDX); |
| | | memcpy(&lora_sendbuffer[ANCID_IDX+report_ancnum*4],&checksum,2); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //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+report_ancnum_bt*2+4,0); |
| | | |
| | | LORA_3029_SINGLE_SEND(lora_sendbuffer,ANCID_IDX+report_ancnum*4+report_ancnum_bt*4+4,0); |
| | | memset(DMA_RXBuf_BT, 0,200); |
| | | memset(&lora_sendbuffer[ANCID_IDX],0,200); |
| | | // rf_single_tx_data(lora_sendbuffer,ANCID_IDX+report_ancnum*4+2,2); |
| | | //rf_enter_continous_rx(); |
| | | |
| | |
| | | // group_min_dist[group_id] = 0xffff; |
| | | // Radio.Standby(); |
| | | //rf_antenna_close(); |
| | | rf_set_mode(RF_MODE_STB3); |
| | | uint32_t para; |
| | | // rf_set_mode(RF_MODE_STB3); |
| | | // uint32_t para; |
| | | // frqe=((UWB_CHANNEL_FRQ+group_id)*100000); |
| | | para=freq_list[1] * 100000; |
| | | // para=freq_list[1] * 100000; |
| | | //// rf_set_default_para(frqe,UWB_CHANNEL_SF); |
| | | // rf_set_carrier_wave_off(); |
| | | // rf_set_carrier_wave_on(); |
| | | rf_set_freq(para); |
| | | rf_set_sf(5); |
| | | // rf_set_tx_power(para); |
| | | // rf_set_carrier_wave_freq(freq_list[1] * 100000); |
| | | //SwitchLoraSettings(UWB_CHANNEL_FRQ+group_id,UWB_CHANNEL_SF,0); |
| | | dangqian_frqe=rf_read_freq(); |
| | | //// rf_set_carrier_wave_on(); |
| | | // rf_set_freq(para); |
| | | // rf_set_sf(5); |
| | | //// rf_set_tx_power(para); |
| | | //// rf_set_carrier_wave_freq(freq_list[1] * 100000); |
| | | // //SwitchLoraSettings(UWB_CHANNEL_FRQ+group_id,UWB_CHANNEL_SF,0); |
| | | // dangqian_frqe=rf_read_freq(); |
| | | // LoraSendComMap(WGRSP_RWTAG_READ); |
| | | |
| | | //delay_us(5000); |
| | |
| | | #define LORA_DIO IO_PIN_7 |
| | | //#define LORA_DIO IO_PIN_4 |
| | | #define ANC_MAX_NUM 50 |
| | | #define LORA_REPORT_MAXANC_NUM 7 |
| | | #define LORA_REPORT_MAXANC_NUM 10 |
| | | //#define TEST_FREQ |
| | | #ifdef TEST_FREQ |
| | | #define LORA_UPCHANNEL_FRQ 456 |
| | |
| | | #define BAT_IDX 7 //æ ç¾çµé |
| | | #define STATE_IDX 8 |
| | | #define BAR_HEIGHT_IDX 9 //æ°åé«åº¦ |
| | | #define GATEWAY_CHANL 9 |
| | | #define CHANL_NUM 10 |
| | | #define ANCNUM_IDX 11 |
| | | #define ANCID_IDX 12 //æ ¡éªå¨4*ancnum+ANCID_IDX ä½ç½® |
| | | // #define LORA_RETRANSNUSSION_BT 13 //LORA转åèçåè®®æ è¯ç¬¦ |
| | |
| | | |
| | | uint8_t i; |
| | | uint16_t tempid; |
| | | // 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); |
| | | receive_flag = 0; |
| | | flag_recsuccess = 0; |
| | | // 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_clr(IO_PIN_5); |
| | | |
| | | uwb_rxflag=uwb_rx(0, 0, range_timeout_us);//å¼å¯æ¥æ¶ |
| | | // gpio_pin_clr(IO_PIN_5); |
| | | // gpio_pin_clr(IO_PIN_5);//æµè¯ |
| | | #ifdef DEBUG_BOXING |
| | | // gpio_pin_clr(IO_PIN_5);//æµè¯ |
| | | // gpio_pin_set(IO_PIN_5);//æµè¯ |
| | | #endif |
| | | // #ifdef DEBUG_BOXING |
| | | // gpio_pin_set(IO_PIN_5);//æµè¯ |
| | | // #endif |
| | | // #ifdef DEBUG_BOXING |
| | | // gpio_pin_set(IO_PIN_5);//æµè¯ |
| | | // #endif |
| | | |
| | | uwb_rxflag_num1++; |
| | | // while(mac_is_busy()); |
| | | // temp_count2=phy_timer_count_get(); |
| | |
| | | |
| | | } |
| | | recev_error_num=0; |
| | | |
| | | // sleep_timer_start(__MS_TO_32K_CNT(UWB_DELAY_TIME_US));//æµè¯ |
| | | // LOG_INFO(TRACE_MODULE_APP,"æ ç¾IDï¼%X,è·ç¦»: %d ä¿¡å·å¼ºåº¦ï¼%d.\r\n",g_com_map[BIND_DEV_ID],distance,rssi); |
| | | |
| | |
| | | <SetRegEntry> |
| | | <Number>0</Number> |
| | | <Key>DLGUARM</Key> |
| | | <Name></Name> |
| | | <Name>d</Name> |
| | | </SetRegEntry> |
| | | <SetRegEntry> |
| | | <Number>0</Number> |
| | |
| | | <Ww> |
| | | <count>15</count> |
| | | <WinNumber>2</WinNumber> |
| | | <ItemText>Forward_BT_buff</ItemText> |
| | | </Ww> |
| | | <Ww> |
| | | <count>16</count> |
| | | <WinNumber>2</WinNumber> |
| | | <ItemText>DMA_RXBuf_BT</ItemText> |
| | | </Ww> |
| | | <Ww> |
| | | <count>17</count> |
| | | <WinNumber>2</WinNumber> |
| | | <ItemText>buff</ItemText> |
| | | </Ww> |
| | | <Ww> |
| | | <count>18</count> |
| | | <WinNumber>2</WinNumber> |
| | | <ItemText>LORA_RETRANSNUSSION_BT</ItemText> |
| | | </Ww> |
| | | <Ww> |
| | | <count>19</count> |
| | | <WinNumber>2</WinNumber> |
| | | <ItemText>checksum</ItemText> |
| | | </Ww> |
| | | <Ww> |
| | | <count>20</count> |
| | | <WinNumber>2</WinNumber> |
| | | <ItemText>pdata</ItemText> |
| | | </Ww> |
| | | <Ww> |
| | | <count>21</count> |
| | | <WinNumber>2</WinNumber> |
| | | <ItemText>report_ancnum_bt</ItemText> |
| | | </Ww> |
| | | </WatchWindow2> |
| | | <MemoryWindow1> |
| | | <Mm> |
| | | <WinNumber>1</WinNumber> |
| | | <SubType>8</SubType> |
| | | <ItemText>applyid</ItemText> |
| | | <ItemText>buffer</ItemText> |
| | | <AccSizeX>0</AccSizeX> |
| | | </Mm> |
| | | </MemoryWindow1> |
| | | <MemoryWindow2> |
| | | <Mm> |
| | | <WinNumber>2</WinNumber> |
| | | <SubType>1</SubType> |
| | | <ItemText>lora_sendbuffer</ItemText> |
| | | <AccSizeX>0</AccSizeX> |
| | | </Mm> |
| | | </MemoryWindow2> |
| | | <Tracepoint> |
| | | <THDelay>0</THDelay> |
| | | </Tracepoint> |