diff --git a/firmware/application/receiver_model.cpp b/firmware/application/receiver_model.cpp index f2658ade..38cb155c 100644 --- a/firmware/application/receiver_model.cpp +++ b/firmware/application/receiver_model.cpp @@ -23,9 +23,9 @@ #include "portapack_shared_memory.hpp" #include "portapack_persistent_memory.hpp" -#include "portapack.hpp" using namespace portapack; +#include "radio.hpp" #include "audio.hpp" #include "dsp_fir_taps.hpp" @@ -135,7 +135,6 @@ int32_t ReceiverModel::reference_ppm_correction() const { void ReceiverModel::set_reference_ppm_correction(int32_t v) { persistent_memory::set_correction_ppb(v * 1000); - clock_manager.set_reference_ppb(v * 1000); } bool ReceiverModel::antenna_bias() const { diff --git a/firmware/common/portapack_persistent_memory.cpp b/firmware/common/portapack_persistent_memory.cpp index c94fa0eb..cd93bd05 100644 --- a/firmware/common/portapack_persistent_memory.cpp +++ b/firmware/common/portapack_persistent_memory.cpp @@ -21,6 +21,8 @@ #include "portapack_persistent_memory.hpp" +#include "portapack.hpp" + #include "hal.h" #include "utility.hpp" @@ -65,7 +67,9 @@ ppb_t correction_ppb() { } void set_correction_ppb(const ppb_t new_value) { - data->correction_ppb = ppb_range.clip(new_value); + const auto clipped_value = ppb_range.clip(new_value); + data->correction_ppb = clipped_value; + portapack::clock_manager.set_reference_ppb(clipped_value); } } /* namespace persistent_memory */