bmi160: prevent multiple time syncs

The active_data_sensor_cnt variable was uninitialised and
is needed to make sure that only a single time sync event
is scheduled every 100ms. Previously when a fusion algorithm
like gravity was started, two time sync events would be
scheduled every 100ms, one for each of the two enabled
sensors. This was causing unintended wakeups.

Change-Id: I81c756ae1a6866d58f6ac769fcc21e567c350f7e
diff --git a/firmware/src/drivers/bosch_bmi160_bmm150/bosch_bmi160_bmm150.c b/firmware/src/drivers/bosch_bmi160_bmm150/bosch_bmi160_bmm150.c
index c57a9a1..0a9d370 100644
--- a/firmware/src/drivers/bosch_bmi160_bmm150/bosch_bmi160_bmm150.c
+++ b/firmware/src/drivers/bosch_bmi160_bmm150/bosch_bmi160_bmm150.c
@@ -2154,7 +2154,7 @@
     case SENSOR_POWERING_UP:
         mSensor = (struct BMI160Sensor *)evtData;
         if (mSensor->idx <= MAG) {
-            if (!(mTask.fifo_enabled[0] || mTask.fifo_enabled[1] || mTask.fifo_enabled[2])) {
+            if (mTask.active_data_sensor_cnt++ == 0) {
                 // if this is the first data sensor to enable, we need to
                 // sync the sensor time and rtc time
                 invalidate_sensortime_to_rtc_time();
@@ -2358,6 +2358,7 @@
     mTask.Int2_EN = false;
     mTask.pending_int[0] = false;
     mTask.pending_int[1] = false;
+    mTask.active_data_sensor_cnt = 0;
 
     mTask.mode.speed = BMI160_SPI_SPEED_HZ;
     mTask.mode.bitsPerWord = 8;