Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
PPSi
Commits
a652b53f
Commit
a652b53f
authored
Jun 18, 2015
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wr-servo: turn 'valid' field into a flag
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
50fa6cff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
wr-api.h
proto-ext-whiterabbit/wr-api.h
+4
-1
wr-servo.c
proto-ext-whiterabbit/wr-servo.c
+2
-2
No files found.
proto-ext-whiterabbit/wr-api.h
View file @
a652b53f
...
@@ -134,9 +134,12 @@ int wr_servo_update(struct pp_instance *ppi);
...
@@ -134,9 +134,12 @@ int wr_servo_update(struct pp_instance *ppi);
struct
wr_servo_state
{
struct
wr_servo_state
{
char
if_name
[
16
];
/* Informative, for wr_mon through shmem */
char
if_name
[
16
];
/* Informative, for wr_mon through shmem */
unsigned
long
flags
;
#define WR_FLAG_VALID 1
int
state
;
int
state
;
int
next_state
;
int
next_state
;
int
valid
;
/* These fields are used by servo code, after asetting at init time */
/* These fields are used by servo code, after asetting at init time */
int32_t
delta_tx_m
;
int32_t
delta_tx_m
;
...
...
proto-ext-whiterabbit/wr-servo.c
View file @
a652b53f
...
@@ -145,7 +145,7 @@ static int got_sync = 0;
...
@@ -145,7 +145,7 @@ static int got_sync = 0;
void
wr_servo_reset
(
void
)
void
wr_servo_reset
(
void
)
{
{
if
(
saved_servo_pointer
)
if
(
saved_servo_pointer
)
saved_servo_pointer
->
valid
=
0
;
saved_servo_pointer
->
flags
=
0
;
}
}
static
inline
int32_t
delta_to_ps
(
struct
FixedDelta
d
)
static
inline
int32_t
delta_to_ps
(
struct
FixedDelta
d
)
...
@@ -182,7 +182,7 @@ int wr_servo_init(struct pp_instance *ppi)
...
@@ -182,7 +182,7 @@ int wr_servo_init(struct pp_instance *ppi)
strcpy
(
s
->
servo_state_name
,
"Uninitialized"
);
strcpy
(
s
->
servo_state_name
,
"Uninitialized"
);
saved_servo_pointer
=
s
;
saved_servo_pointer
=
s
;
saved_servo_pointer
->
valid
=
1
;
saved_servo_pointer
->
flags
|=
WR_FLAG_VALID
;
s
->
update_count
=
0
;
s
->
update_count
=
0
;
got_sync
=
0
;
got_sync
=
0
;
...
...
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