mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2024-12-13 03:34:35 +00:00
changing logic to take 'up' or 'down' in account
This commit is contained in:
parent
e045628dab
commit
f994f8d697
@ -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() ) {
|
||||
|
Loading…
Reference in New Issue
Block a user