Skip to content
Snippets Groups Projects
Commit 481a5586 authored by Randy Mackay's avatar Randy Mackay
Browse files

Copter: only send sonar distance to GCS when sonar enabled

parent 8c7b4fea
No related branches found
No related tags found
No related merge requests found
......@@ -581,6 +581,10 @@ static void NOINLINE send_current_waypoint(mavlink_channel_t chan)
#if CONFIG_SONAR == ENABLED
static void NOINLINE send_rangefinder(mavlink_channel_t chan)
{
// exit immediately if sonar is disabled
if (!g.sonar_enabled) {
return;
}
mavlink_msg_rangefinder_send(chan, sonar_alt * 0.01f, 0);
}
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment