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.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 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;

--
Gitblit v1.9.3