Bugfix: use correct PLL frequency when switching between internal/external reference

This commit is contained in:
Jan Käberich 2021-05-08 13:24:12 +02:00
parent 75d79ccf31
commit 2fac430381

View File

@ -364,13 +364,13 @@ void HW::Ref::update() {
LOG_WARN("Forced switch to external reference but no signal detected"); LOG_WARN("Forced switch to external reference but no signal detected");
} }
Si5351.ConfigureCLKIn(10000000); Si5351.ConfigureCLKIn(10000000);
Si5351.SetPLL(Si5351C::PLL::A, 800000000, Si5351C::PLLSource::CLKIN); Si5351.SetPLL(Si5351C::PLL::A, 832000000, Si5351C::PLLSource::CLKIN);
Si5351.SetPLL(Si5351C::PLL::B, 800000000, Si5351C::PLLSource::CLKIN); Si5351.SetPLL(Si5351C::PLL::B, 832000000, Si5351C::PLLSource::CLKIN);
LOG_INFO("Switched to external reference"); LOG_INFO("Switched to external reference");
FPGA::Enable(FPGA::Periphery::ExtRefLED); FPGA::Enable(FPGA::Periphery::ExtRefLED);
} else { } else {
Si5351.SetPLL(Si5351C::PLL::A, 800000000, Si5351C::PLLSource::XTAL); Si5351.SetPLL(Si5351C::PLL::A, 832000000, Si5351C::PLLSource::XTAL);
Si5351.SetPLL(Si5351C::PLL::B, 800000000, Si5351C::PLLSource::XTAL); Si5351.SetPLL(Si5351C::PLL::B, 832000000, Si5351C::PLLSource::XTAL);
LOG_INFO("Switched to internal reference"); LOG_INFO("Switched to internal reference");
FPGA::Disable(FPGA::Periphery::ExtRefLED); FPGA::Disable(FPGA::Periphery::ExtRefLED);
} }