forked from M-Labs/artiq
1
0
Fork 0

ad9910: handle unprogrammed EEPROM and numpy corner cases

This commit is contained in:
Sebastien Bourdeauducq 2019-03-22 14:28:22 +08:00
parent 7cdcaf0d00
commit d07c6fcfea
1 changed files with 4 additions and 1 deletions

View File

@ -141,7 +141,10 @@ class AD9910:
io_update_delay = word & 0xff io_update_delay = word & 0xff
else: else:
io_update_delay = 0 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): if isinstance(sync_delay_seed, str):
self.sync_delay_seed_eeprom, self.sync_delay_seed_offset, sync_delay_seed, _ = \ self.sync_delay_seed_eeprom, self.sync_delay_seed_offset, sync_delay_seed, _ = \