ArduCopter: update AP_Baro constructors & initializers

This commit is contained in:
Pat Hickey 2011-12-08 22:47:59 -08:00
parent f4aaa56b16
commit a48c65b5b5
2 changed files with 9 additions and 14 deletions

View File

@ -160,11 +160,15 @@ static AP_Int8 *flight_modes = &g.flight_mode1;
AP_Compass_HIL compass;
#else
#if CONFIG_BARO == AP_BARO_BMP085
AP_Baro_BMP085 barometer;
#elif CONFIG_BARO == AP_BARO_MS5611
#if CONFIG_BARO == AP_BARO_BMP085
# if CONFIG_HARDWARE == CONFIG_HARDWARE_APM2
AP_Baro_BMP085 barometer(true);
# else
AP_Baro_BMP085 barometer(false);
# endif
#elif CONFIG_BARO == AP_BARO_MS5611
AP_Baro_MS5611 barometer;
#endif
#endif
AP_Compass_HMC5843 compass(Parameters::k_param_compass);
#endif

View File

@ -250,16 +250,7 @@ static void init_ardupilot()
adc.Init(&timer_scheduler); // APM ADC library initialization
#endif // CONFIG_ADC
#if CONFIG_BARO == AP_BARO_MS5611
barometer.init();
#elif CONFIG_BARO == AP_BARO_BMP085
# if CONFIG_APM_HARDWARE == APM_HARDWARE_APM2
#warning bmp085 for apm2
barometer.init(1, true);
# else
barometer.init(1, false);
# endif // CONFIG_APM_HARDWARE
#endif // CONFIG_BARO
barometer.init(&timer_scheduler);
#endif // HIL_MODE