From 0a5407a1a785eed1f8a6639944c19d3ce6506fa6 Mon Sep 17 00:00:00 2001 From: Brad Bosch Date: Sun, 3 Dec 2023 14:38:35 -0600 Subject: [PATCH] AP_VideoTX: Restore use of the VTX_MAX_POWER parameter This functionality was lost when a significant rewrite of this code was done in commit 0658f060301c9230c5b170bbad005dee68fbcd8a --- libraries/AP_VideoTX/AP_VideoTX.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_VideoTX/AP_VideoTX.cpp b/libraries/AP_VideoTX/AP_VideoTX.cpp index 8bfa7c14ca..ac57aade83 100644 --- a/libraries/AP_VideoTX/AP_VideoTX.cpp +++ b/libraries/AP_VideoTX/AP_VideoTX.cpp @@ -515,7 +515,7 @@ void AP_VideoTX::change_power(int8_t position) // first find out how many possible levels there are uint8_t num_active_levels = 0; for (uint8_t i = 0; i < VTX_MAX_POWER_LEVELS; i++) { - if (_power_levels[i].active != PowerActive::Inactive) { + if (_power_levels[i].active != PowerActive::Inactive && _power_levels[i].mw <= _max_power_mw) { num_active_levels++; } }