RC_Channel: prevent a warning message for assigned RC channels

This commit is contained in:
Andrew Tridgell 2016-01-06 19:11:14 +11:00
parent 6c064ae8bd
commit 9941c91d36
1 changed files with 3 additions and 0 deletions

View File

@ -391,6 +391,9 @@ bool RC_Channel_aux::set_aux_channel_default(RC_Channel_aux::Aux_servo_function_
for (uint8_t i=0; i<RC_AUX_MAX_CHANNELS; i++) {
if (_aux_channels[i] && _aux_channels[i]->_ch_out == channel) {
if (_aux_channels[i]->function != k_none) {
if (_aux_channels[i]->function == function) {
return true;
}
hal.console->printf("Channel %u already assigned %u\n",
(unsigned)channel,
(unsigned)_aux_channels[i]->function);