AP_OSD: changed OSD screen switching logic

this prevents us constantly changing screens when a PWM is given that
matches multiple screens. Instead the first matching screen is used
This commit is contained in:
Andrew Tridgell 2021-02-02 15:18:34 +11:00 committed by Peter Barker
parent 275c2849cf
commit cfe63f8657

View File

@ -391,7 +391,7 @@ void AP_OSD::update_current_screen()
//select screen based on pwm ranges specified
case PWM_RANGE:
for (int i=0; i<AP_OSD_NUM_SCREENS; i++) {
if (get_screen(i).enabled && get_screen(i).channel_min <= channel_value && get_screen(i).channel_max > channel_value && previous_pwm_screen != i) {
if (get_screen(i).enabled && get_screen(i).channel_min <= channel_value && get_screen(i).channel_max > channel_value) {
current_screen = previous_pwm_screen = i;
break;
}