From 2197d511816e2e00dc40f913232dac35978c20f6 Mon Sep 17 00:00:00 2001
From: Arnaud Watlet <arnaud.watlet@umons.ac.be>
Date: Tue, 12 Dec 2023 15:24:14 +0100
Subject: [PATCH] Tries enabling switch_pwr during injection for polarity 0 on
 pwr_batt and pwr_dps5005_fixed

---
 ohmpi/hardware_components/mb_2023_0_X.py | 2 +-
 ohmpi/hardware_system.py                 | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/ohmpi/hardware_components/mb_2023_0_X.py b/ohmpi/hardware_components/mb_2023_0_X.py
index 4fe1c0b6..7055be06 100644
--- a/ohmpi/hardware_components/mb_2023_0_X.py
+++ b/ohmpi/hardware_components/mb_2023_0_X.py
@@ -105,7 +105,7 @@ class Tx(TxAbstract):
         self.pin0.direction = Direction.OUTPUT
         self.pin1 = self.mcp_board.get_pin(1)
         self.pin1.direction = Direction.OUTPUT
-        self.polarity = 0
+        #self.polarity = 0
         self.gain = 2 / 3
         if not subclass_init:
             self.exec_logger.event(f'{self.model}\ttx_init\tend\t{datetime.datetime.utcnow()}')
diff --git a/ohmpi/hardware_system.py b/ohmpi/hardware_system.py
index 634e3b8c..b26dbf99 100644
--- a/ohmpi/hardware_system.py
+++ b/ohmpi/hardware_system.py
@@ -137,6 +137,7 @@ class OhmPiHardware:
         if isinstance(self.tx, dict):
             self.tx = tx_module.Tx(**self.tx)
         self.tx.pwr = self.pwr
+        self.tx.polarity = 0
         self.tx.pwr._current_max = current_max
 
         # Initialize Muxes
-- 
GitLab