Skip to content

Commit 235d355

Browse files
committed
Failsafe configuration of digital input SAMPLE_PERIOD
- If the user specifies a null value for the SampleRate, 0 is written to the SAMPLE_PERIOD register instead of relying on reset to do this automatically
1 parent 2622d65 commit 235d355

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

OpenEphys.Onix1/ConfigureDigitalIO.cs

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

117117
if (sr is not null)
118118
{
119-
120119
var periodTicks = (uint)(baseFreqHz / sr);
121120
device.WriteRegister(DigitalIO.SAMPLE_PERIOD, periodTicks);
121+
} else
122+
{
123+
device.WriteRegister(DigitalIO.SAMPLE_PERIOD, 0);
122124
}
123125

124126
return DeviceManager.RegisterDevice(deviceName, device, DeviceType);

0 commit comments

Comments
 (0)