Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
White Rabbit Switch - Software
Manage
Activity
Members
Labels
Plan
Issues
87
Issue boards
Milestones
Wiki
Code
Merge requests
4
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
White Rabbit Switch - Software
Commits
63dd85b0
Commit
63dd85b0
authored
9 years ago
by
Alessandro Rubini
Browse files
Options
Downloads
Patches
Plain Diff
userspace/wr_mon: shmem: wait for HAL to start
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
fbcc48e8
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
userspace/tools/wr_mon.c
+11
-1
11 additions, 1 deletion
userspace/tools/wr_mon.c
with
11 additions
and
1 deletion
userspace/tools/wr_mon.c
+
11
−
1
View file @
63dd85b0
...
...
@@ -99,12 +99,22 @@ void ppsi_connect_minipc()
void
init_shm
(
void
)
{
struct
hal_shmem_header
*
h
;
int
retr
,
maxretr
=
15
;
hal_head
=
wrs_shm_get
(
wrs_shm_hal
,
""
,
WRS_SHM_READ
);
if
(
!
hal_head
)
{
fprintf
(
stderr
,
"unable to open shm for HAL!
\n
"
);
exit
(
1
);
}
for
(
retr
=
0
;
retr
<
maxretr
&&
!
hal_head
->
version
;
retr
++
)
{
if
(
!
retr
)
fprintf
(
stderr
,
"Waiting for HAL.."
);
fprintf
(
stderr
,
"."
);
sleep
(
1
);
}
if
(
retr
)
fprintf
(
stderr
,
"
\n
"
);
/* check hal's shm version */
if
(
hal_head
->
version
!=
HAL_SHMEM_VERSION
)
{
fprintf
(
stderr
,
"wr_mon: unknown HAL's shm version %i "
...
...
@@ -125,7 +135,7 @@ void init_shm(void)
* addresses. No need to re-dereference pointer at each read. */
hal_ports
=
wrs_shm_follow
(
hal_head
,
h
->
ports
);
if
(
!
hal_ports
)
{
fprintf
(
stderr
,
"Una
l
be to follow hal_ports pointer in HAL's "
fprintf
(
stderr
,
"Unab
l
e to follow hal_ports pointer in HAL's "
"shmem"
);
exit
(
1
);
}
...
...
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