1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 13:25:30 +03:00

Configurable Baro Type

We can disable/configure mag, acc, but why not baro?

ident
This commit is contained in:
borisbstyle 2015-08-16 23:03:46 +02:00 committed by Dominic Clifton
parent 6a24295525
commit 26f89b74bd
7 changed files with 12 additions and 8 deletions

View file

@ -408,12 +408,12 @@ retry:
sensorsSet(SENSOR_ACC);
}
static void detectBaro()
static void detectBaro(baroSensor_e baroHardwareToUse)
{
#ifdef BARO
// Detect what pressure sensors are available. baro->update() is set to sensor-specific update function
baroSensor_e baroHardware = BARO_DEFAULT;
baroSensor_e baroHardware = baroHardwareToUse;
#ifdef USE_BARO_BMP085
@ -587,7 +587,7 @@ void reconfigureAlignment(sensorAlignmentConfig_t *sensorAlignmentConfig)
}
}
bool sensorsAutodetect(sensorAlignmentConfig_t *sensorAlignmentConfig, uint16_t gyroLpf, uint8_t accHardwareToUse, uint8_t magHardwareToUse, int16_t magDeclinationFromConfig)
bool sensorsAutodetect(sensorAlignmentConfig_t *sensorAlignmentConfig, uint16_t gyroLpf, uint8_t accHardwareToUse, uint8_t magHardwareToUse, uint8_t baroHardwareToUse, int16_t magDeclinationFromConfig)
{
int16_t deg, min;
@ -598,7 +598,7 @@ bool sensorsAutodetect(sensorAlignmentConfig_t *sensorAlignmentConfig, uint16_t
return false;
}
detectAcc(accHardwareToUse);
detectBaro();
detectBaro(baroHardwareToUse);
// Now time to init things, acc first