From 8bb29b81dd7462af85db79164c280966c6f713b2 Mon Sep 17 00:00:00 2001
From: yincheng.zhong <zhyinch@gmail.com>
Date: 星期四, 21 十一月 2019 20:25:54 +0800
Subject: [PATCH] 配临近开发,未完成

---
 源码/核心板/Src/main.c |   13 +++----------
 1 files changed, 3 insertions(+), 10 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 f775c2a..b5de573 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"
@@ -11,7 +11,7 @@
 #include "global_param.h"
 #include "ADC.h"
 
-#define DEBUG_MODE
+//#define DEBUG_MODE
 
 void Device_Init(void)
 {
@@ -61,21 +61,14 @@
 	g_com_map[MAX_REPORT_ANC_NUM]=3;
 #endif
 	OUT485_ENABLE;
-	g_com_map[VERSION] = 0x0106;	
+	g_com_map[VERSION] = 0x0107;	
 	dev_id = g_com_map[DEV_ID];
-	temp=(float)g_com_map[MAX_REPORT_ANC_NUM]*4/3;	
-	temp2=g_com_map[MAX_REPORT_ANC_NUM]*4/3;
-	if(temp2<temp)
-	{
-		temp2++;
-	}
-	slottime=temp2;
+	slottime=ceil((double)g_com_map[MAX_REPORT_ANC_NUM]*4/3);
 	max_slotpos=g_com_map[COM_INTERVAL]/slottime;
 	tyncpoll_time=(g_com_map[DEV_ID]%max_slotpos)*slottime;	
 	
 	if(g_com_map[DEV_ROLE])
 	{
-		tyncpoll_time=g_com_map[DEV_ID]*g_com_map[MAX_REPORT_ANC_NUM]*4/3;
 	printf("标签ID: %d .\r\n",dev_id);
 	printf("通讯间隔: %d ms.\r\n",g_com_map[COM_INTERVAL]);
 	printf("单次通讯基站数量: %d个.\r\n",g_com_map[MAX_REPORT_ANC_NUM]);

--
Gitblit v1.9.3