mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-13 03:19:58 +03:00
Fix define baro
This commit is contained in:
parent
b9db8e00c3
commit
d9320e84fb
1 changed files with 8 additions and 3 deletions
|
@ -41,10 +41,12 @@ float applySensorTempCompensation(int16_t sensorTemp, float sensorMeasurement, s
|
||||||
float setting = 0.0f;
|
float setting = 0.0f;
|
||||||
if (sensorType == SENSOR_INDEX_ACC) {
|
if (sensorType == SENSOR_INDEX_ACC) {
|
||||||
setting = accelerometerConfig()->acc_temp_correction;
|
setting = accelerometerConfig()->acc_temp_correction;
|
||||||
} else if (sensorType == SENSOR_INDEX_BARO) {
|
}
|
||||||
|
#ifdef USE_BARO
|
||||||
|
else if (sensorType == SENSOR_INDEX_BARO) {
|
||||||
setting = barometerConfig()->baro_temp_correction;
|
setting = barometerConfig()->baro_temp_correction;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (!setting) {
|
if (!setting) {
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
|
@ -94,9 +96,12 @@ float applySensorTempCompensation(int16_t sensorTemp, float sensorMeasurement, s
|
||||||
|
|
||||||
if (sensorType == SENSOR_INDEX_ACC) {
|
if (sensorType == SENSOR_INDEX_ACC) {
|
||||||
accelerometerConfigMutable()->acc_temp_correction = sensor_comp_data[sensorType].correctionFactor;
|
accelerometerConfigMutable()->acc_temp_correction = sensor_comp_data[sensorType].correctionFactor;
|
||||||
} else if (sensorType == SENSOR_INDEX_BARO) {
|
}
|
||||||
|
#ifdef USE_BARO
|
||||||
|
else if (sensorType == SENSOR_INDEX_BARO) {
|
||||||
barometerConfigMutable()->baro_temp_correction = sensor_comp_data[sensorType].correctionFactor;
|
barometerConfigMutable()->baro_temp_correction = sensor_comp_data[sensorType].correctionFactor;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
sensor_comp_data[sensorType].calibrationState = SENSOR_TEMP_CAL_COMPLETE;
|
sensor_comp_data[sensorType].calibrationState = SENSOR_TEMP_CAL_COMPLETE;
|
||||||
startTimeMs = 0;
|
startTimeMs = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue