forked from M-Labs/artiq
devices/dds_core: use new compiler features to compute tuning word trivially
This commit is contained in:
parent
7a90f4f4ec
commit
62b872ad94
|
@ -13,8 +13,7 @@ class DDS(AutoContext):
|
|||
def pulse(self, frequency, duration):
|
||||
if self._previous_frequency != frequency:
|
||||
syscall("rtio_sync", self.rtio_channel) # wait until output is off
|
||||
syscall("dds_program", self.reg_channel,
|
||||
(frequency << 2)//(self.dds_sysclk >> 15) << 15)
|
||||
syscall("dds_program", self.reg_channel, int(2**32*frequency/self.dds_sysclk))
|
||||
self._previous_frequency = frequency
|
||||
syscall("rtio_set", now(), self.rtio_channel, 1)
|
||||
delay(duration)
|
||||
|
|
Loading…
Reference in New Issue