implement sweep standby configuration

This commit is contained in:
Andre Dunford 2022-12-16 23:41:59 -08:00
parent e35766c7b8
commit 08fa3fa0a0
5 changed files with 32 additions and 6 deletions

View file

@ -258,12 +258,26 @@ bool VNA::Setup(Protocol::SweepSettings s) {
// Enable new data and sweep halt interrupt
FPGA::EnableInterrupt(FPGA::Interrupt::NewData);
FPGA::EnableInterrupt(FPGA::Interrupt::SweepHalted);
// Start the sweep
// Start the sweep if not configured for standby
firstPoint = true;
FPGA::StartSweep();
if(!settings.standby){
FPGA::StartSweep();
}
return true;
}
void VNA::InitiateSweep() {
// Invoked by a host via InitiateSweep packet
if(settings.standby){
// make sure that SweepSettings have been configured for standby operation
FPGA::StartSweep();
}
}
bool VNA::GetStandbyMode() {
return settings.standby;
}
static void PassOnData() {
Protocol::PacketInfo info;
info.type = Protocol::PacketType::VNADatapoint;
@ -330,8 +344,11 @@ void VNA::Work() {
Communication::Send(packet);
}
// do not reset unlevel flag here, as it is calculated only once at the setup of the sweep
// Start next sweep
FPGA::StartSweep();
// Start next sweep if not configured for standby
if (!settings.standby){
FPGA::StartSweep();
}
}
void VNA::SweepHalted() {