Move PPB clock adjustment out of ReceiverModel.

This commit is contained in:
Jared Boone 2016-02-05 16:52:34 -08:00
parent fd3f962e40
commit a9451c17b4
2 changed files with 6 additions and 3 deletions

View File

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

View File

@ -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 */