From 1ebb084c4d5216f4e5e3e61a63c88f568caf779e Mon Sep 17 00:00:00 2001 From: zhyinch <zhyinch@gmail.com> Date: 星期五, 28 九月 2018 11:27:10 +0800 Subject: [PATCH] 增加多标签测距功能,标签有bug,长时间会死机 --- 源码/核心板/Src/main.c | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) 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 c8760ae..4d5adbc 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,8 @@ #include "serial_at_cmd_app.h" #include "global_param.h" -#define WORK_MODE_TAG -//#define WORK_MODE_ANCHOR +//#define WORK_MODE_TAG +#define WORK_MODE_ANCHOR void Device_Init(void) { @@ -33,9 +33,13 @@ } void Program_Init(void) -{ +{uint16_t i; Usart1ParseDataCallback = UsartParseDataHandler; parameter_init(); + for(i=0;i<255;i++) + { + g_Tagdist[i]=0xffff; + } } /*! ------------------------------------------------------------------------------------------------------------------ @@ -58,7 +62,7 @@ #ifdef WORK_MODE_TAG tag_sleep_configuraion(); #endif - + Dw1000_App_Init(); /* Loop forever initiating ranging exchanges. */ while(1) { @@ -68,6 +72,7 @@ g_start_send_flag = 0; Tag_App(); } +// UART_CheckReceive(); RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE); PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI); #else -- Gitblit v1.9.3