Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
scouting-demonstrator
SCONE
Commits
a684f56f
Commit
a684f56f
authored
Dec 07, 2020
by
Gaia Grosso
Browse files
Update main.py
parent
2f00c430
Changes
1
Hide whitespace changes
Inline
Side-by-side
main.py
View file @
a684f56f
...
...
@@ -107,10 +107,10 @@ if __name__ == '__main__':
args
=
parser
.
parse_args
()
board
=
args
.
board
prop
erty
=
args
.
property
prop
=
args
.
property
device
=
config_dict
[
board
][
"driver"
]
location
=
config_dict
[
board
][
"property"
][
prop
erty
][
"location"
]
bitmask
=
config_dict
[
board
][
"property"
][
prop
erty
][
"bitmask"
]
location
=
config_dict
[
board
][
"property"
][
prop
][
"location"
]
bitmask
=
config_dict
[
board
][
"property"
][
prop
][
"bitmask"
]
action
=
args
.
action
value
=
args
.
value
if
action
==
"set"
:
...
...
@@ -125,8 +125,11 @@ if __name__ == '__main__':
print
(
"Overflow error! value %s doesn't fit in the allowed memory location."
%
(
args
.
value
))
exit
()
else
:
WriteProperty
(
device
,
location
,
bitmask
,
writevalue
)
print
(
'Set property %s from location %s on %s: %i'
%
(
property
,
location
,
board
,
writevalue
.
value
))
isWritten
=
WriteProperty
(
device
,
location
,
bitmask
,
writevalue
)
if
is
Written
:
print
(
'Set property %s from location %s on %s: %i'
%
(
property
,
location
,
board
,
writevalue
.
value
))
else
:
print
(
'The value could not be updated. Check the reading permission for property %s in board %s'
%
(
prop
,
board
))
elif
action
==
"get"
:
readvalue
=
ReadProperty
(
device
,
location
,
bitmask
)
...
...
Write
Preview
Supports
Markdown
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