From a303293e8f8a6e308d71ee39cc517afa74acf0ad Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 13 Oct 2014 23:58:32 +0800 Subject: [PATCH] devices/dds_core: fix merging of back-to-back pulses of different frequencies --- artiq/devices/dds_core.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/artiq/devices/dds_core.py b/artiq/devices/dds_core.py index 5b7fba720..f5bb2c293 100644 --- a/artiq/devices/dds_core.py +++ b/artiq/devices/dds_core.py @@ -50,9 +50,10 @@ class DDS(AutoContext): """ if self.previous_frequency != frequency: - if self.sw.previous_timestamp != time_to_cycles(now()): + merge = self.sw.previous_timestamp == time_to_cycles(now()) + if not merge: self.sw.sync() - if self.sw.previous_value: + if merge or bool(self.sw.previous_value): # Channel is already on. # Precise timing of frequency change is required. fud_time = time_to_cycles(now())