From fb63fc819cf017e3b5d7deb92cfbb0b3f3d08454 Mon Sep 17 00:00:00 2001
From: yincheng.zhong <634916154@qq.com>
Date: 星期三, 19 四月 2023 17:28:47 +0800
Subject: [PATCH] 未开发完

---
 Src/main.c |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/Src/main.c b/Src/main.c
index a247a73..f8fdd0d 100644
--- a/Src/main.c
+++ b/Src/main.c
@@ -283,7 +283,7 @@
 		{
         case 1:
 	  
-		 HAL_GPIO_WritePin(GPIOB, MOTOR_Pin, GPIO_PIN_SET);
+  HAL_GPIO_WritePin(GPIOB, MOTOR_Pin, GPIO_PIN_SET);
   GPIO_InitStruct.Pin = MOTOR_Pin;
   GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
   GPIO_InitStruct.Pull = GPIO_NOPULL;
@@ -296,6 +296,7 @@
 			break;
 		}
 }
+int16_t g_commap_antdelay;
 u8 active_flag,nomovesleeptime;
 void Program_Init(void)
 {	float temp;
@@ -307,9 +308,9 @@
 	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)|29;
+	g_com_map[VERSION] = (1<<8)|33;
     active_flag = g_com_map[ACTIVE_INDEX];
-    	module_power = g_com_map[POWER];
+    module_power = g_com_map[POWER];
 	imu_enable=g_com_map[IMU_ENABLE];
 	motor_enable=g_com_map[MOTOR_ENABLE];
 	
@@ -343,7 +344,11 @@
 		{module_power=67;}
 		if(module_power<0)
 		{module_power=0;}
-
+    if(g_com_map[ANT_LENGTH]>10000)
+    {
+        g_com_map[ANT_LENGTH] = 0;
+    }
+    g_commap_antdelay = -g_com_map[DIST_OFFSET];
 	current_slotnum=1;
 	current_time=GetLPTime();
 		if (HAL_LPTIM_TimeOut_Start_IT(&hlptim1, LPTIMER_1S_COUNT, slot_startcount) != HAL_OK)  //system time is 1010ms   1 puls=30.518us
@@ -424,7 +429,7 @@
   /* USER CODE BEGIN 2 */
 	LED_LG_ON;
 	Program_Init();
-	LIS3DH_Data_Init();	
+	Accelerometer_Init();	
 	Dw1000_Init();
 	Dw1000_App_Init();
 	HardWareTypeDiffConfig();
@@ -962,10 +967,10 @@
 	{
 		tx_near_msg[TAGSTATE] = tx_near_msg[TAGSTATE]|GOINGSLEEPBIT;
 	}
-	if(nomove_count>nomovesleeptime&&imu_enable)
-	{
-		mcu_sleep();
-	}
+//	if(nomove_count>nomovesleeptime&&imu_enable)
+//	{
+//		mcu_sleep();
+//	}
 }
 /* USER CODE END 4 */
 

--
Gitblit v1.9.3