From d07c6fcfeac48c2f9ffa44b8726100ce27387925 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 22 Mar 2019 14:28:22 +0800 Subject: [PATCH] ad9910: handle unprogrammed EEPROM and numpy corner cases --- artiq/coredevice/ad9910.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/artiq/coredevice/ad9910.py b/artiq/coredevice/ad9910.py index 38bc4ce43..2ef65ae8e 100644 --- a/artiq/coredevice/ad9910.py +++ b/artiq/coredevice/ad9910.py @@ -141,7 +141,10 @@ class AD9910: io_update_delay = word & 0xff else: io_update_delay = 0 - return device, offset, sync_delay_seed, io_update_delay + if io_update_delay == 0xff: # unprogrammed EEPROM + io_update_delay = 0 + # With Numpy, type(int32(-1) >> 1) == int64 + return device, offset, int32(sync_delay_seed), int32(io_update_delay) if isinstance(sync_delay_seed, str): self.sync_delay_seed_eeprom, self.sync_delay_seed_offset, sync_delay_seed, _ = \