DataFlash: support for mavlink SENSOR message

This commit is contained in:
Peter Barker
2016-08-11 17:48:44 -03:00
committed by Lucas De Marchi
parent a511f97971
commit 8d253dec8e
7 changed files with 68 additions and 1 deletions
+24
View File
@@ -1100,5 +1100,29 @@ void DataFlash_File::_io_timer(void)
hal.util->perf_end(_perf_write);
}
// this sensor is enabled if we should be logging at the moment
bool DataFlash_File::logging_enabled() const
{
if (hal.util->get_soft_armed() ||
_front.log_while_disarmed()) {
return true;
}
return false;
}
bool DataFlash_File::logging_failed() const
{
if (_write_fd == -1 &&
(hal.util->get_soft_armed() ||
_front.log_while_disarmed())) {
return true;
}
if (_open_error) {
return true;
}
return false;
}
#endif // HAL_OS_POSIX_IO