Merge "bmi160: fix step counter flush when spi command cannot be issued immediately" into pi-dev
diff --git a/firmware/os/drivers/bosch_bmi160/bosch_bmi160.c b/firmware/os/drivers/bosch_bmi160/bosch_bmi160.c
index 34bad87..3f272d6 100644
--- a/firmware/os/drivers/bosch_bmi160/bosch_bmi160.c
+++ b/firmware/os/drivers/bosch_bmi160/bosch_bmi160.c
@@ -3344,7 +3344,7 @@
         }
     }
     if (mTask.sensors[STEPCNT].flush > 0 || T(pending_step_cnt)) {
-        T(pending_step_cnt) = T(pending_step_cnt) && !stepCntFlushGetData();
+        T(pending_step_cnt) = !stepCntFlushGetData() && T(pending_step_cnt);
         return;
     }
     if (mTask.pending_calibration_save) {