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
8ffdf32f
Commit
8ffdf32f
authored
Feb 24, 2017
by
Alessandro Rubini
Committed by
Adam Wujek
Mar 01, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrs: add diagnostic for math in an internal function
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
d9e59feb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
wrs-socket.c
time-wrs/wrs-socket.c
+10
-0
No files found.
time-wrs/wrs-socket.c
View file @
8ffdf32f
...
...
@@ -137,6 +137,11 @@ static void wrs_linearize_rx_timestamp(struct pp_time *ts,
int
trip_lo
,
trip_hi
;
int
phase
;
pp_diag
(
NULL
,
ext
,
3
,
"linearize ts %s and phase %i
\n
"
,
fmt_time
(
ts
),
dmtd_phase
);
pp_diag
(
NULL
,
ext
,
3
,
" (ahead %i tpoint %i, period %i
\n
"
,
cntr_ahead
,
transition_point
,
clock_period
);
phase
=
clock_period
-
1
-
dmtd_phase
;
/* calculate the range within which falling edge timestamp is stable
...
...
@@ -146,6 +151,8 @@ static void wrs_linearize_rx_timestamp(struct pp_time *ts,
trip_hi
=
transition_point
+
clock_period
/
4
;
if
(
trip_hi
>=
clock_period
)
trip_hi
-=
clock_period
;
pp_diag
(
NULL
,
ext
,
3
,
" phase now %i (tripl %i, triph %i)
\n
"
,
phase
,
trip_lo
,
trip_hi
);
if
(
inside_range
(
trip_lo
,
trip_hi
,
phase
))
{
...
...
@@ -156,6 +163,7 @@ static void wrs_linearize_rx_timestamp(struct pp_time *ts,
if
(
cntr_ahead
)
ts
->
scaled_nsecs
-=
(
clock_period
/
1000LL
)
<<
16
;
pp_diag
(
NULL
,
ext
,
3
,
" ts became %s
\n
"
,
fmt_time
(
ts
));
/* check if the phase is before the counter transition value
* and eventually increase the counter by 1 to simulate a
...
...
@@ -163,6 +171,7 @@ static void wrs_linearize_rx_timestamp(struct pp_time *ts,
* DMTD phase value */
if
(
inside_range
(
trip_lo
,
transition_point
,
phase
))
ts
->
scaled_nsecs
+=
(
clock_period
/
1000LL
)
<<
16
;
pp_diag
(
NULL
,
ext
,
3
,
" ts became %s
\n
"
,
fmt_time
(
ts
));
}
...
...
@@ -171,6 +180,7 @@ static void wrs_linearize_rx_timestamp(struct pp_time *ts,
phase
+=
clock_period
;
phase
=
clock_period
-
1
-
phase
;
ts
->
scaled_nsecs
+=
(
phase
<<
16
)
/
1000
;
pp_diag
(
NULL
,
ext
,
3
,
" ts final %s
\n
"
,
fmt_time
(
ts
));
}
...
...
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