From 67e9f19a27e24c4804ebe321c72951380637fef2 Mon Sep 17 00:00:00 2001
From: zhyinch <zhyinch@gmail.com>
Date: 星期五, 13 十一月 2020 12:15:36 +0800
Subject: [PATCH] 1

---
 Src/application/dw_app.c |   37 +++++++++++++++++++------------------
 1 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/Src/application/dw_app.c b/Src/application/dw_app.c
index 22a43b4..08c29a5 100644
--- a/Src/application/dw_app.c
+++ b/Src/application/dw_app.c
@@ -69,7 +69,7 @@
 #define FINAL_MSG_FINAL_TX_TS_IDX 18
 #define FINAL_MSG_TS_LEN 4
 
-#define STARTPOLL  REGPOLL
+#define STARTPOLL  DISCPOLL
 enum enumtagstate
 {
 	REGPOLL,
@@ -584,7 +584,7 @@
 		tyncpoll_time=(tagslotpos-1)*slottime;
 	}
 	mainbase_id=minid;
-	//mainbase_id = 0x1;
+//	mainbase_id = 0x9804;
 }
 u8 nearmsg_mainbase=0,rec_tagpos_emptylist[32],mainbase_type;;
 void GetNearMsg(void)
@@ -881,22 +881,22 @@
 //			{
 //				nearbase_distlist[i]=0x1ffff;
 //			}
-//			if(para_update)
-//			{
-//			uint8_t pack_length = 0,pack_index = 0,pack_msgtype = 0;
-//				pack_msgtype = rec_remotepara[0];
-//				pack_index = rec_remotepara[1];
-//				pack_length = rec_remotepara[2];
-//				if(pack_msgtype==2)
-//				{
-//						memcpy((uint8_t*)&g_com_map + pack_index, &rec_remotepara[3], pack_length);
-//					//返回一个error状态
-//					//SendComMap(pack_datalen,pack_index);
-//					save_com_map_to_flash();
-//					delay_ms(100);
-//					NVIC_SystemReset();
-//				}
-//			}
+			if(para_update)
+			{
+			uint8_t pack_length = 0,pack_index = 0,pack_msgtype = 0;
+				pack_msgtype = rec_remotepara[0];
+				pack_index = rec_remotepara[1];
+				pack_length = rec_remotepara[2];
+				if(pack_msgtype==2)
+				{
+						memcpy((uint8_t*)&g_com_map + pack_index, &rec_remotepara[3], pack_length);
+					//返回一个error状态
+					//SendComMap(pack_datalen,pack_index);
+					save_com_map_to_flash();
+					delay_ms(100);
+					NVIC_SystemReset();
+				}
+			}
 	dwt_write32bitreg(SYS_STATUS_ID, SYS_STATUS_ALL_RX_ERR| SYS_STATUS_TXFRS |SYS_STATUS_RXFCG);
 HAL_GPIO_WritePin(LED0_GPIO, GPIO_PIN_9, GPIO_PIN_RESET);
 
@@ -988,6 +988,7 @@
 	id =  dwt_readdevid() ;
 	    while (DWT_DEVICE_ID != id) 
     {
+			Dw1000_Init();
 			id =  dwt_readdevid() ;
     }
 	switch(tag_state)

--
Gitblit v1.9.3