diff --git a/libraries/AP_Baro/AP_Baro_BMP085.cpp b/libraries/AP_Baro/AP_Baro_BMP085.cpp index 2ac3646b0f..e97599934f 100644 --- a/libraries/AP_Baro/AP_Baro_BMP085.cpp +++ b/libraries/AP_Baro/AP_Baro_BMP085.cpp @@ -78,7 +78,7 @@ AP_Baro_BMP085::AP_Baro_BMP085(AP_Baro &baro, AP_HAL::OwnPtr // Send a command to read temperature _cmd_read_temp(); - BMP085_State = 0; + _state = 0; sem->give(); } @@ -99,15 +99,15 @@ void AP_Baro_BMP085::accumulate(void) return; } - if (BMP085_State == 0) { + if (_state == 0) { _read_temp(); } else if (_read_pressure()) { _calculate(); } - BMP085_State++; - if (BMP085_State == 5) { - BMP085_State = 0; + _state++; + if (_state == 5) { + _state = 0; _cmd_read_temp(); } else { _cmd_read_pressure(); @@ -237,7 +237,7 @@ bool AP_Baro_BMP085::_data_ready() } // No EOC pin: use time from last read instead. - if (BMP085_State == 0) { + if (_state == 0) { return AP_HAL::millis() > _last_temp_read_command_time + 5; } diff --git a/libraries/AP_Baro/AP_Baro_BMP085.h b/libraries/AP_Baro/AP_Baro_BMP085.h index 81ea61d01b..878565b2be 100644 --- a/libraries/AP_Baro/AP_Baro_BMP085.h +++ b/libraries/AP_Baro/AP_Baro_BMP085.h @@ -37,7 +37,7 @@ private: uint32_t _last_temp_read_command_time; // State machine - uint8_t BMP085_State; + uint8_t _state; // Internal calibration registers int16_t ac1, ac2, ac3, b1, b2, mb, mc, md;