Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PyPCC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
PyPCC
Commits
9a103ea6
Commit
9a103ea6
authored
4 years ago
by
Paulus Kruger
Browse files
Options
Downloads
Patches
Plain Diff
CLK SPIbb bug
parent
529b39e7
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!10
Pypcc2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
clk/CLK.py
+14
-5
14 additions, 5 deletions
clk/CLK.py
pypcc2.py
+5
-5
5 additions, 5 deletions
pypcc2.py
with
19 additions
and
10 deletions
clk/CLK.py
+
14
−
5
View file @
9a103ea6
...
@@ -124,7 +124,7 @@ class RCU1():
...
@@ -124,7 +124,7 @@ class RCU1():
Mask
=
Mask
.
OPCW
.
get_value
()
Mask
=
Mask
.
OPCW
.
get_value
()
value1
=
strs2bytes
(
Instr
.
value
)
if
V1
.
OPCR
is
None
else
strs2bytes
(
V1
.
OPCR
.
get_value
())
value1
=
strs2bytes
(
Instr
.
value
)
if
V1
.
OPCR
is
None
else
strs2bytes
(
V1
.
OPCR
.
get_value
())
if
(
len
(
value1
)
==
V1
.
nVars
)
and
(
self
.
N
>
1
):
value1
=
(
value1
*
self
.
N
);
if
(
len
(
value1
)
==
V1
.
nVars
)
and
(
self
.
N
>
1
):
value1
=
(
value1
*
self
.
N
);
if
(
Instr
.
type
==
Vars
.
DevType
.
Var
)
or
((
self
.
N
==
1
)
and
(
Instr
.
type
==
Vars
.
DevType
.
VarUpdate
))
:
if
(
Instr
.
type
==
Vars
.
DevType
.
Var
):
logging
.
info
(
str
((
'
** Set Var:
'
,
V1
.
name
,
value1
)))
logging
.
info
(
str
((
'
** Set Var:
'
,
V1
.
name
,
value1
)))
for
RCUi
in
range
(
self
.
N
):
for
RCUi
in
range
(
self
.
N
):
for
Vari
in
range
(
Step
):
for
Vari
in
range
(
Step
):
...
@@ -138,6 +138,15 @@ class RCU1():
...
@@ -138,6 +138,15 @@ class RCU1():
if
not
(
V1
.
OPCR
is
None
):
V1
.
OPCR
.
set_value
(
bytes2strs
(
value1
,
Step2
,
V1
.
type
))
if
not
(
V1
.
OPCR
is
None
):
V1
.
OPCR
.
set_value
(
bytes2strs
(
value1
,
Step2
,
V1
.
type
))
elif
Instr
.
type
==
Vars
.
DevType
.
VarUpdate
:
elif
Instr
.
type
==
Vars
.
DevType
.
VarUpdate
:
if
self
.
N
==
1
:
for
Vari
in
range
(
Step
):
i0
=
(
Vari
)
*
Step2
i1
=
(
Vari
+
1
)
*
Step2
value2
=
value1
[
i0
:
i1
]
self
.
GetVarValue
(
0
,
V1
.
Vars
[
Vari
],
value2
)
value1
[
i0
:
i1
]
=
value2
if
not
(
V1
.
OPCR
is
None
):
V1
.
OPCR
.
set_value
(
bytes2strs
(
value1
,
Step2
,
V1
.
type
))
else
:
self
.
GetVarValueAll
(
V1
,
value1
)
self
.
GetVarValueAll
(
V1
,
value1
)
# if not(V1.OPCR is None): V1.OPCR.get_data_value().Value.Value=bytes2strs(value1,Step2,V1.type)
# if not(V1.OPCR is None): V1.OPCR.get_data_value().Value.Value=bytes2strs(value1,Step2,V1.type)
if
not
(
V1
.
OPCR
is
None
):
V1
.
OPCR
.
set_value
(
bytes2strs
(
value1
,
Step2
,
V1
.
type
))
if
not
(
V1
.
OPCR
is
None
):
V1
.
OPCR
.
set_value
(
bytes2strs
(
value1
,
Step2
,
V1
.
type
))
...
...
This diff is collapsed.
Click to expand it.
pypcc2.py
+
5
−
5
View file @
9a103ea6
...
@@ -50,10 +50,10 @@ RCU.AddVars(Q1,opcuaserv.AddVarR,opcuaserv.AddVarW)
...
@@ -50,10 +50,10 @@ RCU.AddVars(Q1,opcuaserv.AddVarR,opcuaserv.AddVarW)
RCU
.
AddMethod
(
Q1
,
opcuaserv
.
Addmethod
)
RCU
.
AddMethod
(
Q1
,
opcuaserv
.
Addmethod
)
RCU
.
load
()
#Load current register values from HW
RCU
.
load
()
#Load current register values from HW
#
CLK=CLK.RCU1(1,I2C.I2C2server,SW0.SetChannel)
CLK
=
CLK
.
RCU1
(
1
,
I2C
.
I2C2server
,
SW0
.
SetChannel
)
#
CLK.AddVars(Q2,opcuaserv.AddVarR,opcuaserv.AddVarW)
CLK
.
AddVars
(
Q2
,
opcuaserv
.
AddVarR
,
opcuaserv
.
AddVarW
)
#
CLK.AddMethod(Q2,opcuaserv.Addmethod)
CLK
.
AddMethod
(
Q2
,
opcuaserv
.
Addmethod
)
#
CLK.load() #Load current register values from HW
CLK
.
load
()
#Load current register values from HW
#logging.debug(str(("I2C bytes=",I2C.I2Ccounter)))
#logging.debug(str(("I2C bytes=",I2C.I2Ccounter)))
...
@@ -62,7 +62,7 @@ if False:
...
@@ -62,7 +62,7 @@ if False:
exit
()
exit
()
RCUthread1
=
RCU
.
start
(
Q1
)
RCUthread1
=
RCU
.
start
(
Q1
)
#
CLKthread1=CLK.start(Q2)
CLKthread1
=
CLK
.
start
(
Q2
)
RunTimer
=
True
;
RunTimer
=
True
;
def
TimerThread
(
Q1
,
RCU
):
def
TimerThread
(
Q1
,
RCU
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment