From 5b3f2b7e238ebb7c978c5148ec2b660b3f77f3f9 Mon Sep 17 00:00:00 2001 From: Federico Amedeo Izzo Date: Sat, 5 Jun 2021 10:08:15 +0200 Subject: [PATCH] Simplify frequency limits check for VFO input --- openrtx/src/ui/ui.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/openrtx/src/ui/ui.c b/openrtx/src/ui/ui.c index a79dba97..69967706 100644 --- a/openrtx/src/ui/ui.c +++ b/openrtx/src/ui/ui.c @@ -501,23 +501,15 @@ void _ui_fsm_confirmVFOInput(bool *sync_rtx) { // If TX frequency was not set, TX = RX if(ui_state.new_tx_frequency == 0) { - if(_ui_freq_check_limits(ui_state.new_rx_frequency)) - { - state.channel.rx_frequency = ui_state.new_rx_frequency; - state.channel.tx_frequency = ui_state.new_rx_frequency; - *sync_rtx = true; - } + ui_state.new_tx_frequency = ui_state.new_rx_frequency; } - // Otherwise set both frequencies - else + // Apply new frequencies if they are valid + if(_ui_freq_check_limits(ui_state.new_rx_frequency) && + _ui_freq_check_limits(ui_state.new_tx_frequency)) { - if(_ui_freq_check_limits(ui_state.new_rx_frequency) && - _ui_freq_check_limits(ui_state.new_tx_frequency)) - { - state.channel.rx_frequency = ui_state.new_rx_frequency; - state.channel.tx_frequency = ui_state.new_tx_frequency; - *sync_rtx = true; - } + state.channel.rx_frequency = ui_state.new_rx_frequency; + state.channel.tx_frequency = ui_state.new_tx_frequency; + *sync_rtx = true; } state.ui_screen = MAIN_VFO; }