Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
Conv TTL Blocking
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
5
Issues
5
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Conv TTL Blocking
Commits
92cca543
Commit
92cca543
authored
Jan 26, 2015
by
Theodor-Adrian Stana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw: Updated getsr.py script to account for BLO and RS485 pulse repeaters
parent
91452d32
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
getsr.py
software/diag/getsr.py
+17
-6
No files found.
software/diag/getsr.py
View file @
92cca543
...
...
@@ -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
%08
x"
%
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
%02
x"
%
rtm
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment