From 62b872ad944280565eedd0255dfe729435899593 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 18 Aug 2014 23:53:10 +0800 Subject: [PATCH] devices/dds_core: use new compiler features to compute tuning word trivially --- artiq/devices/dds_core.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/artiq/devices/dds_core.py b/artiq/devices/dds_core.py index d380f2edf..8c0c66180 100644 --- a/artiq/devices/dds_core.py +++ b/artiq/devices/dds_core.py @@ -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)