AP_ExternalAHRS: use config error instead of panic on allocation failure
This commit is contained in:
parent
8a3e1b96ab
commit
224abe7933
@ -29,6 +29,7 @@
|
||||
#include <AP_Logger/AP_Logger.h>
|
||||
#include <AP_Common/NMEA.h>
|
||||
#include <stdio.h>
|
||||
#include <AP_BoardConfig/AP_BoardConfig.h>
|
||||
|
||||
#if HAL_EXTERNAL_AHRS_ENABLED
|
||||
|
||||
@ -120,7 +121,7 @@ AP_ExternalAHRS_VectorNav::AP_ExternalAHRS_VectorNav(AP_ExternalAHRS *_frontend,
|
||||
last_pkt2 = new VN_packet2;
|
||||
|
||||
if (!pktbuf || !last_pkt1 || !last_pkt2) {
|
||||
AP_HAL::panic("Failed to allocate ExternalAHRS");
|
||||
AP_BoardConfig::allocation_error("Failed to allocate ExternalAHRS");
|
||||
}
|
||||
|
||||
if (!hal.scheduler->thread_create(FUNCTOR_BIND_MEMBER(&AP_ExternalAHRS_VectorNav::update_thread, void), "AHRS", 2048, AP_HAL::Scheduler::PRIORITY_SPI, 0)) {
|
||||
|
Loading…
Reference in New Issue
Block a user