Skip to content

Commit

Permalink
Update active port method for corrected gpio polarity.
Browse files Browse the repository at this point in the history
  • Loading branch information
moslehu committed Jul 30, 2024
1 parent 5316c74 commit fe5e0b0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions adi/fmc_4p_vna_cst2.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def __init__(self, uri):

@property
def active_port(self) -> str:
# assume the enabled LED designates the active port
""" Return the active port """
return self.rfin_mux.select


Expand All @@ -91,12 +91,12 @@ def active_port(self, port: str) -> None:
""" Configure all dependencies to enable port """
# disable all other ports and enable only active port
for i in range(0, NUM_PORTS):
enabled_n = 1
enabled = 0
cur_port = f"d{i+1}"
if port == cur_port:
enabled_n = 0
enabled = 1

setattr(self.port_rfin_en, f"gpio_{cur_port}", enabled_n)
setattr(self.port_rfin_en, f"gpio_{cur_port}", enabled)

self.rfin_mux.select = port

0 comments on commit fe5e0b0

Please sign in to comment.