|
|
@ -86,23 +86,23 @@ bool Copter::check_if_auxsw_mode_used(uint8_t auxsw_mode_check) |
|
|
|
// check_duplicate_auxsw - Check to see if any Aux Switch Functions are duplicated
|
|
|
|
// check_duplicate_auxsw - Check to see if any Aux Switch Functions are duplicated
|
|
|
|
bool Copter::check_duplicate_auxsw(void) |
|
|
|
bool Copter::check_duplicate_auxsw(void) |
|
|
|
{ |
|
|
|
{ |
|
|
|
bool ret = ((g.ch7_option != AUXSW_DO_NOTHING) && (g.ch7_option == g.ch8_option || |
|
|
|
uint8_t auxsw_option_counts[AUXSW_SWITCH_MAX] = {}; |
|
|
|
g.ch7_option == g.ch9_option || g.ch7_option == g.ch10_option || |
|
|
|
auxsw_option_counts[g.ch7_option]++; |
|
|
|
g.ch7_option == g.ch11_option || g.ch7_option == g.ch12_option)); |
|
|
|
auxsw_option_counts[g.ch8_option]++; |
|
|
|
|
|
|
|
auxsw_option_counts[g.ch9_option]++; |
|
|
|
ret = ret || ((g.ch8_option != AUXSW_DO_NOTHING) && (g.ch8_option == g.ch9_option || |
|
|
|
auxsw_option_counts[g.ch10_option]++; |
|
|
|
g.ch8_option == g.ch10_option || g.ch8_option == g.ch11_option || |
|
|
|
auxsw_option_counts[g.ch11_option]++; |
|
|
|
g.ch8_option == g.ch12_option)); |
|
|
|
auxsw_option_counts[g.ch12_option]++; |
|
|
|
|
|
|
|
|
|
|
|
ret = ret || ((g.ch9_option != AUXSW_DO_NOTHING) && (g.ch9_option == g.ch10_option || |
|
|
|
for (uint8_t i=0; i<sizeof(auxsw_option_counts); i++) { |
|
|
|
g.ch9_option == g.ch11_option || g.ch9_option == g.ch12_option)); |
|
|
|
if (i == AUXSW_DO_NOTHING) { |
|
|
|
|
|
|
|
continue; |
|
|
|
ret = ret || ((g.ch10_option != AUXSW_DO_NOTHING) && (g.ch10_option == g.ch11_option || |
|
|
|
} |
|
|
|
g.ch10_option == g.ch12_option)); |
|
|
|
if (auxsw_option_counts[i] > 1) { |
|
|
|
|
|
|
|
return true; |
|
|
|
ret = ret || ((g.ch11_option != AUXSW_DO_NOTHING) && (g.ch11_option == g.ch12_option)); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
return ret; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Copter::reset_control_switch() |
|
|
|
void Copter::reset_control_switch() |
|
|
|