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
a8e94519
Commit
a8e94519
authored
Apr 22, 2020
by
Tomasz Wlostowski
Committed by
Grzegorz Daniluk
Apr 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
monitor: moved monitor-specific variables to monitor_ppsi.c
parent
41771b3a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
monitor_ppsi.c
monitor/monitor_ppsi.c
+8
-6
No files found.
monitor/monitor_ppsi.c
View file @
a8e94519
...
...
@@ -25,6 +25,8 @@
#include "shell.h"
#include "revision.h"
#define WRC_MONITOR_REFRESH_PERIOD (1 * TICS_PER_SECOND)
#define WRC_DIAG_REFRESH_PERIOD (1 * TICS_PER_SECOND)
extern
struct
pp_servo
servo
;
...
...
@@ -108,8 +110,8 @@ int wrc_mon_gui(void)
int
n_out
,
i
;
if
(
!
last_jiffies
)
last_jiffies
=
timer_get_tics
()
-
1
-
wrc_ui_refperiod
;
if
(
time_before
(
timer_get_tics
(),
last_jiffies
+
wrc_ui_refperiod
)
last_jiffies
=
timer_get_tics
()
-
1
-
WRC_MONITOR_REFRESH_PERIOD
;
if
(
time_before
(
timer_get_tics
(),
last_jiffies
+
WRC_MONITOR_REFRESH_PERIOD
)
&&
last_servo_count
==
s
->
update_count
)
return
0
;
last_jiffies
=
timer_get_tics
();
...
...
@@ -192,7 +194,7 @@ int wrc_mon_gui(void)
if
(
wrc_mon_status
()
==
0
)
return
1
;
return
0
;
cprintf
(
C_GREY
,
"Servo state: "
);
cprintf
(
C_WHITE
,
"%s
\n
"
,
s
->
servo_state_name
);
...
...
@@ -259,7 +261,7 @@ int wrc_mon_gui(void)
cprintf
(
C_GREY
,
"Update counter:"
);
cprintf
(
C_WHITE
,
"%27d
\n
"
,
(
int32_t
)
(
s
->
update_count
));
return
1
;
return
0
;
}
static
inline
void
cprintf_time
(
int
color
,
struct
pp_time
*
time
)
...
...
@@ -321,12 +323,12 @@ int wrc_log_stats(void)
return
0
;
if
(
!
last_jiffies
)
last_jiffies
=
timer_get_tics
()
-
1
-
wrc_ui_refperiod
;
last_jiffies
=
timer_get_tics
()
-
1
-
WRC_MONITOR_REFRESH_PERIOD
;
/* stats update condition for Slave mode */
if
(
wrc_stats_last
==
s
->
update_count
&&
ptp_mode
==
WRC_MODE_SLAVE
)
return
0
;
/* stats update condition for Master mode */
if
(
time_before
(
timer_get_tics
(),
last_jiffies
+
wrc_ui_refperiod
)
&&
if
(
time_before
(
timer_get_tics
(),
last_jiffies
+
WRC_MONITOR_REFRESH_PERIOD
)
&&
ptp_mode
!=
WRC_MODE_SLAVE
)
return
0
;
last_jiffies
=
timer_get_tics
();
...
...
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