Commit 92cca543 authored by Theodor-Adrian Stana's avatar Theodor-Adrian Stana

sw: Updated getsr.py script to account for BLO and RS485 pulse repeaters

parent 91452d32
......@@ -40,10 +40,16 @@ import ei2cdefine
if __name__ == "__main__":
# Get the IP, user and password for the ELMA crate from ei2cdefine.py
ip = ei2cdefine.HNAME
user = ei2cdefine.USER
pwd = ei2cdefine.PWD
# Get the IP, user and password for the ELMA crate from either user input,
# or ei2cdefine.py
if (ei2cdefine.ENABLED):
ip = ei2cdefine.HNAME
user = ei2cdefine.USER
pwd = ei2cdefine.PWD
else:
ip = raw_input("ELMA crate IP or hostname : ")
user = raw_input("ELMA crate user name : ")
pwd = raw_input("ELMA crate password : ")
testelma = EI2C(ip, user, pwd)
testelma.open()
......@@ -62,6 +68,9 @@ if __name__ == "__main__":
except:
print("Unexpected error: ", sys.exc_info()[0])
# Print which board is detected in the selected slot
bid = testelma.get_bid(slot)
# Get status register value and print
v = testelma.read(slot, 0x4)
print("Status register : 0x%08x" % v)
......@@ -79,7 +88,8 @@ if __name__ == "__main__":
# Negate in case g/w version is less than 3.0, or golden less than 0.2.
# Gateware versions below these two had the switches active-low.
# This negation is done to allow correct printing of ON or OFF states.
if ((maj == 0) and (min < 2)) or (maj < 3):
if ((bid == "TBLO") and
(((maj == 0) and (min < 2)) or (maj < 3))):
switches ^= 0xff
if (switches & 0x80):
print(" TTL repetition : on")
......@@ -94,7 +104,8 @@ if __name__ == "__main__":
rtm = (v & 0x3f0000) >> 16
rtmm = rtm & 0x7
rtmp = (rtm & 0x3f) >> 3
if ((maj == 0) and (min < 2)) or (maj < 3):
if ((bid == "TBLO") and
(((maj == 0) and (min < 2)) or (maj < 3))):
print("-------------------------------")
print("Note: negated w.r.t. latest user guide version")
print("RTM detection : 0x%02x" % rtm)
......
Markdown is supported
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