Bugfix: only enable highband source once per sweep
This commit is contained in:
parent
c1f131b6d7
commit
d32f7a61ee
@ -137,6 +137,14 @@ void FPGA::Disable(Periphery p) {
|
|||||||
WriteRegister(Reg::SystemControl, SysCtrlReg);
|
WriteRegister(Reg::SystemControl, SysCtrlReg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool FPGA::IsEnabled(Periphery p) {
|
||||||
|
if(SysCtrlReg & (uint16_t) p) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void FPGA::SetWindow(Window w) {
|
void FPGA::SetWindow(Window w) {
|
||||||
SysCtrlReg &= ~0x0060;
|
SysCtrlReg &= ~0x0060;
|
||||||
SysCtrlReg |= (int) w << 5;
|
SysCtrlReg |= (int) w << 5;
|
||||||
|
@ -103,6 +103,7 @@ void SetNumberOfPoints(uint16_t npoints);
|
|||||||
void SetSamplesPerPoint(uint32_t nsamples);
|
void SetSamplesPerPoint(uint32_t nsamples);
|
||||||
void Enable(Periphery p, bool enable = true);
|
void Enable(Periphery p, bool enable = true);
|
||||||
void Disable(Periphery p);
|
void Disable(Periphery p);
|
||||||
|
bool IsEnabled(Periphery p);
|
||||||
void SetWindow(Window w);
|
void SetWindow(Window w);
|
||||||
void EnableInterrupt(Interrupt i);
|
void EnableInterrupt(Interrupt i);
|
||||||
void DisableInterrupt(Interrupt i);
|
void DisableInterrupt(Interrupt i);
|
||||||
|
@ -259,7 +259,7 @@ void VNA::SweepHalted() {
|
|||||||
Si5351.Enable(SiChannel::LowbandSource);
|
Si5351.Enable(SiChannel::LowbandSource);
|
||||||
FPGA::Disable(FPGA::Periphery::SourceRF);
|
FPGA::Disable(FPGA::Periphery::SourceRF);
|
||||||
}
|
}
|
||||||
} else {
|
} else if(!FPGA::IsEnabled(FPGA::Periphery::SourceRF)){
|
||||||
// first sweep point in highband is also halted, disable lowband source
|
// first sweep point in highband is also halted, disable lowband source
|
||||||
Si5351.Disable(SiChannel::LowbandSource);
|
Si5351.Disable(SiChannel::LowbandSource);
|
||||||
FPGA::Enable(FPGA::Periphery::SourceRF);
|
FPGA::Enable(FPGA::Periphery::SourceRF);
|
||||||
|
Loading…
Reference in New Issue
Block a user