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
0ef037ee
Commit
0ef037ee
authored
May 17, 2013
by
Aurelio Colosimo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
monitor_ppsi.c: show PTP status in monitor gui
Signed-off-by:
Aurelio Colosimo
<
aurelio@aureliocolosimo.it
>
parent
23d48c21
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
10 deletions
+27
-10
monitor_ppsi.c
monitor/monitor_ppsi.c
+27
-10
No files found.
monitor/monitor_ppsi.c
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: "
);
...
...
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