mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-21 16:18:29 -04:00
AP_InternalError: keep count of number of errors having occured
This commit is contained in:
parent
7c44ad04b6
commit
256b6703f1
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user