Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
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
White Rabbit Switch - Software
Commits
43ecab79
Commit
43ecab79
authored
Jul 22, 2015
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
userspace/wr_mon: check if wr-servo is updating, and report if not
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
28ea45b5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
wr_mon.c
userspace/tools/wr_mon.c
+15
-5
No files found.
userspace/tools/wr_mon.c
View file @
43ecab79
...
...
@@ -300,6 +300,8 @@ void show_servo(void)
{
int64_t
total_asymmetry
;
int64_t
crtt
;
static
time_t
lastt
;
static
int
last_count
;
total_asymmetry
=
ppsi_servo_local
.
picos_mu
-
2LL
*
ppsi_servo_local
.
delta_ms
;
...
...
@@ -316,11 +318,15 @@ void show_servo(void)
}
term_cprintf
(
C_GREY
,
"Servo state: "
);
term_cprintf
(
C_WHITE
,
"%s: %s%s
\n
"
,
ppsi_servo_local
.
if_name
,
ppsi_servo_local
.
servo_state_name
,
ppsi_servo_local
.
flags
&
WR_FLAG_WAIT_HW
?
" (wait for hw)"
:
""
);
if
(
lastt
&&
time
(
NULL
)
-
lastt
>
5
)
{
term_cprintf
(
C_RED
,
" --- not updating --- "
);
}
else
{
term_cprintf
(
C_WHITE
,
"%s: %s%s
\n
"
,
ppsi_servo_local
.
if_name
,
ppsi_servo_local
.
servo_state_name
,
ppsi_servo_local
.
flags
&
WR_FLAG_WAIT_HW
?
" (wait for hw)"
:
""
);
}
/* "tracking disabled" is just a testing tool */
if
(
!
ppsi_servo_local
.
tracking_enabled
)
...
...
@@ -369,6 +375,10 @@ void show_servo(void)
term_cprintf
(
C_GREY
,
"Servo update counter: "
);
term_cprintf
(
C_WHITE
,
"%u times
\n
"
,
ppsi_servo_local
.
update_count
);
if
(
ppsi_servo_local
.
update_count
!=
last_count
)
{
lastt
=
time
(
NULL
);
last_count
=
ppsi_servo_local
.
update_count
;
}
}
else
if
(
mode
==
SHOW_STATS
)
{
printf
(
"SERVO "
);
...
...
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