Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
Production Test Suite
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
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
Production Test Suite
Commits
b8e4bbf2
Commit
b8e4bbf2
authored
Jul 15, 2011
by
Samuel Iglesias Gonsalvez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tps/test: test00 change the printed values to the real ones
parent
5fcb80b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
test00.py
test/spec/python/test00.py
+14
-9
No files found.
test/spec/python/test00.py
View file @
b8e4bbf2
...
...
@@ -137,6 +137,11 @@ class ADC_AD7997:
def
adc_value
(
value
)
:
return
str
(
2.495
*
(
0x3FF
&
(
value
>>
2
))
/
1024
);
# 10 bits
def
adc_convert_to_real_value
(
nr_value
,
value
)
:
ratio
=
{
'8'
:
0.6666
,
'7'
:
0.1666
,
'6'
:
0.52381
};
return
str
(
float
(
value
)
/
ratio
[
str
(
nr_value
)])
def
main
(
default_directory
=
'.'
):
...
...
@@ -166,17 +171,17 @@ def main (default_directory='.'):
value1
=
adc_value
(
adc
.
rd_reg16
(
0x80
));
# Check the values of the ADC.
if
(
float
(
value8
)
<
1.
61
)
or
(
float
(
value8
)
>
1.73
)
:
raise
TpsError
(
"Error in VS_VADJ
, value x="
+
value8
+
". x > 1.73 V or x < 1.61 V"
)
print
"VS_VADJ = "
+
value8
if
(
float
(
value8
)
<
1.
58
)
or
(
float
(
value8
)
>
1.75
)
:
raise
TpsError
(
"Error in VS_VADJ
(2.5V) measured "
+
adc_convert_to_real_value
(
8
,
value8
)
+
"V."
)
print
"VS_VADJ = "
+
adc_convert_to_real_value
(
8
,
value8
)
if
(
float
(
value7
)
<
1.
90
)
or
(
float
(
value7
)
>
2.11
):
raise
TpsError
(
"Error in VS_P12V_x
, value x="
+
value7
+
". x< 1.90 V or x > 2.11 V"
)
print
"VS_P12V_x = "
+
value7
if
(
float
(
value7
)
<
1.
88
)
or
(
float
(
value7
)
>
2.13
):
raise
TpsError
(
"Error in VS_P12V_x
(12V) measured "
+
adc_convert_to_real_value
(
7
,
value7
)
+
"V."
)
print
"VS_P12V_x = "
+
adc_convert_to_real_value
(
7
,
value7
)
if
(
float
(
value6
)
<
1.6
6
)
or
(
float
(
value6
)
>
1.80
):
raise
TpsError
(
"Error in VS_P3V3_x
, value x="
+
value6
+
". x < 1.66 V or x > 1.80 V"
)
print
"VS_P3V3_x = "
+
value6
if
(
float
(
value6
)
<
1.6
4
)
or
(
float
(
value6
)
>
1.82
):
raise
TpsError
(
"Error in VS_P3V3_x
(3.3V) measured "
+
adc_convert_to_real_value
(
6
,
value6
)
+
"V."
)
print
"VS_P3V3_x = "
+
adc_convert_to_real_value
(
6
,
value6
)
if
__name__
==
'__main__'
:
main
();
...
...
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