From ce9ff1ded137cb9915e4d8619b7bee5dc0e05138 Mon Sep 17 00:00:00 2001
From: WXK <287788329@qq.com>
Date: 星期四, 25 四月 2024 15:21:50 +0800
Subject: [PATCH] V2.1 调试完成 1V4没有问题

---
 Src/main.c |   39 ++++++++++++++++++++-------------------
 1 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/Src/main.c b/Src/main.c
index a5ffadf..a8043d5 100644
--- a/Src/main.c
+++ b/Src/main.c
@@ -33,7 +33,7 @@
 #define NSH1 0x0001
 #define GP   0x0002
 #define FLASH_HARDWARE_VERSION_MAP		(uint32_t)0x08004F00    //硬件版本号和批次信息位置
-#define DEBUG_MODE
+//#define DEBUG_MODE
 /* USER CODE END Includes */
 
 /* Private typedef -----------------------------------------------------------*/
@@ -221,7 +221,7 @@
 	hardware_pici = STMFLASH_ReadHalfWord(FLASH_HARDWARE_VERSION_MAP+2);
 	hardware_type = STMFLASH_ReadHalfWord(FLASH_HARDWARE_VERSION_MAP+4);
 	//deca_sleep(1000);
-	g_com_map[VERSION] = (1<<8)|68;
+	g_com_map[VERSION] = (2<<8)|1;
     
     #ifdef DEBUG_MODE
    // g_com_map[GROUP_ID]=21;
@@ -354,7 +354,7 @@
   /* MCU Configuration--------------------------------------------------------*/
 
   /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
-  HAL_Init();
+   HAL_Init();
 
   /* USER CODE BEGIN Init */
 //每次生成CUBE后需要注意,串口初始化要在DMA初始化后面,手动调整顺序**************
@@ -860,23 +860,24 @@
     freqlost_count+=1/(float)tag_frequency;
     range_lost_time +=1/(float)tag_frequency;
     
-    if(freqlost_count>FREQ_LOST_TIME)
-    {
-        tag_frequency = NOTAG_FREQ;
-        if(lost_jumpcount++>=4) //无测距情况下,每5秒发一次;
-        {
-            lost_jumpcount = 0;
-            g_start_send_flag=1;
-        }
-    }else{
+//    if(freqlost_count>FREQ_LOST_TIME)
+//    {
+//        tag_frequency = NOTAG_FREQ;
+//        if(lost_jumpcount++>=4) //无测距情况下,每5秒发一次;
+//        {
+//            lost_jumpcount = 0;
+//            g_start_send_flag=1;
+//        }
+//    }else{
         g_start_send_flag=1;
-    }
-    if(range_lost_time<1||freqlost_count>FREQ_LOST_TIME)
-    {
-        SetNextPollTime(0);
-    }else{
-        SetNextPollTime(5);
-    }
+//    }
+//    if(range_lost_time<1||freqlost_count>FREQ_LOST_TIME)
+//    {
+//        SetNextPollTime(0);
+//    }else{
+//        SetNextPollTime(5);
+//        SetNextPollTime(0);
+//    }
 	nomove_count+=1/(float)tag_frequency;
     if(motor_keeptime>0)
 	{	

--
Gitblit v1.9.3