AP_Arming: add pre-arm system check that scripting init succeeded

This commit is contained in:
Randy Mackay 2019-11-26 15:31:36 +09:00 committed by Andrew Tridgell
parent 4c11b77496
commit 00ab0f2c5c
1 changed files with 8 additions and 0 deletions

View File

@ -32,6 +32,7 @@
#include <AP_Baro/AP_Baro.h> #include <AP_Baro/AP_Baro.h>
#include <AP_RangeFinder/AP_RangeFinder.h> #include <AP_RangeFinder/AP_RangeFinder.h>
#include <AP_Terrain/AP_Terrain.h> #include <AP_Terrain/AP_Terrain.h>
#include <AP_Scripting/AP_Scripting.h>
#if HAL_WITH_UAVCAN #if HAL_WITH_UAVCAN
#include <AP_BoardConfig/AP_BoardConfig_CAN.h> #include <AP_BoardConfig/AP_BoardConfig_CAN.h>
@ -705,6 +706,13 @@ bool AP_Arming::system_checks(bool report)
check_failed(ARMING_CHECK_SYSTEM, report, "Terrain out of memory"); check_failed(ARMING_CHECK_SYSTEM, report, "Terrain out of memory");
return false; return false;
} }
#endif
#ifdef ENABLE_SCRIPTING
const AP_Scripting *scripting = AP_Scripting::get_singleton();
if ((scripting != nullptr) && scripting->enabled() && scripting->init_failed()) {
check_failed(ARMING_CHECK_SYSTEM, report, "Scripting out of memory");
return false;
}
#endif #endif
} }
if (AP::internalerror().errors() != 0) { if (AP::internalerror().errors() != 0) {