From c0fb13f1543a71a46a4de45f5d37f50e5ce95ce1 Mon Sep 17 00:00:00 2001
From: zhyinch <zhyinch@gmail.com>
Date: 星期四, 19 十一月 2020 12:43:09 +0800
Subject: [PATCH] 去掉自动修改时间片操作

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

diff --git a/Src/main.c b/Src/main.c
index 1a151a8..6a5c18e 100644
--- a/Src/main.c
+++ b/Src/main.c
@@ -113,7 +113,7 @@
 
 if(huart1.Instance->ISR&USART_ISR_FE)
 	{
-	SCB->AIRCR = 0X05FA0000|(unsigned int)0x04; //软复位回到bootloader   
+//	SCB->AIRCR = 0X05FA0000|(unsigned int)0x04; //软复位回到bootloader   
 	}	
 //if(!HAL_GPIO_ReadPin(PWR_ON_GPIO_Port,PWR_ON_Pin))
 //{
@@ -210,8 +210,8 @@
 
 u16 current_slotnum;
 extern int32_t offsettimeus;
-#define FIXSLOT
-#define FIXSLOTPOS  5
+//#define FIXSLOT
+#define FIXSLOTPOS  6
 u16 slotpos_intoatl;
 uint16_t bigslot_num;
 uint8_t fix_slotpos =FIXSLOTPOS; 
@@ -230,9 +230,10 @@
 	if(current_slotnum==19)
 	{slotpos_intoatl = current_slotnum*bigslot_num+slotpos;}
 	target_time=(slotpos_intoatl*SLOTTIME_MS+100)*100;
+	
 	//if(target_time<90000)
 	{
-		lptime=target_time-offsettimeus;
+		lptime=target_time-offsettimeus-10000;
 		lpcount = lptime/LPTIMER_LSB;
 	if(lpcount>LPTIMER_1S_COUNT)
 		lpcount-=LPTIMER_1S_COUNT;
@@ -250,22 +251,25 @@
 	Usart1ParseDataCallback = UsartParseDataHandler;
 	parameter_init();
 	//deca_sleep(1000);
-	g_com_map[VERSION] = 0x0207;
+	g_com_map[VERSION] = 0x020a;
 #ifdef DEBUG_MODE
 //	g_com_map[DEV_ROLE]=1;
 //		g_com_map[DEV_ID]=0x123;
 //	g_com_map[COM_INTERVAL]=100;
 //	g_com_map[MAX_REPORT_ANC_NUM]=1;
 //	g_com_map[NOMOVESLEEP_TIME]=10;
-			g_com_map[IMU_ENABLE]=0;
-	g_com_map[COM_INTERVAL]=50;
+		//	g_com_map[IMU_ENABLE]=0;
+	//g_com_map[COM_INTERVAL]=50;
 #endif
 //g_com_map[NOMOVESLEEP_TIME]=10;
-	// g_com_map[COM_INTERVAL]=100;
+//	g_com_map[IMU_ENABLE]=0;
+//	 g_com_map[COM_INTERVAL]=50;
 		if(g_com_map[COM_INTERVAL]==0)
 	{
 	  g_com_map[COM_INTERVAL]=100;
 	}
+	if(g_com_map[IMU_THRES]>10)
+	{g_com_map[IMU_THRES]=2;}
 	 if(g_com_map[POWER]>MAX_RFPOWER)
 		{g_com_map[POWER]=MAX_RFPOWER;}
 		if(g_com_map[POWER]<0)

--
Gitblit v1.9.3