From 74560fa32a8f0ea0924a81e85360e79c94ddbf3d Mon Sep 17 00:00:00 2001 From: zhyinch <zhyinch@gmail.com> Date: 星期五, 19 七月 2019 16:38:08 +0800 Subject: [PATCH] 样机发货程序 --- 源码/核心板/Src/application/dw_app.h | 4 ++-- 源码/核心板/Src/application/global_param.c | 2 +- 源码/核心板/Src/main.c | 2 +- 源码/核心板/Src/application/dw_app.c | 16 +++++++++------- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.c" "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.c" index 52d2e3b..66f400d 100644 --- "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.c" +++ "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.c" @@ -256,8 +256,7 @@ /* Set expected response's delay and timeout. See NOTE 4 and 5 below. * As this example only handles one incoming frame with always the same delay and timeout, those values can be set here once for all. */ - dwt_setrxaftertxdelay(POLL_TX_TO_RESP_RX_DLY_UUS); //设置发送后开启接收,并设定延迟时间 - dwt_setrxtimeout(RESP_RX_TIMEOUT_UUS); //设置接收超时时间 + //设置接收超时时间 } void Dw1000_App_Init(void) { @@ -301,14 +300,14 @@ u32 start_poll; u8 i; //LED0_ON; + dwt_forcetrxoff(); g_Resttimer=0; - GPIO_ResetBits(SPIx_GPIO, SPIx_CS); - delay_us(2500); - GPIO_SetBits(SPIx_GPIO, SPIx_CS); + dwt_setrxaftertxdelay(POLL_TX_TO_RESP_RX_DLY_UUS); //设置发送后开启接收,并设定延迟时间 + dwt_setrxtimeout(RESP_RX_TIMEOUT_UUS); tag_succ_times = 0; tx_poll_msg[BATTARY_IDX] = Get_Battary(); tx_poll_msg[BUTTON_IDX] = !READ_KEY0; - dwt_forcetrxoff(); + for(i=0;i<REPOET_ANC_NUM;i++) { /* Write frame data to DW1000 and prepare transmission. See NOTE 7 below. */ @@ -376,6 +375,9 @@ result=dwt_starttx(DWT_START_TX_DELAYED);//设定为延迟发送 tag_succ_times++; + #ifdef WORK_MODE_TAG + LED0_BLINK; + #endif /* Poll DW1000 until TX frame sent event set. See NOTE 8 below. */ if(result==0) @@ -402,7 +404,7 @@ } // deca_sleep(10); } - dwt_entersleep(); +// dwt_entersleep(); if(tag_succ_times<REPOET_ANC_NUM_MIN) { random_delay_tim =time32_incr&0x8f+7; diff --git "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.h" "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.h" index b9a4427..1ccd853 100644 --- "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.h" +++ "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.h" @@ -5,8 +5,8 @@ #include "stm32f10x.h" #include "filters.h" #include "ADC.h" -#define WORK_MODE_TAG -//#define WORK_MODE_ANCHOR +//#define WORK_MODE_TAG +#define WORK_MODE_ANCHOR //#define NEWBOARD //#define TAG_OUTPUT diff --git "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/global_param.c" "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/global_param.c" index d656f6c..59524bd 100644 --- "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/global_param.c" +++ "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/global_param.c" @@ -29,7 +29,7 @@ // g_com_map[ALARM_DISTANCE2] = 600; //默认报警距离50cm // g_com_map[ALARM_DISTANCE3] = 900; //默认报警距离50cm // g_com_map[ALARM_DEV] = 1; - g_com_map[DEV_ID_L] =0xdb;//DEFAULT_DEV_ID; //默认设备ID + g_com_map[DEV_ID_L] =0x04;//DEFAULT_DEV_ID; //默认设备ID g_com_map[DEV_ID_H] =0x00;//DEFAULT_DEV_ID; //默认设备ID g_com_map[COM_INTERVAL]=1000; save_com_map_to_flash(); diff --git "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/main.c" "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/main.c" index 3facf8c..754aa1c 100644 --- "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/main.c" +++ "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/main.c" @@ -74,7 +74,7 @@ delay_ms(10); //#ifdef WORK_MODE_TAG RTC_Configuration(g_com_map[COM_INTERVAL]*20); - tag_sleep_configuraion(); +// tag_sleep_configuraion(); //#endif Dw1000_App_Init(); /* Loop forever initiating ranging exchanges. */ -- Gitblit v1.9.3