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
7
Merge Requests
7
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
ddbbda41
Commit
ddbbda41
authored
Oct 24, 2016
by
Alessandro Rubini
Committed by
Grzegorz Daniluk
Feb 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
general: fix for new time data structures
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
8f71d69a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
16 deletions
+20
-16
snmp.c
lib/snmp.c
+2
-2
monitor_ppsi.c
monitor/monitor_ppsi.c
+18
-14
No files found.
lib/snmp.c
View file @
ddbbda41
...
...
@@ -866,9 +866,9 @@ static int get_servo(uint8_t *buf, struct snmp_oid *obj)
tmp_uint64
=
wr_s_state
->
picos_mu
-
2LL
*
wr_s_state
->
delta_ms
;
return
get_value
(
buf
,
obj
->
asn
,
&
tmp_uint64
);
case
(
int
)
SERVO_UPDATE_TIME
:
tmp_uint64
=
((
uint64_t
)
wr_s_state
->
update_time
.
sec
ond
s
)
*
tmp_uint64
=
((
uint64_t
)
wr_s_state
->
update_time
.
secs
)
*
1000000000LL
+
wr_s_state
->
update_time
.
nanoseconds
;
+
(
wr_s_state
->
update_time
.
scaled_nsecs
>>
16
)
;
return
get_value
(
buf
,
obj
->
asn
,
&
tmp_uint64
);
default:
break
;
...
...
monitor/monitor_ppsi.c
View file @
ddbbda41
...
...
@@ -246,18 +246,20 @@ int wrc_mon_gui(void)
return
1
;
}
static
inline
void
cprintf_ti
(
int
color
,
struct
TimeInternal
*
ti
)
static
inline
void
cprintf_ti
me
(
int
color
,
struct
pp_time
*
time
)
{
if
((
ti
->
seconds
>
0
)
||
((
ti
->
seconds
==
0
)
&&
(
ti
->
nanoseconds
>=
0
)))
cprintf
(
color
,
"%2i.%09i s"
,
ti
->
seconds
,
ti
->
nanoseconds
);
else
{
if
(
ti
->
seconds
==
0
)
cprintf
(
color
,
"-%i.%09i s"
,
ti
->
seconds
,
-
ti
->
nanoseconds
);
int
s
,
ns
;
s
=
(
int
)
time
->
secs
;
ns
=
(
int
)(
time
->
scaled_nsecs
>>
16
);
if
(
s
>
0
||
(
s
==
0
&&
ns
>=
0
))
{
cprintf
(
color
,
"%2i.%09i s"
,
s
,
ns
);
}
else
{
/* negative */
if
(
time
->
secs
==
0
)
cprintf
(
color
,
"-%i.%09i s"
,
s
,
-
ns
);
else
cprintf
(
color
,
"%
2i.%09i s"
,
ti
->
seconds
,
-
ti
->
nanosecond
s
);
cprintf
(
color
,
"%
i.%09i s"
,
s
,
-
n
s
);
}
}
static
void
wrc_mon_std_servo
(
void
)
...
...
@@ -269,16 +271,18 @@ static void wrc_mon_std_servo(void)
cprintf
(
C_GREY
,
"Clock offset: "
);
if
(
DSCUR
(
ppi
)
->
offsetFromMaster
.
sec
ond
s
)
cprintf_ti
(
C_WHITE
,
&
DSCUR
(
ppi
)
->
offsetFromMaster
);
if
(
DSCUR
(
ppi
)
->
offsetFromMaster
.
secs
)
cprintf_ti
me
(
C_WHITE
,
&
DSCUR
(
ppi
)
->
offsetFromMaster
);
else
{
cprintf
(
C_WHITE
,
"%9i ns"
,
DSCUR
(
ppi
)
->
offsetFromMaster
.
nanoseconds
);
cprintf
(
C_WHITE
,
"%9i ns"
,
(
int
)(
DSCUR
(
ppi
)
->
offsetFromMaster
.
scaled_nsecs
>>
16
));
cprintf
(
C_GREY
,
"
\n
One-way delay averaged: "
);
cprintf
(
C_WHITE
,
"%9i ns"
,
DSCUR
(
ppi
)
->
meanPathDelay
.
nanoseconds
);
cprintf
(
C_WHITE
,
"%9i ns"
,
(
int
)(
DSCUR
(
ppi
)
->
meanPathDelay
.
scaled_nsecs
>>
16
));
cprintf
(
C_GREY
,
"
\n
Observed drift: "
);
cprintf
(
C_WHITE
,
"%9i ns"
,
SRV
(
ppi
)
->
obs_drift
);
cprintf
(
C_WHITE
,
"%9i ns"
,
SRV
(
ppi
)
->
obs_drift
);
}
}
...
...
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