mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_Scripting: init sends failure message
This commit is contained in:
parent
356ece6682
commit
c78112564c
@ -79,19 +79,17 @@ AP_Scripting::AP_Scripting() {
|
|||||||
_singleton = this;
|
_singleton = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AP_Scripting::init(void) {
|
void AP_Scripting::init(void) {
|
||||||
if (!_enable) {
|
if (!_enable) {
|
||||||
return true;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hal.scheduler->thread_create(FUNCTOR_BIND_MEMBER(&AP_Scripting::thread, void),
|
if (!hal.scheduler->thread_create(FUNCTOR_BIND_MEMBER(&AP_Scripting::thread, void),
|
||||||
"Scripting", SCRIPTING_STACK_SIZE, AP_HAL::Scheduler::PRIORITY_SCRIPTING, 0)) {
|
"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);
|
gcs().send_text(MAV_SEVERITY_CRITICAL, "Could not create scripting stack (%d)", SCRIPTING_STACK_SIZE);
|
||||||
|
gcs().send_text(MAV_SEVERITY_ERROR, "Scripting failed to start");
|
||||||
_init_failed = true;
|
_init_failed = true;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AP_Scripting::thread(void) {
|
void AP_Scripting::thread(void) {
|
||||||
|
@ -28,7 +28,7 @@ public:
|
|||||||
AP_Scripting(const AP_Scripting &other) = delete;
|
AP_Scripting(const AP_Scripting &other) = delete;
|
||||||
AP_Scripting &operator=(const AP_Scripting&) = delete;
|
AP_Scripting &operator=(const AP_Scripting&) = delete;
|
||||||
|
|
||||||
bool init(void);
|
void init(void);
|
||||||
bool init_failed(void) const { return _init_failed; }
|
bool init_failed(void) const { return _init_failed; }
|
||||||
|
|
||||||
bool enabled(void) const { return _enable != 0; };
|
bool enabled(void) const { return _enable != 0; };
|
||||||
|
Loading…
Reference in New Issue
Block a user