mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-19 09:54:15 +01:00
OP-1273 added I2C warning alarm during calibration of zero point, and uncrustify
This commit is contained in:
parent
c5dc556a43
commit
4188b492fc
@ -87,7 +87,8 @@ void baro_airspeedGetMS4525DO(AirspeedSensorData *airspeedSensor, AirspeedSettin
|
|||||||
case 0: AlarmsClear(SYSTEMALARMS_ALARM_I2C);
|
case 0: AlarmsClear(SYSTEMALARMS_ALARM_I2C);
|
||||||
break;
|
break;
|
||||||
case -4:
|
case -4:
|
||||||
case -5: AlarmsSet(SYSTEMALARMS_ALARM_I2C, SYSTEMALARMS_ALARM_WARNING);
|
case -5:
|
||||||
|
case -7: AlarmsSet(SYSTEMALARMS_ALARM_I2C, SYSTEMALARMS_ALARM_WARNING);
|
||||||
break;
|
break;
|
||||||
case -1:
|
case -1:
|
||||||
case -2:
|
case -2:
|
||||||
@ -122,8 +123,7 @@ static int8_t baro_airspeedReadMS4525DO(AirspeedSensorData *airspeedSensor, Airs
|
|||||||
if (calibrationCount <= CALIBRATION_IDLE_MS / airspeedSettings->SamplePeriod) {
|
if (calibrationCount <= CALIBRATION_IDLE_MS / airspeedSettings->SamplePeriod) {
|
||||||
calibrationCount++;
|
calibrationCount++;
|
||||||
filter_reg = (airspeedSensor->SensorValue << FILTER_SHIFT);
|
filter_reg = (airspeedSensor->SensorValue << FILTER_SHIFT);
|
||||||
|
return -7;
|
||||||
return retVal;
|
|
||||||
} else if (calibrationCount <= (CALIBRATION_IDLE_MS + CALIBRATION_COUNT_MS) / airspeedSettings->SamplePeriod) {
|
} else if (calibrationCount <= (CALIBRATION_IDLE_MS + CALIBRATION_COUNT_MS) / airspeedSettings->SamplePeriod) {
|
||||||
calibrationCount++;
|
calibrationCount++;
|
||||||
// update filter register
|
// update filter register
|
||||||
@ -136,7 +136,7 @@ static int8_t baro_airspeedReadMS4525DO(AirspeedSensorData *airspeedSensor, Airs
|
|||||||
AirspeedSettingsZeroPointSet(&airspeedSettings->ZeroPoint);
|
AirspeedSettingsZeroPointSet(&airspeedSettings->ZeroPoint);
|
||||||
calibrationCount = 0;
|
calibrationCount = 0;
|
||||||
}
|
}
|
||||||
return retVal;
|
return -7;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user