Kaynağa Gözat

提交实时计步和日常计步最新的代码

wentingwei 2 yıl önce
ebeveyn
işleme
27129a0752
1 değiştirilmiş dosya ile 3 ekleme ve 3 silme
  1. 3 3
      detect_step_by_mag.c

+ 3 - 3
detect_step_by_mag.c

@@ -323,7 +323,7 @@ uint8_t detect_step_by_mag(int16_t *mag, int16_t acc_z)
 	  }
 		
 		/*判断前后脚掌的状态*/
-    if(mag_buf[2] - LiftPoint>2000)
+    if(mag_buf[2] - LiftPoint>1000)
 	  {
 		  FrontTouchFlag = 1;
 			if(mag_buf[2] - LiftPoint>LiftDistance)
@@ -331,10 +331,10 @@ uint8_t detect_step_by_mag(int16_t *mag, int16_t acc_z)
 			  LiftDistance = mag_buf[2] - LiftPoint;
 			}			
 	  }
-	  if((mag_buf[2] - LiftPoint<=1500)||((DropPoint-mag_buf[2]>0.4*LiftDistance)&&(abs(mag_buf[2]-mag_buf[1])<400)))
+	  if((mag_buf[2] - LiftPoint<=1000)||((DropPoint-mag_buf[2]>0.4*LiftDistance)&&(abs(mag_buf[2]-mag_buf[1])<400)))
 	  {
 		  FrontTouchFlag = 0;
-			LiftDistance = 2200;
+			LiftDistance = 1000;
 	  }
 
 		/*计算步数*/