Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions scopehal/SiglentFunctionGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,10 @@ float SiglentFunctionGenerator::GetFunctionChannelFrequency(int chan)

void SiglentFunctionGenerator::SetFunctionChannelFrequency(int chan, float hz)
{
if(m_cachedFrequencyValid[chan] && std::abs(m_cachedFrequency[chan] - hz) < 1e-6)
{
return;
}
m_transport->SendCommandQueued(m_channels[chan]->GetHwname() + ":BSWV FRQ," + to_string(hz));

m_cachedFrequency[chan] = hz;
Expand Down
2 changes: 1 addition & 1 deletion scopehal/SiglentFunctionGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class SiglentFunctionGenerator : public virtual SCPIFunctionGenerator

//Config cache
bool m_cachedFrequencyValid[2];
int64_t m_cachedFrequency[2];
float m_cachedFrequency[2];
bool m_cachedEnableStateValid[2];
bool m_cachedOutputEnable[2];
bool m_cachedAmplitudeValid[2];
Expand Down