From 12083b20d128f9d4449e286a14f1ba4fc31432fd Mon Sep 17 00:00:00 2001
From: zhyinch <zhyinch@gmail.com>
Date: 星期六, 07 十一月 2020 12:52:37 +0800
Subject: [PATCH] 修改电机震动时间不对BUG

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

diff --git a/Src/main.c b/Src/main.c
index a8269c4..40c9556 100644
--- a/Src/main.c
+++ b/Src/main.c
@@ -123,17 +123,18 @@
 //	LED_TR_OFF;
 	current_time=GetLPTime();
 	//motor_state=2;
-		if(g_com_map[MOTOR_ONTIME]>0)
-	{
-		g_com_map[MOTOR_ONTIME]--;
-		motor_state = 1;
-	}
+//		if(g_com_map[MOTOR_ONTIME]>0)
+//	{
+//		g_com_map[MOTOR_ONTIME]--;
+//		motor_state = 1;
+//	}
+
 	switch(motor_state)
 		{case 0:
 			MOTOR_OFF;
 			break;
 		case 1:
-			if(current_time<MOTOR_ONTIME)
+			if(current_time<WARNING_MOTORONTIME)
 			{
 				MOTOR_ON;		
 			}else{
@@ -405,7 +406,7 @@
 		{
 			waitusart_timer--;
 		}
-			if(m_bEUARTTxEn==0&&waitusart_timer==0)
+			if(m_bEUARTTxEn==0&&waitusart_timer==0&&(motor_state==0||motor_state==3))
 			{	
 #ifndef DEBUG_MODE				
 				HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);  

--
Gitblit v1.9.3