zhangbo
2025-03-11 32ec78bbb74df89564f3998fd32bc3411fca5613
基本功能调通
已修改11个文件
33535 ■■■■ 文件已修改
keil/JLinkLog.txt 11353 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Listings/uwb_simple_example.map 6348 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Objects/uwb_simple_example.build_log.htm 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Objects/uwb_simple_example.hex 10577 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Objects/uwb_simple_example.htm 5059 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Objects/uwb_simple_example_MK8000 Release.dep 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/include/drivers/PCA9555.c 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/include/main/main.c 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/include/src/Radio/lora_1268.c 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/uwb_app.c 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/uwb_simple_example.uvoptx 7 ●●●● 补丁 | 查看 | 原始文档 | 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\3Shuanxing\ChinaUWBProject-yizhilora\keil\uwb_simple_example.uvprojx
D:\zhangbo\2024\Code\ChinaUWB\3Shuanxing\ChinaUWBProject-biaoqian-RX - BT-jinkoulora\keil\uwb_simple_example.uvprojx
Project File Date:  03/04/2025
<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\3Shuanxing\ChinaUWBProject-yizhilora\keil\Objects\uwb_simple_example.axf"
".\Objects\uwb_simple_example.axf" - 0 Error(s), 0 Warning(s).
compiling PCA9555.c...
linking...
D:\zhangbo\2024\Code\ChinaUWB\3Shuanxing\ChinaUWBProject-biaoqian-RX - BT-jinkoulora\keil\include\devices\MK800X\Source\ARM\MK800X_ac6_copy.sct(25): warning: L6314W: No section matches pattern *(.XIP_SECTION).
Program Size: Code=80152 RO-data=8956 RW-data=1744 ZI-data=27080
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\3Shuanxing\ChinaUWBProject-biaoqian-RX - BT-jinkoulora\keil\Objects\uwb_simple_example.axf"
".\Objects\uwb_simple_example.axf" - 0 Error(s), 1 Warning(s).
<h2>Software Packages used:</h2>
@@ -42,7 +48,7 @@
  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:01
</pre>
</body>
</html>
keil/Objects/uwb_simple_example.hex
ÎļþÌ«´ó
keil/Objects/uwb_simple_example.htm
ÎļþÌ«´ó
keil/Objects/uwb_simple_example_MK8000 Release.dep
@@ -529,7 +529,7 @@
I (include\drivers\mk_dma.h)(0x67C6A898)
I (D:\keil\ARM\ARMCLANG\include\stdarg.h)(0x5DDFFD72)
F (.\include\drivers\mk_timer.h)(0x67C6A898)()
F (.\include\drivers\PCA9555.c)(0x67C6A898)(-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 -I ./include/src/Radio -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)
F (.\include\drivers\PCA9555.c)(0x67CFD7DA)(-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 -I ./include/src/Radio -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)(0x67C6A898)
I (include\board\board.h)(0x67C6A898)
I (include\drivers\mk_common.h)(0x67C6A898)
@@ -748,7 +748,7 @@
I (include\drivers\mk_gpio.h)(0x67C6A898)
I (include\drivers\Usart.h)(0x67C6A898)
I (..\keil\lora_3029.h)(0x67C6A898)
F (.\include\main\main.c)(0x67CF8FF8)(-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 -I ./include/src/Radio -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)(0x67CFD6EF)(-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 -I ./include/src/Radio -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)(0x67C6A898)
I (include\drivers\mk_common.h)(0x67C6A898)
I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x5DDFFD72)
@@ -865,7 +865,7 @@
I (D:\keil\ARM\ARMCLANG\include\stdarg.h)(0x5DDFFD72)
I (include\drivers\mk_gpio.h)(0x67C6A898)
I (include\drivers\mk_io.h)(0x67C6A898)
F (.\uwb_app.c)(0x67CF9B2A)(-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 -I ./include/src/Radio -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)(0x67CFAE7A)(-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 -I ./include/src/Radio -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)(0x67C6A898)
I (include\drivers\mk_common.h)(0x67C6A898)
I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x5DDFFD72)
@@ -898,6 +898,7 @@
I (include\drivers\mk_gpio.h)(0x67C6A898)
I (include\drivers\mk_io.h)(0x67C6A898)
I (..\keil\lora_1268.h)(0x67C6A898)
I (include\drivers\PCA9555.h)(0x67C6A898)
F (.\lora_3029.c)(0x67C6A898)(-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 -I ./include/src/Radio -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/lora_3029.o -MD)
F (.\include\components\wsf\sources\port\baremetal\wsf_assert.c)(0x67C6A898)(-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 -I ./include/src/Radio -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)(0x67C6A898)
@@ -1429,7 +1430,7 @@
I (include\devices\MK800X\Include\system_MK800X.h)(0x67C6A898)
I (..\user_config.h)(0x67C6A898)
I (include\drivers\mk_dma.h)(0x67C6A898)
F (.\include\src\Radio\lora_1268.c)(0x67C6A898)(-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 -I ./include/src/Radio -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_1268.o -MD)
F (.\include\src\Radio\lora_1268.c)(0x67CFABFE)(-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 -I ./include/src/Radio -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_1268.o -MD)
I (D:\keil\ARM\ARMCLANG\include\math.h)(0x5DDFFD6C)
I (D:\keil\ARM\ARMCLANG\include\string.h)(0x5DDFFD6C)
I (include\src\Radio\sx126x.h)(0x67C6A898)
keil/include/drivers/PCA9555.c
@@ -568,7 +568,7 @@
//    PCA9555_Set_One_Value_Config(SOS_ENBALE,1);//设置SOS按钮输入
  LORA_NRST_UP;    
    LORA_LED_ON;
    LORA_LED_OFF;
    GREEN_LED_OFF;
    UWB_LED_OFF;
    RED_LED_OFF;
@@ -600,26 +600,15 @@
uint8_t Sos_state;
void SOS_irq_callback()
{
    Sos_state=!Sos_state;
    if(Sos_state)
    {
        UWB_LED_ON;
    RED_LED_ON;
    }
    else
    {
        UWB_LED_OFF;
    RED_LED_OFF;
    }
}
//void WAKE_UP_irq_callback()
@@ -632,11 +621,11 @@
      Sos_state=!Sos_state;
        if(Sos_state)
    {
    LORA_LED_ON;
        GREEN_LED_ON;
    }
    else
    {
    LORA_LED_OFF;
        GREEN_LED_OFF;
    }
      
}
keil/include/main/main.c
@@ -306,6 +306,8 @@
static void sleep_timer_callback(void *dev, uint32_t time)
{
    g_start_send_flag=1;
//      HIDO_TimerGetTick();
      HIDO_TimerTick();
    //        #ifdef DEBUG_BOXING
////        gpio_pin_clr(IO_PIN_5);//测试
    //    gpio_pin_set(IO_PIN_5);//测试
@@ -586,17 +588,12 @@
    RadioIrqProcess();                
}
void Board_LORA_NVIC_Init(GPIO_IRQ_HANDLER_T irq_handler)  //LORA ä¸­æ–­é…ç½®
{
//        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_NONE);
        gpio_enable_irq(LORA_DIO, GPIO_IRQ_TYPE_RISING_EDGE, irq_handler);
    gpio_enable_irq(LORA_DIO, GPIO_IRQ_TYPE_RISING_EDGE, irq_handler);
}
extern uint8_t pca9555writedata_input[10];//暂存输入寄存器所有配置的数组
static void pca_handler(enum IO_PIN_T pin)
@@ -626,6 +623,7 @@
    //board_led_init();
    spi_init();
    Board_LORA_NVIC_Init(Lora_irq_handler);
      pca_input_detection_init(pca_handler);
        IIC2_Init();
    Accelerometer_Init();
        PCA9555_init();
@@ -642,6 +640,7 @@
    while (1)
    { 
        Lora_Tx_Poll();
            uwb_app_poll();
      IdleTask();
    }
}
keil/include/src/Radio/lora_1268.c
@@ -554,23 +554,23 @@
                                        switch(RX_Buffer[PWTAG_RW_FLAG_IDX])
                                        {
                                                case WGRSP_RWTAG_NONE:
                        wg_report_freq = RX_Buffer[POLL_FREQ_IDX]+400;
                        memcpy(&rec_delaytime,&RX_Buffer[NEXTPOLL_TIME_IDX],2);
                        if(report_ancnum<2)
                        {
                            datalen_offset = report_ancnum*85;
                        }else{
                            datalen_offset = (report_ancnum-1)*46+85;
                        }
                        rec_secdelay = RX_Buffer[PWTAG_SECDELAY_IDX];
                        if(BufferSize!=13||rec_secdelay>20)
                        {
                         rec_secdelay = 0;
                        }
                        sleep_time_count = rec_delaytime - delaytime-datalen_offset;
                        while(sleep_time_count>=1000)
                            sleep_time_count-=1000;
                                                sleep_timer_start(sleep_time_count);
//                        wg_report_freq = RX_Buffer[POLL_FREQ_IDX]+400;
//                        memcpy(&rec_delaytime,&RX_Buffer[NEXTPOLL_TIME_IDX],2);
//                        if(report_ancnum<2)
//                        {
//                            datalen_offset = report_ancnum*85;
//                        }else{
//                            datalen_offset = (report_ancnum-1)*46+85;
//                        }
//                        rec_secdelay = RX_Buffer[PWTAG_SECDELAY_IDX];
//                        if(BufferSize!=13||rec_secdelay>20)
//                        {
//                         rec_secdelay = 0;
//                        }
//                        sleep_time_count = rec_delaytime - delaytime-datalen_offset;
//                        while(sleep_time_count>=1000)
//                            sleep_time_count-=1000;
//                                                sleep_timer_start(sleep_time_count);
                        break;
                                                case WGRSP_RWTAG_READ:
keil/uwb_app.c
@@ -9,6 +9,7 @@
#include "global_param.h"
#include "board.h"
#include "lora_1268.h"
#include "PCA9555.h"
#define TAG_KEEPTIMES           30
#define REPORT_TAG_KEEPTIMES     1
@@ -396,6 +397,8 @@
    //tagofflinetime[i] = 0;
    return i;
}
static void resp_msg_set_ts(uint8_t *ts_field, int64_t ts)
{
    int i,ts2;
@@ -760,46 +763,65 @@
uint32_t wltag_statetimer,wltag_uwbtimer;
int uwb_app_poll(void)
{
//    switch(wltag_state)
//    {
//    case RANGE:
//    if(HIDO_TimerGetTick()-wltag_uwbtimer>2&&uwb_rx_flag==0)
//        {
//                wltag_uwbtimer = HIDO_TimerGetTick();
//                OpenUWB();
//        }
//    else if(HIDO_TimerGetTick()-wltag_uwbtimer>1&&uwb_rx_flag==1)
//        {
//                wltag_uwbtimer = HIDO_TimerGetTick();
//                CloseUWB();
//        }
//        if(uwb_losttimer>g_com_map[UWB_RNAGE_TIME])
//        {
//         wltag_statetimer = HIDO_TimerGetTick();
//            if(uwb_rx_flag==0)//若要切换到搜索模式时没有开启则开启UWB
//            {
//                OpenUWB();
//            }
//     wltag_state = SEARCH;
//        }
//        break;
//    case SEARCH:
//        if(HIDO_TimerGetTick()-wltag_statetimer>1)
//        {
//        wltag_statetimer = HIDO_TimerGetTick();
//    wltag_state = CLOSE;
//    CloseUWB();
//        }
//        break;
//    case CLOSE:
//        if(HIDO_TimerGetTick()-wltag_statetimer>g_com_map[UWB_WAIT_TIME])
//        {
//        wltag_statetimer = HIDO_TimerGetTick();
//    wltag_state = SEARCH;
//    OpenUWB();
//        }
//        break;
//    }
    switch(wltag_state)
    {
    case RANGE:
//    time_flag=HIDO_TimerGetTick()-wltag_uwbtimer;
    if(HIDO_TimerGetTick()-wltag_uwbtimer>2&&uwb_rx_flag==0)
        {
                UWB_LED_ON;
                wltag_uwbtimer = HIDO_TimerGetTick();
                if(UWB_STATE==UWB_STATE_IDLE)
                {
                    UWB_STATE=UWB_RX_STATE_BUSY;
                    OpenUWB();
                }
        }
    else if(HIDO_TimerGetTick()-wltag_uwbtimer>1&&uwb_rx_flag==1)
        {
//            time_flag=HIDO_TimerGetTick()-wltag_uwbtimer;
              UWB_LED_OFF;
                wltag_uwbtimer = HIDO_TimerGetTick();
                CloseUWB();
              UWB_STATE=UWB_STATE_IDLE;
        }
        if(uwb_losttimer>g_com_map[UWB_RNAGE_TIME])
        {
         wltag_statetimer = HIDO_TimerGetTick();
            if(uwb_rx_flag==0)//若要切换到搜索模式时没有开启则开启UWB
            {
                if(UWB_STATE==UWB_STATE_IDLE)
                {
                    UWB_STATE=UWB_RX_STATE_BUSY;
                    OpenUWB();
                }
            }
     wltag_state = SEARCH;
        }
        break;
    case SEARCH:
        if(HIDO_TimerGetTick()-wltag_statetimer>1)
        {
            wltag_statetimer = HIDO_TimerGetTick();
            wltag_state = CLOSE;
            CloseUWB();
            UWB_STATE=UWB_STATE_IDLE;
        }
        break;
    case CLOSE:
        if(HIDO_TimerGetTick()-wltag_statetimer>g_com_map[UWB_WAIT_TIME])
        {
            wltag_statetimer = HIDO_TimerGetTick();
            wltag_state = SEARCH;
            if(UWB_STATE==UWB_STATE_IDLE)
            {
                UWB_STATE=UWB_RX_STATE_BUSY;
                OpenUWB();
            }
        }
        break;
    }
     UWBIdleTask();
}
int Anchor_App(void)
keil/uwb_simple_example.uvoptx
@@ -402,6 +402,11 @@
          <WinNumber>2</WinNumber>
          <ItemText>tagid_list</ItemText>
        </Ww>
        <Ww>
          <count>9</count>
          <WinNumber>2</WinNumber>
          <ItemText>wltag_state</ItemText>
        </Ww>
      </WatchWindow2>
      <MemoryWindow1>
        <Mm>
@@ -542,7 +547,7 @@
  <Group>
    <GroupName>Driver</GroupName>
    <tvExp>0</tvExp>
    <tvExp>1</tvExp>
    <tvExpOptDlg>0</tvExpOptDlg>
    <cbSel>0</cbSel>
    <RteFlg>0</RteFlg>