Browse Source

AP_InternalError: keep count of number of errors having occured

master
Peter Barker 6 years ago committed by Peter Barker
parent
commit
256b6703f1
  1. 4
      libraries/AP_InternalError/AP_InternalError.cpp
  2. 3
      libraries/AP_InternalError/AP_InternalError.h

4
libraries/AP_InternalError/AP_InternalError.cpp

@ -17,8 +17,10 @@ void AP_InternalError::error(const AP_InternalError::error_t e) { @@ -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;
}

3
libraries/AP_InternalError/AP_InternalError.h

@ -54,6 +54,7 @@ public: @@ -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: @@ -64,6 +65,8 @@ private:
// bitmask holding errors from internal_error_t
uint32_t internal_errors;
uint32_t total_error_count;
};
namespace AP {

Loading…
Cancel
Save