mirror of https://github.com/ArduPilot/ardupilot
AP_SmartRTL: correct compilation when GCS library not available
This commit is contained in:
parent
dd6d1f04c2
commit
1bf85a0a15
|
@ -118,7 +118,7 @@ void AP_SmartRTL::init()
|
||||||
// check if memory allocation failed
|
// check if memory allocation failed
|
||||||
if (_path == nullptr || _prune.loops == nullptr || _simplify.stack == nullptr) {
|
if (_path == nullptr || _prune.loops == nullptr || _simplify.stack == nullptr) {
|
||||||
log_action(SRTL_DEACTIVATED_INIT_FAILED);
|
log_action(SRTL_DEACTIVATED_INIT_FAILED);
|
||||||
gcs().send_text(MAV_SEVERITY_WARNING, "SmartRTL deactivated: init failed");
|
GCS_SEND_TEXT(MAV_SEVERITY_WARNING, "SmartRTL deactivated: init failed");
|
||||||
free(_path);
|
free(_path);
|
||||||
free(_prune.loops);
|
free(_prune.loops);
|
||||||
free(_simplify.stack);
|
free(_simplify.stack);
|
||||||
|
@ -390,7 +390,7 @@ void AP_SmartRTL::run_background_cleanup()
|
||||||
// warn if buffer is about to be filled
|
// warn if buffer is about to be filled
|
||||||
uint32_t now_ms = AP_HAL::millis();
|
uint32_t now_ms = AP_HAL::millis();
|
||||||
if ((path_points_count >0) && (path_points_count >= _path_points_max - 9) && (now_ms - _last_low_space_notify_ms > 10000)) {
|
if ((path_points_count >0) && (path_points_count >= _path_points_max - 9) && (now_ms - _last_low_space_notify_ms > 10000)) {
|
||||||
gcs().send_text(MAV_SEVERITY_INFO, "SmartRTL Low on space!");
|
GCS_SEND_TEXT(MAV_SEVERITY_INFO, "SmartRTL Low on space!");
|
||||||
_last_low_space_notify_ms = now_ms;
|
_last_low_space_notify_ms = now_ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -866,7 +866,7 @@ void AP_SmartRTL::deactivate(SRTL_Actions action, const char *reason)
|
||||||
{
|
{
|
||||||
_active = false;
|
_active = false;
|
||||||
log_action(action);
|
log_action(action);
|
||||||
gcs().send_text(MAV_SEVERITY_WARNING, "SmartRTL deactivated: %s", reason);
|
GCS_SEND_TEXT(MAV_SEVERITY_WARNING, "SmartRTL deactivated: %s", reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
// logging
|
// logging
|
||||||
|
|
Loading…
Reference in New Issue