From cfe63f86572f55f1a684e58711d34fea566752f4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 2 Feb 2021 15:18:34 +1100 Subject: [PATCH] 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 --- libraries/AP_OSD/AP_OSD.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_OSD/AP_OSD.cpp b/libraries/AP_OSD/AP_OSD.cpp index 57f9dc47de..eb33a381d3 100644 --- a/libraries/AP_OSD/AP_OSD.cpp +++ b/libraries/AP_OSD/AP_OSD.cpp @@ -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 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; }