DataFlash: eliminate calls to manipulate _writes_enabled

This commit is contained in:
Peter Barker 2017-06-09 14:19:11 +10:00 committed by Randy Mackay
parent 67a5c1dfc0
commit c9a4a6d772
2 changed files with 5 additions and 0 deletions

View File

@ -212,6 +212,7 @@ public:
bool logging_failed() const; bool logging_failed() const;
void set_vehicle_armed(bool armed_state); void set_vehicle_armed(bool armed_state);
bool vehicle_is_armed() const { return _armed; }
protected: protected:

View File

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