DataFlash: check all backends for sensor health

This commit is contained in:
Peter Barker 2017-06-09 15:38:07 +10:00 committed by Francisco Ferreira
parent c1583da7d5
commit cdd0397bbf
1 changed files with 12 additions and 2 deletions

View File

@ -242,7 +242,12 @@ bool DataFlash_Class::logging_enabled() const
if (_next_backend == 0) {
return false;
}
return backends[0]->logging_enabled();
for (uint8_t i=0; i<_next_backend; i++) {
if (backends[i]->logging_enabled()) {
return true;
}
}
return false;
}
bool DataFlash_Class::logging_failed() const
{
@ -250,7 +255,12 @@ bool DataFlash_Class::logging_failed() const
// we should not have been called!
return true;
}
return backends[0]->logging_failed();
for (uint8_t i=0; i<_next_backend; i++) {
if (backends[i]->logging_failed()) {
return true;
}
}
return false;
}
void DataFlash_Class::Log_Write_MessageF(const char *fmt, ...)