From f994f8d697cb30bcc9ba3080b81ba9daaa07a6d2 Mon Sep 17 00:00:00 2001 From: GullCode Date: Mon, 27 Mar 2023 14:22:07 +0200 Subject: [PATCH] changing logic to take 'up' or 'down' in account --- firmware/application/radio.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/firmware/application/radio.cpp b/firmware/application/radio.cpp index bcb5b649..28e52e3b 100644 --- a/firmware/application/radio.cpp +++ b/firmware/application/radio.cpp @@ -170,8 +170,17 @@ void set_direction(const rf::Direction new_direction) { bool set_tuning_frequency(const rf::Frequency frequency) { rf::Frequency final_frequency = frequency ; - if( portapack::persistent_memory::config_hamitup() ) { - final_frequency = frequency + portapack::persistent_memory::config_hamitup_freq(); + // if feature is enabled + if( portapack::persistent_memory::config_converter() ) { + //downconvert + if( portapack::persistent_memory::config_updown_converter() ) + { + final_frequency = frequency - portapack::persistent_memory::config_converter_freq(); + } + else //upconvert + { + final_frequency = frequency + portapack::persistent_memory::config_converter_freq(); + } } const auto tuning_config = tuning::config::create(final_frequency); if( tuning_config.is_valid() ) {