diff --git a/libraries/SRV_Channel/SRV_Channel_aux.cpp b/libraries/SRV_Channel/SRV_Channel_aux.cpp index 09388fb239..74b052016e 100644 --- a/libraries/SRV_Channel/SRV_Channel_aux.cpp +++ b/libraries/SRV_Channel/SRV_Channel_aux.cpp @@ -175,15 +175,15 @@ void SRV_Channels::update_aux_servo_function(void) } function_mask.clearall(); - for (uint8_t i = 0; i < SRV_Channel::k_nr_aux_servo_functions; i++) { + for (uint16_t i = 0; i < SRV_Channel::k_nr_aux_servo_functions; i++) { functions[i].channel_mask = 0; } // set auxiliary ranges for (uint8_t i = 0; i < NUM_SERVO_CHANNELS; i++) { - if ((uint8_t)channels[i].function.get() < SRV_Channel::k_nr_aux_servo_functions) { + if ((uint16_t)channels[i].function.get() < SRV_Channel::k_nr_aux_servo_functions) { channels[i].aux_servo_function_setup(); - function_mask.set((uint8_t)channels[i].function.get()); + function_mask.set((uint16_t)channels[i].function.get()); functions[channels[i].function.get()].channel_mask |= 1U<enable_ch(c.ch_num); } @@ -505,7 +505,7 @@ bool SRV_Channels::set_aux_channel_default(SRV_Channel::Aux_servo_function_t fun channels[channel].type_setup = false; channels[channel].function.set(function); channels[channel].aux_servo_function_setup(); - function_mask.set((uint8_t)function); + function_mask.set((uint16_t)function); functions[function].channel_mask |= 1U<