mirror of https://github.com/ArduPilot/ardupilot
DataFlash: eliminate calls to manipulate _writes_enabled
This commit is contained in:
parent
67a5c1dfc0
commit
c9a4a6d772
|
@ -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:
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue