From b055aa6f819d9b6755e7785ea1e7f089d7a08cad Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Tue, 29 Nov 2011 20:35:08 -0800 Subject: [PATCH] ArduCopter: instantiate correct AP_Baro object based on CONFIG_BARO --- ArduCopter/ArduCopter.pde | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ArduCopter/ArduCopter.pde b/ArduCopter/ArduCopter.pde index 3c0f265ac9..71b3b5b32d 100644 --- a/ArduCopter/ArduCopter.pde +++ b/ArduCopter/ArduCopter.pde @@ -159,7 +159,13 @@ static AP_Int8 *flight_modes = &g.flight_mode1; AP_Baro_BMP085_HIL barometer; AP_Compass_HIL compass; #else - AP_Baro_BMP085 barometer; + + #if CONFIG_BARO == AP_BARO_BMP085 + AP_Baro_BMP085 barometer; + #elif CONFIG_BARO == AP_BARO_MS5611 + AP_Baro_MS5611 barometer; + #endif + AP_Compass_HMC5843 compass(Parameters::k_param_compass); #endif