DataFlash: move log-write-started logic to be backend-specific

This commit is contained in:
Peter Barker 2017-07-07 11:34:31 +10:00 committed by Francisco Ferreira
parent 1f0a14ab33
commit 0769432e63
3 changed files with 3 additions and 4 deletions

View File

@ -51,7 +51,7 @@ public:
virtual void ShowDeviceInfo(AP_HAL::BetterStream *port) = 0;
virtual void ListAvailableLogs(AP_HAL::BetterStream *port) = 0;
virtual bool logging_started(void) const { return log_write_started; }
virtual bool logging_started(void) const = 0;
virtual void Init() { }
@ -62,7 +62,6 @@ public:
virtual void PrepForArming() { }
virtual uint16_t start_new_log(void) = 0;
bool log_write_started;
/* stop logging - close output files etc etc.
*

View File

@ -830,7 +830,6 @@ void DataFlash_File::stop_logging(void)
if (_write_fd != -1) {
int fd = _write_fd;
_write_fd = -1;
log_write_started = false;
::close(fd);
}
}
@ -899,7 +898,6 @@ uint16_t DataFlash_File::start_new_log(void)
free(fname);
_write_offset = 0;
_writebuf.clear();
log_write_started = true;
// now update lastlog.txt with the new log number
fname = _lastlog_file_name();

View File

@ -71,6 +71,8 @@ public:
bool logging_enabled() const override;
bool logging_failed() const override;
bool logging_started(void) const override { return _write_fd != -1; }
void vehicle_was_disarmed() override;
virtual void PrepForArming() override;