Commit b19e65b8 authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Modifies the way a controller is used by defining several connections and...

Modifies the way a controller is used by defining several connections and adding an io to components
Showing with 2 additions and 2 deletions
+2 -2
......@@ -96,7 +96,7 @@ class Tx(TxAbstract):
self.ctl = ctl_module.Ctl()
# elif isinstance(self.ctl, dict):
# self.ctl = ctl_module.Ctl(**self.ctl)
self.io = self.ctl[kwargs.pop('connection', ctl_connection)]
self.io = self.ctl.connections[kwargs.pop('connection', ctl_connection)]
# I2C connexion to MCP23008, for current injection
self.mcp_board = MCP23008(self.io, address=TX_CONFIG['mcp_board_address'])
......@@ -228,7 +228,7 @@ class Rx(RxAbstract):
self.exec_logger.event(f'{self.board_name}\trx_init\tbegin\t{datetime.datetime.utcnow()}')
if self.ctl is None:
self.ctl = ctl_module.Ctl()
self.io = self.ctl[kwargs.pop('connection', ctl_connection)]
self.io = self.ctl.connections[kwargs.pop('connection', ctl_connection)]
# ADS1115 for voltage measurement (MN)
self._ads_voltage_address = 0x49
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment