From f13ab11c88138ca6f392ad5c12dde9e4e0712f58 Mon Sep 17 00:00:00 2001 From: Iampete1 Date: Tue, 31 Aug 2021 13:22:54 +0100 Subject: [PATCH] SRV_Channel: call update_aux_servo_function in function_assigned --- libraries/SRV_Channel/SRV_Channel_aux.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/libraries/SRV_Channel/SRV_Channel_aux.cpp b/libraries/SRV_Channel/SRV_Channel_aux.cpp index efe846d6a8..09388fb239 100644 --- a/libraries/SRV_Channel/SRV_Channel_aux.cpp +++ b/libraries/SRV_Channel/SRV_Channel_aux.cpp @@ -452,6 +452,9 @@ SRV_Channels::set_output_limit(SRV_Channel::Aux_servo_function_t function, SRV_C bool SRV_Channels::function_assigned(SRV_Channel::Aux_servo_function_t function) { + if (!initialised) { + update_aux_servo_function(); + } return function_mask.get(uint16_t(function)); } @@ -486,9 +489,6 @@ SRV_Channels::move_servo(SRV_Channel::Aux_servo_function_t function, */ bool SRV_Channels::set_aux_channel_default(SRV_Channel::Aux_servo_function_t function, uint8_t channel) { - if (!initialised) { - update_aux_servo_function(); - } if (function_assigned(function)) { // already assigned return true; @@ -513,9 +513,6 @@ bool SRV_Channels::set_aux_channel_default(SRV_Channel::Aux_servo_function_t fun // find first channel that a function is assigned to bool SRV_Channels::find_channel(SRV_Channel::Aux_servo_function_t function, uint8_t &chan) { - if (!initialised) { - update_aux_servo_function(); - } if (!function_assigned(function)) { return false; }