From c23f343e74095a5a90bfa3fd262c201063c90096 Mon Sep 17 00:00:00 2001
From: zhyinch <zhyinch@gmail.com>
Date: 星期六, 23 十一月 2019 14:10:03 +0800
Subject: [PATCH] 1

---
 源码/核心板/Src/main.c |   12 +++---------
 1 files changed, 3 insertions(+), 9 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 5214f75..7b982e9 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)
 {
@@ -55,7 +55,7 @@
 	//deca_sleep(1000);
 	HeartBeatInit();
 #ifdef DEBUG_MODE
-	g_com_map[DEV_ROLE]=1;
+	g_com_map[DEV_ROLE]=0;
 		g_com_map[DEV_ID]=4;
 	g_com_map[COM_INTERVAL]=100;
 	g_com_map[MAX_REPORT_ANC_NUM]=3;
@@ -63,13 +63,7 @@
 	OUT485_ENABLE;
 	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;	
 	

--
Gitblit v1.9.3