AP_InternalError: keep count of number of errors having occured

This commit is contained in:
Peter Barker 2019-06-03 13:20:53 +10:00 committed by Peter Barker
parent 7c44ad04b6
commit 256b6703f1
2 changed files with 6 additions and 1 deletions

View File

@ -17,8 +17,10 @@ void AP_InternalError::error(const AP_InternalError::error_t e) {
}
#endif
internal_errors |= uint32_t(e);
total_error_count++;
hal.util->persistent_data.internal_errors = internal_errors;
hal.util->persistent_data.internal_error_count++;
hal.util->persistent_data.internal_error_count = total_error_count;
}

View File

@ -54,6 +54,7 @@ public:
};
void error(const AP_InternalError::error_t error);
uint32_t count() const { return total_error_count; }
// internal_errors - return mask of internal errors seen
uint32_t errors() const {
@ -64,6 +65,8 @@ private:
// bitmask holding errors from internal_error_t
uint32_t internal_errors;
uint32_t total_error_count;
};
namespace AP {