2019-03-18 08:32:42 -03:00
|
|
|
#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
|
2019-05-09 05:48:50 -03:00
|
|
|
if (e != AP_InternalError::error_t::watchdog_reset) {
|
|
|
|
AP_HAL::panic("internal error %u", unsigned(e));
|
|
|
|
}
|
2019-03-18 08:32:42 -03:00
|
|
|
#endif
|
|
|
|
internal_errors |= uint32_t(e);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
namespace AP {
|
|
|
|
|
|
|
|
AP_InternalError &internalerror()
|
|
|
|
{
|
|
|
|
return instance;
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|