changing logic to take 'up' or 'down' in account

This commit is contained in:
GullCode 2023-03-27 14:22:07 +02:00
parent e045628dab
commit f994f8d697

View File

@ -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() ) {