@@ -20,6 +20,7 @@ public class Thunderscope : IThunderscope
2020
2121 uint cachedSampleRateHz = 1_000_000_000 ;
2222 AdcResolution cachedSampleResolution = AdcResolution . EightBit ;
23+ AdcChannelMode cachedAdcChannelMode = AdcChannelMode . Single ;
2324
2425 private bool beta = false ;
2526
@@ -190,8 +191,7 @@ public bool TryRead(ThunderscopeMemory data, out ulong sampleStartIndex, out int
190191 else if ( readLen != data . LengthBytes )
191192 throw new ThunderscopeException ( $ "Read incorrect sample length ({ readLen } )") ;
192193
193- var hardwareConfig = GetConfiguration ( ) ; // to do: remove this
194- sampleLengthPerChannel = hardwareConfig . Acquisition . AdcChannelMode switch
194+ sampleLengthPerChannel = cachedAdcChannelMode switch
195195 {
196196 AdcChannelMode . Single => data . LengthBytes ,
197197 AdcChannelMode . Dual => data . LengthBytes / 2 ,
@@ -304,6 +304,7 @@ private ThunderscopeAcquisitionConfig GetAcquisitionConfig()
304304 GetStatus ( ) ;
305305 acquisitionConfig . SampleRateHz = cachedSampleRateHz ;
306306 acquisitionConfig . Resolution = cachedSampleResolution ;
307+ cachedAdcChannelMode = acquisitionConfig . AdcChannelMode ;
307308 return acquisitionConfig ;
308309 }
309310
@@ -665,6 +666,8 @@ private void SetChannelEnable(int channelIndex, bool enabled, bool updateFronten
665666 // There is a channel-count vs. scale relationship so update frontends
666667 if ( updateFrontends )
667668 UpdateFrontends ( ) ;
669+
670+ GetAcquisitionConfig ( ) ; // Update cachedAdcChannelMode
668671 }
669672
670673 public void SetChannelManualControl ( int channelIndex , ThunderscopeChannelFrontendManualControl channel )
0 commit comments