Browse Source

优化踮脚亮灯的逻辑

liang 2 years ago
parent
commit
4481e56d1e
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/app_overturn.c

+ 2 - 2
app/app_overturn.c

@@ -235,12 +235,12 @@ void app_BatDispaly_Process(void)
 					bll_imu_get_data(BLL_IMU_DIR_FRONT, data_size-1 , &data);
 				
 					//耗时较少的计算滑动窗口的最大值、最小值
-					sort_silde_window(&max_slide_window, &min_slide_window,  data.acc[0], time_count);
+					sort_silde_window(&max_slide_window, &min_slide_window,  data.acc[2], time_count);
 					
 					
 					if(time_count > SLIDE_WINDOW_LEN)
 					{
-						if(data.acc[0] - min_slide_window.slide_window[0].max_temp < 256 &&  max_slide_window.slide_window[0].max_temp -  data.acc[0] < 256
+						if(data.acc[2] - min_slide_window.slide_window[0].max_temp < 256 &&  max_slide_window.slide_window[0].max_temp -  data.acc[2] < 256
 							&& max_slide_window.slide_window[0].max_temp  - min_slide_window.slide_window[0].max_temp < 256 &&  data.acc[0] < -600)
 						{
 							station_count++;