Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
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
Software for White Rabbit PTP Core
Commits
c62d7d2d
Commit
c62d7d2d
authored
Dec 21, 2016
by
Mattia Rizzi
Committed by
Grzegorz Daniluk
Aug 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed locking bug of the switch
parent
28bde7e2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
spll_helper.c
softpll/spll_helper.c
+9
-1
spll_ptracker.c
softpll/spll_ptracker.c
+4
-1
No files found.
softpll/spll_helper.c
View file @
c62d7d2d
...
...
@@ -17,8 +17,13 @@ void helper_init(struct spll_helper_state *s, int ref_channel)
/* Phase branch PI controller */
s
->
pi
.
y_min
=
5
;
s
->
pi
.
y_max
=
(
1
<<
DAC_BITS
)
-
5
;
#if defined(CONFIG_WR_NODE)
s
->
pi
.
kp
=
-
150
;
//(int)(0.3 * 32.0 * 16.0); // / 2;
s
->
pi
.
ki
=
-
2
;
//(int)(0.03 * 32.0 * 3.0); // / 2;
#else
s
->
pi
.
kp
=
150
;
s
->
pi
.
ki
=
2
;
#endif
s
->
pi
.
anti_windup
=
1
;
/* Phase branch lock detection */
...
...
@@ -83,8 +88,11 @@ void helper_start(struct spll_helper_state *s)
{
/* Set the bias to the upper end of tuning range. This is to ensure that
the HPLL will always lock on positive frequency offset. */
#if defined(CONFIG_WR_SWITCH)
s
->
pi
.
bias
=
s
->
pi
.
y_max
;
#else
s
->
pi
.
bias
=
s
->
pi
.
y_min
;
#endif
s
->
p_setpoint
=
0
;
s
->
p_adder
=
0
;
s
->
sample_n
=
0
;
...
...
softpll/spll_ptracker.c
View file @
c62d7d2d
...
...
@@ -56,8 +56,11 @@ int ptrackers_update(struct spll_ptracker_state *ptrackers, int tag,
if
(
!
s
->
enabled
)
return
0
;
#if defined(CONFIG_WR_NODE)
register
int
delta
=
(
tag
-
tag_ref
)
&
((
1
<<
HPLL_N
)
-
1
);
#else
register
int
delta
=
(
tag_ref
-
tag
)
&
((
1
<<
HPLL_N
)
-
1
);
#endif
register
int
index
=
delta
>>
(
HPLL_N
-
2
);
...
...
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