tester: handle urukul switch differences

This commit is contained in:
Robert Jördens 2019-06-14 10:54:00 +00:00
parent 6655e567df
commit 53789ba9aa
1 changed files with 9 additions and 5 deletions

View File

@ -209,10 +209,12 @@ class KasliTester(EnvExperiment):
channel.set_att(6.) channel.set_att(6.)
@kernel @kernel
def rf_switch_wave(self, channels): def cfg_sw_off_urukul(self, channel):
self.core.break_realtime() self.core.break_realtime()
for channel in channels: channel.cfg_sw(0)
channel.cfg_sw(0)
@kernel
def rf_switch_wave(self, channels):
while not is_enter_pressed(): while not is_enter_pressed():
self.core.break_realtime() self.core.break_realtime()
# do not fill the FIFOs too much to avoid long response times # do not fill the FIFOs too much to avoid long response times
@ -260,10 +262,12 @@ class KasliTester(EnvExperiment):
print("Press ENTER when done.") print("Press ENTER when done.")
input() input()
sw = [channel_dev.sw for channel_name, channel_dev in self.urukuls if hasattr(channel_dev, "sw")] sw = [channel_dev for channel_name, channel_dev in self.urukuls if hasattr(channel_dev, "sw")]
if sw: if sw:
print("Testing RF switch control. Press ENTER when done.") print("Testing RF switch control. Press ENTER when done.")
self.rf_switch_wave(sw) for swi in sw:
self.cfg_sw_off_urukul(swi)
self.rf_switch_wave([swi.sw for swi in sw])
@kernel @kernel
def get_sampler_voltages(self, sampler, cb): def get_sampler_voltages(self, sampler, cb):