Skip to content

Commit 34436d5

Browse files
committed
Move generate_code break if no channels are connected earlier in the function
1 parent 9854b3c commit 34436d5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

labscript_devices/AD9959DDSSweeper/labscript_devices.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ def generate_code(self, hdf5_file):
237237
elif isinstance(output, StaticDDS):
238238
stat_DDSs[channel] = output
239239

240+
# if no channels are being used, no need to continue
241+
if not dyn_DDSs and not stat_DDSs:
242+
return
243+
240244
for connection in dyn_DDSs:
241245
dds = dyn_DDSs[connection]
242246
dds.frequency.raw_output = self.quantise_freq(dds.frequency.raw_output, dds)
@@ -269,10 +273,6 @@ def generate_code(self, hdf5_file):
269273
static_table['freq%d' % connection] = sdds.frequency.raw_output[0]
270274
static_table['amp%d' % connection] = sdds.amplitude.raw_output[0]
271275
static_table['phase%d' % connection] = sdds.phase.raw_output[0]
272-
273-
# if no channels are being used, no need to continue
274-
if not dyn_DDSs and not stat_DDSs:
275-
return
276276

277277
# write out data tables
278278
grp = self.init_device_group(hdf5_file)

0 commit comments

Comments
 (0)