From 2282565d21c56b84c4446485b58874841f0482eb Mon Sep 17 00:00:00 2001
From: yincheng.zhong <634916154@qq.com>
Date: 星期五, 19 五月 2023 16:57:56 +0800
Subject: [PATCH] v2.9 修改震动逻辑

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

diff --git a/Src/main.c b/Src/main.c
index aaada68..7b6cd75 100644
--- a/Src/main.c
+++ b/Src/main.c
@@ -137,6 +137,7 @@
 u16 current_time;
 float motor5s_timer=1000;
 uint8_t state5v,motorskip_flag;
+extern uint8_t outside_count;
 void IdleTask(void)
 {
 	
@@ -158,12 +159,12 @@
     //motor_state = 1;
 if(g_com_map[MOTOR_ENABLE])
 {
-    static u8 motor5s_state = 0,outside_count=0;
+   static u8 motor5s_state = 0;
     if(motorskip_flag==0)
     {
         if(motor_state==2)
         { 
-            outside_count =0;
+            
             if(motor5s_state)
             {
                 if(motor5s_timer>4)
@@ -181,14 +182,14 @@
                 } 
             }
         }else{
-            if(outside_count++>3)
+            if(outside_count>3)
             {
-                motor5s_state = 1;
-                motor5s_timer = 0;  
+                motor5s_state = 0;
+                motor5s_timer = 900;  
             }                
         }
     }else{
-        if(motor5s_timer>7200)  //2个小时 7200
+        if(motor5s_timer>7200)  //2??? 7200
         {
            motorskip_flag = 0;
            motor5s_timer = 1000; 
@@ -314,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)|8;
+	g_com_map[VERSION] = (2<<8)|9;
     
 //	g_com_map[DEV_ID]=0x7;
 #ifdef DEBUG_MODE

--
Gitblit v1.9.3