litescope/drivers: do not build regs when addrmap is None

This commit is contained in:
Florent Kermarrec 2015-03-17 16:04:07 +01:00
parent a266deb58e
commit 70f1f96fda
2 changed files with 4 additions and 2 deletions

View File

@ -11,6 +11,7 @@ class LiteScopeEtherboneDriver:
self.tx_sock = None
self.rx_sock = None
if addrmap is not None:
self.regs = build_map(addrmap, busword, self.read, self.write)
def open(self):

View File

@ -15,6 +15,7 @@ class LiteScopeUARTDriver:
self.baudrate = str(baudrate)
self.debug = debug
self.uart = serial.Serial(port, baudrate, timeout=0.25)
if addrmap is not None:
self.regs = build_map(addrmap, busword, self.read, self.write)
def open(self):