12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- #pragma once
- #include <stdint.h>
- class AP_InternalError {
- public:
-
-
-
-
-
-
- enum class error_t {
- logger_mapfailure = (1U << 0),
- logger_missing_logstructure = (1U << 1),
- logger_logwrite_missingfmt = (1U << 2),
- logger_too_many_deletions = (1U << 3),
- logger_bad_getfilename = (1U << 4),
- unused1 = (1U << 5),
- logger_flushing_without_sem = (1U << 6),
- logger_bad_current_block = (1U << 7),
- logger_blockcount_mismatch = (1U << 8),
- logger_dequeue_failure = (1U << 9),
- constraining_nan = (1U << 10),
- watchdog_reset = (1U << 11),
- iomcu_reset = (1U << 12),
- iomcu_fail = (1U << 13),
- spi_fail = (1U << 14),
- main_loop_stuck = (1U << 15),
- gcs_bad_missionprotocol_link= (1U << 16),
- bitmask_range = (1U << 17),
- gcs_offset = (1U << 18),
- i2c_isr = (1U << 19),
- };
- void error(const AP_InternalError::error_t error);
- uint32_t count() const { return total_error_count; }
-
- uint32_t errors() const {
- return internal_errors;
- }
- private:
-
- uint32_t internal_errors;
- uint32_t total_error_count;
- };
- namespace AP {
- AP_InternalError &internalerror();
- };
|