Browse Source

DataFlash: move _initialised into DataFlash_Backend

mission-4.1.18
Peter Barker 8 years ago committed by Francisco Ferreira
parent
commit
4234f4ef7a
  1. 3
      libraries/DataFlash/DataFlash_Backend.cpp
  2. 2
      libraries/DataFlash/DataFlash_Backend.h
  3. 4
      libraries/DataFlash/DataFlash_File.cpp
  4. 1
      libraries/DataFlash/DataFlash_File.h
  5. 3
      libraries/DataFlash/DataFlash_MAVLink.cpp
  6. 2
      libraries/DataFlash/DataFlash_MAVLink.h

3
libraries/DataFlash/DataFlash_Backend.cpp

@ -268,6 +268,9 @@ bool DataFlash_Backend::WritesOK() const @@ -268,6 +268,9 @@ bool DataFlash_Backend::WritesOK() const
if (!_front.vehicle_is_armed() && !_front.log_while_disarmed()) {
return false;
}
if (!_initialised) {
return false;
}
return true;
}

2
libraries/DataFlash/DataFlash_Backend.h

@ -157,6 +157,8 @@ protected: @@ -157,6 +157,8 @@ protected:
// must be called when a new log is being started:
virtual void start_new_log_reset_variables();
bool _initialised;
private:
uint32_t _last_periodic_1Hz;

4
libraries/DataFlash/DataFlash_File.cpp

@ -53,7 +53,6 @@ DataFlash_File::DataFlash_File(DataFlash_Class &front, @@ -53,7 +53,6 @@ DataFlash_File::DataFlash_File(DataFlash_Class &front,
_read_fd_log_num(0),
_read_offset(0),
_write_offset(0),
_initialised(false),
_open_error(false),
_log_directory(log_directory),
_cached_oldest_log(0),
@ -520,9 +519,6 @@ bool DataFlash_File::WritesOK() const @@ -520,9 +519,6 @@ bool DataFlash_File::WritesOK() const
if (_write_fd == -1) {
return false;
}
if (!_initialised) {
return false;
}
if (_open_error) {
return false;
}

1
libraries/DataFlash/DataFlash_File.h

@ -83,7 +83,6 @@ private: @@ -83,7 +83,6 @@ private:
uint16_t _read_fd_log_num;
uint32_t _read_offset;
uint32_t _write_offset;
volatile bool _initialised;
volatile bool _open_error;
const char *_log_directory;

3
libraries/DataFlash/DataFlash_MAVLink.cpp

@ -124,9 +124,6 @@ bool DataFlash_MAVLink::WritesOK() const @@ -124,9 +124,6 @@ bool DataFlash_MAVLink::WritesOK() const
if (!DataFlash_Backend::WritesOK()) {
return false;
}
if (!_initialised) {
return false;
}
if (!_sending_to_client) {
return false;
}

2
libraries/DataFlash/DataFlash_MAVLink.h

@ -131,8 +131,6 @@ private: @@ -131,8 +131,6 @@ private:
uint8_t _target_system_id;
uint8_t _target_component_id;
bool _initialised;
// this controls the maximum number of blocks we will push from
// the pending and send queues in any call to push_log_blocks.
// push_log_blocks is called by periodic_tasks. Each block is 200

Loading…
Cancel
Save