AP_Tuning: detect change to TUNE_PARMSET while tuning

This commit is contained in:
Andrew Tridgell 2016-05-08 14:35:40 +10:00
parent 6d1c7c9082
commit f69806deff
2 changed files with 11 additions and 4 deletions

View File

@ -145,6 +145,16 @@ void AP_Tuning::check_input(uint8_t flightmode)
if (range < 1.1f) {
range.set(1.1f);
}
if (current_parm == 0) {
next_parameter();
}
// cope with user changing parmset while tuning
if (current_set != parmset) {
re_center();
}
current_set = parmset;
check_selector_switch();
@ -153,9 +163,6 @@ void AP_Tuning::check_input(uint8_t flightmode)
return;
}
if (current_parm == 0) {
next_parameter();
}
if (current_parm == 0) {
return;
}

View File

@ -44,7 +44,7 @@ private:
AP_Int16 channel_min;
AP_Int16 channel_max;
AP_Int8 selector;
AP_Int8 parmset;
AP_Int16 parmset;
AP_Float range;
// when selector was triggered