Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Software for White Rabbit PTP Core
Manage
Activity
Members
Labels
Plan
Issues
39
Issue boards
Milestones
Wiki
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
Software for White Rabbit PTP Core
Commits
0ef037ee
Commit
0ef037ee
authored
11 years ago
by
Aurelio Colosimo
Browse files
Options
Downloads
Patches
Plain Diff
monitor_ppsi.c: show PTP status in monitor gui
Signed-off-by:
Aurelio Colosimo
<
aurelio@aureliocolosimo.it
>
parent
23d48c21
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
monitor/monitor_ppsi.c
+27
-10
27 additions, 10 deletions
monitor/monitor_ppsi.c
with
27 additions
and
10 deletions
monitor/monitor_ppsi.c
+
27
−
10
View file @
0ef037ee
...
...
@@ -35,6 +35,29 @@ struct pp_instance *ppi = &ppi_static;
static
void
wrc_mon_std_servo
(
void
);
int
wrc_mon_status
()
{
struct
pp_state_table_item
*
ip
=
NULL
;
for
(
ip
=
pp_state_table
;
ip
->
state
!=
PPS_END_OF_TABLE
;
ip
++
)
{
if
(
ip
->
state
==
ppi
->
state
)
break
;
}
cprintf
(
C_BLUE
,
"
\n\n
PTP status: "
);
cprintf
(
C_WHITE
,
"%s"
,
ip
?
ip
->
name
:
"unknown"
);
if
((
!
cur_servo_state
.
valid
)
||
(
ppi
->
state
!=
PPS_SLAVE
))
{
cprintf
(
C_RED
,
"
\n\n
Sync info not valid
\n\n
"
);
return
0
;
}
/* show_servo */
cprintf
(
C_BLUE
,
"
\n\n
Synchronization status:
\n\n
"
);
return
1
;
}
void
wrc_mon_gui
(
void
)
{
static
uint32_t
last
=
0
;
...
...
@@ -108,16 +131,10 @@ void wrc_mon_gui(void)
cprintf
(
C_RED
,
"BOOTP running"
);
else
cprintf
(
C_GREEN
,
"%d.%d.%d.%d"
,
ip
[
0
],
ip
[
1
],
ip
[
2
],
ip
[
3
]);
#endif
/* show_servo */
cprintf
(
C_BLUE
,
"
\n\n
Synchronization status:
\n\n
"
);
#endif
if
(
!
cur_servo_state
.
valid
)
{
cprintf
(
C_RED
,
"Master mode or sync info not valid
\n\n
"
);
if
(
wrc_mon_status
()
==
0
)
return
;
}
cprintf
(
C_GREY
,
"Servo state: "
);
cprintf
(
C_WHITE
,
"%s
\n
"
,
cur_servo_state
.
slave_servo_state
);
...
...
@@ -206,8 +223,8 @@ static void wrc_mon_std_servo(void)
{
cprintf
(
C_RED
,
"WR Off"
);
/* show standard servo */
cprintf
(
C_BLUE
,
"
\n\n
Synchronization status:
\n\n
"
)
;
if
(
wrc_mon_status
()
==
0
)
return
;
cprintf
(
C_GREY
,
"Clock offset: "
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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