From 55ab0cb67d97aea4c29fa02b6ef85afe645a2deb Mon Sep 17 00:00:00 2001
From: yincheng.zhong <634916154@qq.com>
Date: 星期一, 22 五月 2023 11:26:29 +0800
Subject: [PATCH] v2.11 震动逻辑客户确认没问题

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

diff --git a/Src/main.c b/Src/main.c
index 7b6cd75..833bb29 100644
--- a/Src/main.c
+++ b/Src/main.c
@@ -167,14 +167,14 @@
             
             if(motor5s_state)
             {
-                if(motor5s_timer>4)
+                if(motor5s_timer>2)
                 {
                     motor5s_timer = 0;
                     motor5s_state = 0;
                     JianXieMotorProcess();
                 }
             }else{           
-                if(motor5s_timer>300)
+                if(motor5s_timer>30)
                 {
                     motor5s_timer = 0;
                     motor5s_state = 1;
@@ -182,10 +182,10 @@
                 } 
             }
         }else{
-            if(outside_count>3)
+            if(outside_count>3&&motor5s_state)
             {
                 motor5s_state = 0;
-                motor5s_timer = 900;  
+                motor5s_timer = 0;  
             }                
         }
     }else{
@@ -315,7 +315,7 @@
 	hardware_pici= STMFLASH_ReadHalfWord(FLASH_HARDWARE_VERSION_MAP+2);
 	hardware_type= STMFLASH_ReadHalfWord(FLASH_HARDWARE_VERSION_MAP+4);
 	//deca_sleep(1000);
-	g_com_map[VERSION] = (2<<8)|9;
+	g_com_map[VERSION] = (2<<8)|11;
     
 //	g_com_map[DEV_ID]=0x7;
 #ifdef DEBUG_MODE
@@ -972,6 +972,7 @@
     tagslotpos = current_slotpos%200;
     flag_tagnewpos = 0;
 }
+uint16_t motorkeeptime_u16,last_motorkeep;
 float lptimedelay=0;
 void HAL_LPTIM_CompareMatchCallback(LPTIM_HandleTypeDef *hlptim)
 {
@@ -1003,6 +1004,12 @@
 	if(motor_keeptime>0)
 	{	
         motor_keeptime-=lptimedelay;
+        motorkeeptime_u16 = motor_keeptime;
+        if(motorkeeptime_u16%3==0&&motorkeeptime_u16!=last_motorkeep)
+        {
+            last_motorkeep=motorkeeptime_u16;
+            JianXieMotorProcess();
+        }
 	}
     if(motor_keeptime<0)
     {motor_keeptime = 0;}

--
Gitblit v1.9.3