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
6ed3a883
Commit
6ed3a883
authored
Oct 24, 2014
by
Theodor-Adrian Stana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw: Fixed bug in therm.py and added support for old gw versions
parent
aa15ee48
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
therm.py
software/diag/therm.py
+12
-4
No files found.
software/diag/therm.py
View file @
6ed3a883
...
@@ -225,8 +225,8 @@ if __name__ == "__main__":
...
@@ -225,8 +225,8 @@ if __name__ == "__main__":
ip
=
ei2cdefine
.
HNAME
ip
=
ei2cdefine
.
HNAME
user
=
ei2cdefine
.
USER
user
=
ei2cdefine
.
USER
pwd
=
ei2cdefine
.
PWD
pwd
=
ei2cdefine
.
PWD
test
elma
=
EI2C
(
ip
,
user
,
pwd
)
elma
=
EI2C
(
ip
,
user
,
pwd
)
test
elma
.
open
()
elma
.
open
()
# Ask for slot number
# Ask for slot number
while
1
:
while
1
:
...
@@ -243,8 +243,16 @@ if __name__ == "__main__":
...
@@ -243,8 +243,16 @@ if __name__ == "__main__":
except
:
except
:
print
(
"Unexpected error: "
,
sys
.
exc_info
()[
0
])
print
(
"Unexpected error: "
,
sys
.
exc_info
()[
0
])
# CONV-TTL-BLO gateware changed memory map in v3.0 and golden v0.2
boardid
=
elma
.
read
(
slot
,
0x00
)
gwvers
=
elma
.
read
(
slot
,
0x04
)
&
0xff
baseaddr
=
0x200
if
(
boardid
==
0x54424c4f
):
if
((
gwvers
>
0x10
)
and
(
gwvers
<
0x30
)):
baseaddr
=
0x080
# Create onewire and thermometer objects
# Create onewire and thermometer objects
onewire
=
COpenCoresOneWire
(
testelma
,
1
,
0x200
,
99
,
19
)
onewire
=
COpenCoresOneWire
(
elma
,
slot
,
baseaddr
,
99
,
19
)
ds18b20
=
CDS18B20
(
onewire
,
0
)
ds18b20
=
CDS18B20
(
onewire
,
0
)
# Reading of unique ID
# Reading of unique ID
...
@@ -269,5 +277,5 @@ if __name__ == "__main__":
...
@@ -269,5 +277,5 @@ if __name__ == "__main__":
msg
=
"ERROR: TempID IC20: Invalid family code: 0x
%.8
X"
%
(
family_code
)
msg
=
"ERROR: TempID IC20: Invalid family code: 0x
%.8
X"
%
(
family_code
)
print
(
msg
)
print
(
msg
)
test
elma
.
close
()
elma
.
close
()
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