litescope/drivers: do not build regs when addrmap is None
This commit is contained in:
parent
a266deb58e
commit
70f1f96fda
|
@ -11,7 +11,8 @@ class LiteScopeEtherboneDriver:
|
||||||
|
|
||||||
self.tx_sock = None
|
self.tx_sock = None
|
||||||
self.rx_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):
|
def open(self):
|
||||||
self.tx_sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
self.tx_sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||||
|
|
|
@ -15,7 +15,8 @@ class LiteScopeUARTDriver:
|
||||||
self.baudrate = str(baudrate)
|
self.baudrate = str(baudrate)
|
||||||
self.debug = debug
|
self.debug = debug
|
||||||
self.uart = serial.Serial(port, baudrate, timeout=0.25)
|
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):
|
def open(self):
|
||||||
self.uart.flushOutput()
|
self.uart.flushOutput()
|
||||||
|
|
Loading…
Reference in New Issue