Skip to content

Commit 58a018f

Browse files
committed
Account for two tick delay in sample counter on DigitalIO device
- This is known issue in version 2 of the DigitalIO device. This correction results in the digital sampling rate matching the value specified by SampleRate
1 parent 2e0f059 commit 58a018f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

OpenEphys.Onix1/ConfigureDigitalIO.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public override IObservable<ContextTask> Process(IObservable<ContextTask> source
116116

117117
if (sr is not null)
118118
{
119-
var periodTicks = (uint)(baseFreqHz / sr);
119+
var periodTicks = (uint)(baseFreqHz / sr) - 2; // NB: -2 results from known issue in version 2 of DigitalIO device
120120
device.WriteRegister(DigitalIO.SAMPLE_PERIOD, periodTicks);
121121
} else
122122
{

0 commit comments

Comments
 (0)