Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
PPSi
Commits
bce82e26
Commit
bce82e26
authored
Apr 22, 2021
by
Peter Jansweijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
phase shift until is_align_10MHz
parent
2fe94f2e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
9 deletions
+6
-9
wr-servo.c
proto-ext-whiterabbit/wr-servo.c
+6
-9
No files found.
proto-ext-whiterabbit/wr-servo.c
View file @
bce82e26
...
...
@@ -416,8 +416,7 @@ int wr_e2e_offset(struct pp_instance *ppi,
return
1
;
}
int
loop_cnt
;
#define NUMBER_OF_SHIFTS 40
#include "board.h"
#define COARSE_SHIFT 8000
int
wr_servo_update
(
struct
pp_instance
*
ppi
)
...
...
@@ -500,7 +499,6 @@ int wr_servo_update(struct pp_instance *ppi)
* fine tuning
*/
s
->
state
=
WR_SYNC_PHASE
;
loop_cnt
=
0
;
break
;
case
WR_SYNC_NSEC
:
...
...
@@ -511,9 +509,8 @@ int wr_servo_update(struct pp_instance *ppi)
break
;
case
WR_SYNC_PHASE
:
if
(
loop_cnt
<
NUMBER_OF_SHIFTS
)
{
loop_cnt
+=
1
;
pp_printf
(
"SP: cnt: %d
\n
"
,
loop_cnt
);
if
(
is_aligned_10mhz
()
==
0
)
{
s
->
cur_setpoint
+=
COARSE_SHIFT
;
wrp
->
ops
->
adjust_phase
(
s
->
cur_setpoint
);
}
else
{
...
...
@@ -545,9 +542,9 @@ int wr_servo_update(struct pp_instance *ppi)
/* ts_to_picos() below returns phase alone */
remaining_offset
=
abs
(
ts_offset_picos
);
if
(
loop_cnt
<
NUMBER_OF_SHIFTS
)
{
pp_printf
(
"WOS:
cnt: %d, remaining_offset: %d
\n
"
,
loop_cnt
,
remaining_offset
);
s
->
state
=
WR_SYNC_PHASE
;
// and loop to shift
200 ps
again.
if
(
is_aligned_10mhz
()
==
0
)
{
pp_printf
(
"WOS:
remaining_offset: %d
\n
"
,
remaining_offset
);
s
->
state
=
WR_SYNC_PHASE
;
// and loop to shift
COARSE_SHIFT
again.
}
else
{
if
(
remaining_offset
<
WR_SERVO_OFFSET_STABILITY_THRESHOLD
)
{
wrp
->
ops
->
enable_timing_output
(
ppi
,
1
);
...
...
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