From 4a99709fbaf35e70ab7102c902e2c4caab74b96c Mon Sep 17 00:00:00 2001
From: zhyinch <zhyinch@gmail.com>
Date: 星期四, 18 十月 2018 16:27:33 +0800
Subject: [PATCH] Revert "Revert "配对完成,有bug""

---
 源码/核心板/Src/application/dw_app.h         |    3 +++
 源码/核心板/Src/main.c                       |    3 +--
 源码/核心板/Src/application/beep_logic_app.c |    1 +
 源码/核心板/Src/stm32f10x_it.c               |   11 ++++++-----
 源码/核心板/Src/application/dw_app.c         |    4 +++-
 5 files changed, 14 insertions(+), 8 deletions(-)

diff --git "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/beep_logic_app.c" "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/beep_logic_app.c"
index e2cfbea..33b32a1 100644
--- "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/beep_logic_app.c"
+++ "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/beep_logic_app.c"
@@ -12,6 +12,7 @@
 
 #define ONTIME3 1   // 500ms
 #define OFFTIME3 5  // 500ms
+
 void main_logic(void)	//主逻辑在这里执行
 {
 	static uint8_t beep_state,timer_state,beep_timer,beep_ontime,beep_offtime;
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 b28421b..81f831a 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"
@@ -31,7 +31,7 @@
 #include "global_param.h"
 #include "filters.h"
 #include <stdio.h>
-
+#include "beep.h"
 
 
 /*------------------------------------ Marcos ------------------------------------------*/
@@ -502,6 +502,8 @@
 						g_pairstart=0;
 						g_com_map[PAIR_ID]=tag_id_recv;
 						save_com_map_to_flash();
+						BEEP2_ON;
+						delay_ms(1000);
 						printf("Pair Finish PairID: %d. \r\n",g_com_map[PAIR_ID]);
 					}
 					g_flag_Taggetdist[tag_id_recv]=0;
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 7f107f8..8bb4567 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,6 +5,9 @@
 #include "stm32f10x.h"
 #include "filters.h"
 
+#define WORK_MODE_TAG
+//#define WORK_MODE_ANCHOR
+
 #define TAG_NUM_IN_SYS				256
 #define DFT_RAND_DLY_TIM_MS			1
 
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 1f67ccf..6bde235 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"
@@ -10,8 +10,7 @@
 #include "serial_at_cmd_app.h"
 #include "global_param.h"
 
-#define WORK_MODE_TAG
-//#define WORK_MODE_ANCHOR
+
 
 void Device_Init(void)
 {
diff --git "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/stm32f10x_it.c" "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/stm32f10x_it.c"
index ffbefdc..c7bee66 100644
--- "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/stm32f10x_it.c"
+++ "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/stm32f10x_it.c"
@@ -34,6 +34,7 @@
 uint8_t g_start_send_flag = 0;
 uint16_t sysscal;
 extern uint16_t g_Resttimer;
+extern uint8_t g_pairstart;
 void SysTick_Handler(void)
 {uint16_t i;
   time32_incr++;
@@ -46,9 +47,11 @@
 //	{	
 //		dis_after_filter = DEFAULT_DISTANCE;
 //	}
-TagDistClear();
-	main_logic();
-	
+#ifdef WORK_MODE_ANCHOR
+	TagDistClear();
+	if(g_pairstart!=1)
+		main_logic();
+#endif	
 
 }
 
@@ -74,8 +77,6 @@
 	g_start_send_flag = 1;
 	RTC_SET_ALARM(1);
 	tt++;
-	
-	
   //SYS.wake_id|=1<<17;
 }
 void USART1_IRQHandler(void)

--
Gitblit v1.9.3