AP_Scripting: Stop running scripts if the enable flag ever goes false

This commit is contained in:
Michael du Breuil authored and WickedShell committed 2019-10-15 15:35:12 -06:00
1 parent 8785ff7a14
commit cf94a02207
3 files changed
+6 -2

No files matched your search

+2 -1
View File
@@ -87,6 +87,7 @@ bool AP_Scripting::init(void) {
if (!hal.scheduler->thread_create(FUNCTOR_BIND_MEMBER(&AP_Scripting::thread, void),
"Scripting", SCRIPTING_STACK_SIZE, AP_HAL::Scheduler::PRIORITY_SCRIPTING, 0)) {
gcs().send_text(MAV_SEVERITY_CRITICAL, "Could not create scripting stack (%d)", SCRIPTING_STACK_SIZE);
_enable = 0;
return false;
}
@@ -102,7 +103,7 @@ void AP_Scripting::thread(void) {
lua->run();
// only reachable if the lua backend has died for any reason
gcs().send_text(MAV_SEVERITY_CRITICAL, "Scripting has died");
gcs().send_text(MAV_SEVERITY_CRITICAL, "Scripting has stopped");
}
AP_Scripting *AP_Scripting::_singleton = nullptr;