mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-11-09 16:41:21 +08:00
AP_Scripting: Stop running scripts if the enable flag ever goes false
This commit is contained in:
1 parent
8785ff7a14
commit
cf94a02207
3 files changed
+6
-2
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user