Browse Source

AP_Baro: rename dataflash to logger

master
Tom Pittenger 6 years ago committed by Peter Barker
parent
commit
b54da9aab8
  1. 10
      libraries/AP_Baro/AP_Baro.cpp
  2. 2
      libraries/AP_Baro/AP_Baro.h

10
libraries/AP_Baro/AP_Baro.cpp

@ -706,16 +706,16 @@ void AP_Baro::_probe_i2c_barometers(void)
} }
} }
bool AP_Baro::should_df_log() const bool AP_Baro::should_log() const
{ {
AP_Logger *instance = AP_Logger::get_singleton(); AP_Logger *logger = AP_Logger::get_singleton();
if (instance == nullptr) { if (logger == nullptr) {
return false; return false;
} }
if (_log_baro_bit == (uint32_t)-1) { if (_log_baro_bit == (uint32_t)-1) {
return false; return false;
} }
if (!instance->should_log(_log_baro_bit)) { if (!logger->should_log(_log_baro_bit)) {
return false; return false;
} }
return true; return true;
@ -789,7 +789,7 @@ void AP_Baro::update(void)
} }
// logging // logging
if (should_df_log() && !AP::ahrs().have_ekf_logging()) { if (should_log() && !AP::ahrs().have_ekf_logging()) {
AP::logger().Write_Baro(); AP::logger().Write_Baro();
} }
} }

2
libraries/AP_Baro/AP_Baro.h

@ -179,7 +179,7 @@ public:
// indicate which bit in LOG_BITMASK indicates baro logging enabled // indicate which bit in LOG_BITMASK indicates baro logging enabled
void set_log_baro_bit(uint32_t bit) { _log_baro_bit = bit; } void set_log_baro_bit(uint32_t bit) { _log_baro_bit = bit; }
bool should_df_log() const; bool should_log() const;
private: private:
// singleton // singleton

Loading…
Cancel
Save