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
87aa1db9
Commit
87aa1db9
authored
Mar 01, 2016
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
syslog: avoid accessing servo state in host builds
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
367c4e79
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
syslog.c
lib/syslog.c
+8
-4
No files found.
lib/syslog.c
View file @
87aa1db9
...
...
@@ -68,11 +68,15 @@ int syslog_poll(void)
/* for servo-state (accesses ppsi internal variables */
extern
struct
pp_instance
*
ppi
;
struct
wr_servo_state
*
s
=
&
((
struct
wr_data
*
)
ppi
->
ext_data
)
->
servo_state
;
struct
wr_servo_state
*
s
;
static
uint32_t
prev_tics
;
static
int
track_ok_count
,
prev_servo_state
=
-
1
;
if
(
IS_HOST_PROCESS
)
s
=
NULL
;
else
s
=
&
((
struct
wr_data
*
)
ppi
->
ext_data
)
->
servo_state
;
if
(
ip_status
==
IP_TRAINING
)
...
...
@@ -114,7 +118,7 @@ int syslog_poll(void)
if
(
!
prev_tics
)
prev_tics
=
timer_get_tics
();
if
(
s
->
state
==
WR_TRACK_PHASE
&&
if
(
s
&&
s
->
state
==
WR_TRACK_PHASE
&&
prev_servo_state
!=
WR_TRACK_PHASE
)
{
/* we reached sync: log it */
track_ok_count
++
;
...
...
@@ -138,7 +142,7 @@ int syslog_poll(void)
prev_tics
/
1000
,
prev_tics
%
1000
);
goto
send
;
}
if
(
s
->
state
!=
WR_TRACK_PHASE
&&
if
(
s
&&
s
->
state
!=
WR_TRACK_PHASE
&&
prev_servo_state
==
WR_TRACK_PHASE
)
{
prev_servo_state
=
s
->
state
;
...
...
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