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,7 +11,8 @@ class LiteScopeEtherboneDriver:
self.tx_sock = None
self.rx_sock = None
self.regs = build_map(addrmap, busword, self.read, self.write)
if addrmap is not None:
self.regs = build_map(addrmap, busword, self.read, self.write)
def open(self):
self.tx_sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

View File

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