Skip to content

Commit

Permalink
ad9xxx: fix gpio signal length
Browse files Browse the repository at this point in the history
  • Loading branch information
sbourdeauducq committed Aug 22, 2015
1 parent fba0553 commit d38f1e6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion artiq/gateware/ad9xxx.py
Expand Up @@ -55,7 +55,11 @@ def __init__(self, pads,
dts.oe.eq(~rx)
]

gpio = Signal(flen(pads.sel) + 1)
if hasattr(pads, "sel"):
sel_len = flen(pads.sel)
else:
sel_len = flen(pads.sel_n)
gpio = Signal(sel_len + 1)
gpio_load = Signal()
self.sync += If(gpio_load, gpio.eq(bus.dat_w))
if hasattr(pads, "rst"):
Expand Down

0 comments on commit d38f1e6

Please sign in to comment.