Commit daa8e9aa authored by Arnaud WATLET's avatar Arnaud WATLET
Browse files

Tries enabling switch_pwr during injection for polarity 0 on pwr_batt and pwr_dps5005_fixed

Showing with 5 additions and 3 deletions
+5 -3
......@@ -138,19 +138,19 @@ class Tx(Tx_mb_2023):
assert polarity in [-1, 0, 1]
self._polarity = polarity
if polarity == 1:
if self.pwr.voltage_adjustable:
if not self.pwr.voltage_adjustable:
self.pwr_state = 'on'
self.pin0.value = True
self.pin1.value = False
time.sleep(self._activation_delay)
elif polarity == -1:
if self.pwr.voltage_adjustable:
if not self.pwr.voltage_adjustable:
self.pwr_state = 'on'
self.pin0.value = False
self.pin1.value = True
time.sleep(self._activation_delay)
else:
if self.pwr.voltage_adjustable:
if not self.pwr.voltage_adjustable:
self.pwr_state = 'off'
self.pin0.value = False
self.pin1.value = False
......
......@@ -137,6 +137,8 @@ class OhmPiHardware:
if isinstance(self.tx, dict):
self.tx = tx_module.Tx(**self.tx)
self.tx.pwr = self.pwr
if not self.tx.pwr.voltage_adjustable:
self.tx._pwr_latency = 0
self.tx.polarity = 0
self.tx.pwr._current_max = current_max
......
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