From e3dedf3cc3d29191937ba908d1cee233eb0adb2d Mon Sep 17 00:00:00 2001
From: zhyinch <zhyinch@gmail.com>
Date: 星期日, 06 九月 2020 14:31:51 +0800
Subject: [PATCH] 远距离110K代码测试完成

---
 源码/核心板/Src/main.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 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 1d5a831..58ab4fb 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"
@@ -52,6 +52,7 @@
 uint16_t vel_factor,pos_factor;
 
 extern u8 module_power;
+u16 slottime,max_slotnum,current_slotpos;
 void Program_Init(void)
 {uint16_t i;
 	float temp;
@@ -86,14 +87,17 @@
 		{
 			module_power=67;
 		}
-		g_com_map[VERSION] = 0x011c;	
+		g_com_map[VERSION] = 0x011f;	
 	temp=(float)g_com_map[MAX_REPORT_ANC_NUM]*4/3;	
-	temp2=g_com_map[DEV_ID]*g_com_map[MAX_REPORT_ANC_NUM]*4/3;
+	temp2=g_com_map[MAX_REPORT_ANC_NUM]*4/3;
 	if(temp2<temp)
 	{
 		temp2++;
 	}
-		tyncpoll_time=g_com_map[DEV_ID]*(temp2);
+	slottime=temp2;
+	max_slotnum=g_com_map[COM_INTERVAL]/temp2;
+	current_slotpos=g_com_map[DEV_ID];
+	tyncpoll_time=(current_slotpos%max_slotnum)*slottime;
 	if(g_com_map[DEV_ROLE])
 	{
 	printf("标签ID: %d .\r\n",dev_id);

--
Gitblit v1.9.3