From 0838981bed97c0b7bd137771c29814817cf0a933 Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Fri, 7 Apr 2017 23:45:46 +0200 Subject: [PATCH] coredevice.spi: kernel invariants and style --- artiq/coredevice/spi.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/artiq/coredevice/spi.py b/artiq/coredevice/spi.py index 65943533f..69e80ab54 100644 --- a/artiq/coredevice/spi.py +++ b/artiq/coredevice/spi.py @@ -56,9 +56,14 @@ class SPIMaster: :param channel: RTIO channel number of the SPI bus to control. """ + + kernel_invariants = {"core", "ref_period_mu", "channel"} + def __init__(self, dmgr, channel, core_device="core"): self.core = dmgr.get(core_device) - self.ref_period_mu = self.core.seconds_to_mu(self.core.coarse_ref_period) + self.ref_period_mu = self.core.seconds_to_mu( + self.core.coarse_ref_period) + assert self.ref_period_mu == self.core.ref_multiplier self.channel = channel self.write_period_mu = numpy.int64(0) self.read_period_mu = numpy.int64(0)