From d5386b8bb82aac3041155062d5b99e160449bde8 Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Thu, 8 Dec 2011 22:27:30 -0800 Subject: [PATCH] AP_Baro_BMP085: move apm2_hardware flag from init to constructor. --- libraries/AP_Baro/AP_Baro_BMP085.cpp | 7 ++----- libraries/AP_Baro/AP_Baro_BMP085.h | 6 +++--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/libraries/AP_Baro/AP_Baro_BMP085.cpp b/libraries/AP_Baro/AP_Baro_BMP085.cpp index 6eb84d274e..690f121a5f 100644 --- a/libraries/AP_Baro/AP_Baro_BMP085.cpp +++ b/libraries/AP_Baro/AP_Baro_BMP085.cpp @@ -59,11 +59,8 @@ bool AP_Baro_BMP085::init(int initialiseWireLib, bool apm2_hardware) { byte buff[22]; int i = 0; - - _apm2_hardware = apm2_hardware; - - pinMode(BMP085_EOC, INPUT); // End Of Conversion (PC7) input - + + pinMode(BMP085_EOC, INPUT); // End Of Conversion (PC7) input oss = 3; // Over Sampling setting 3 = High resolution BMP085_State = 0; // Initial state diff --git a/libraries/AP_Baro/AP_Baro_BMP085.h b/libraries/AP_Baro/AP_Baro_BMP085.h index d957c1f7a2..4cd8916d5b 100644 --- a/libraries/AP_Baro/AP_Baro_BMP085.h +++ b/libraries/AP_Baro/AP_Baro_BMP085.h @@ -9,11 +9,11 @@ class AP_Baro_BMP085 : public AP_Baro { public: - AP_Baro_BMP085(): + AP_Baro_BMP085(bool apm2_hardware): _temp_index(0), - _press_index(0){}; // Constructor + _press_index(0), + _apm2_hardware(apm2_hardware){}; // Constructor - bool init(int initialiseWireLib = 1, bool apm2_hardware=false); /* AP_Baro public interface: */ uint8_t read();