ardupilot/libraries/AP_InternalError/AP_InternalError.cpp
2019-05-15 15:33:48 +10:00

24 lines
451 B
C++

#include "AP_InternalError.h"
// actually create the instance:
static AP_InternalError instance;
void AP_InternalError::error(const AP_InternalError::error_t e) {
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
if (e != AP_InternalError::error_t::watchdog_reset) {
AP_HAL::panic("internal error %u", unsigned(e));
}
#endif
internal_errors |= uint32_t(e);
}
namespace AP {
AP_InternalError &internalerror()
{
return instance;
}
};