diff --git a/scopehal/SiglentFunctionGenerator.cpp b/scopehal/SiglentFunctionGenerator.cpp index 765fd30a..b4c85646 100644 --- a/scopehal/SiglentFunctionGenerator.cpp +++ b/scopehal/SiglentFunctionGenerator.cpp @@ -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; diff --git a/scopehal/SiglentFunctionGenerator.h b/scopehal/SiglentFunctionGenerator.h index 2a8e3d88..e358fdce 100644 --- a/scopehal/SiglentFunctionGenerator.h +++ b/scopehal/SiglentFunctionGenerator.h @@ -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];