diff --git a/flight/Modules/Sensors/sensors.c b/flight/Modules/Sensors/sensors.c index d73d00887..b9c3159de 100644 --- a/flight/Modules/Sensors/sensors.c +++ b/flight/Modules/Sensors/sensors.c @@ -225,8 +225,6 @@ static void SensorsTask(void *parameters) AlarmsClear(SYSTEMALARMS_ALARM_SENSORS); } - int32_t read_good; - int32_t count; for (int i = 0; i < 3; i++) { accel_accum[i] = 0; @@ -244,6 +242,9 @@ static void SensorsTask(void *parameters) { struct pios_bma180_data accel; + int32_t read_good; + int32_t count; + count = 0; while((read_good = PIOS_BMA180_ReadFifo(&accel)) != 0 && !error) error = ((xTaskGetTickCount() - lastSysTime) > SENSOR_PERIOD) ? true : error;