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
f44d4a0a
Commit
f44d4a0a
authored
Oct 02, 2013
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
general: use symbolic names for configuration values
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
a433215b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
9 deletions
+22
-9
unix-startup.c
arch-unix/unix-startup.c
+4
-3
wrs-startup.c
arch-wrs/wrs-startup.c
+4
-3
ppsi.h
include/ppsi/ppsi.h
+11
-0
hooks.c
proto-ext-whiterabbit/hooks.c
+3
-3
No files found.
arch-unix/unix-startup.c
View file @
f44d4a0a
...
...
@@ -72,12 +72,13 @@ int main(int argc, char **argv)
ppi
->
glbs
=
ppg
;
ppi
->
iface_name
=
ppi
->
cfg
.
iface_name
;
ppi
->
ethernet_mode
=
(
ppi
->
cfg
.
proto
==
0
)
?
1
:
0
;
if
(
ppi
->
cfg
.
role
==
1
)
{
/* this old-fashioned "ethernet_mode" is a single bit */
ppi
->
ethernet_mode
=
(
ppi
->
cfg
.
proto
==
PPSI_PROTO_RAW
);
if
(
ppi
->
cfg
.
role
==
PPSI_ROLE_MASTER
)
{
ppi
->
master_only
=
1
;
ppi
->
slave_only
=
0
;
}
else
if
(
ppi
->
cfg
.
role
==
2
)
{
else
if
(
ppi
->
cfg
.
role
==
PPSI_ROLE_SLAVE
)
{
ppi
->
master_only
=
0
;
ppi
->
slave_only
=
1
;
}
...
...
arch-wrs/wrs-startup.c
View file @
f44d4a0a
...
...
@@ -101,12 +101,13 @@ int main(int argc, char **argv)
ppi
->
glbs
=
ppg
;
ppi
->
iface_name
=
ppi
->
cfg
.
iface_name
;
ppi
->
ethernet_mode
=
(
ppi
->
cfg
.
proto
==
0
)
?
1
:
0
;
if
(
ppi
->
cfg
.
role
==
1
)
{
/* this old-fashioned "ethernet_mode" is a single bit */
ppi
->
ethernet_mode
=
(
ppi
->
cfg
.
proto
==
PPSI_PROTO_RAW
);
if
(
ppi
->
cfg
.
role
==
PPSI_ROLE_MASTER
)
{
ppi
->
master_only
=
1
;
ppi
->
slave_only
=
0
;
}
else
if
(
ppi
->
cfg
.
role
==
2
)
{
else
if
(
ppi
->
cfg
.
role
==
PPSI_ROLE_SLAVE
)
{
ppi
->
master_only
=
0
;
ppi
->
slave_only
=
1
;
}
...
...
include/ppsi/ppsi.h
View file @
f44d4a0a
...
...
@@ -258,6 +258,17 @@ extern int pp_parse_cmdline(struct pp_globals *ppg, int argc, char **argv);
extern
int
pp_config_file
(
struct
pp_globals
*
ppg
,
int
*
argcp
,
char
**
argv
,
char
*
default_name
,
char
*
default_conf
);
#define PPSI_PROTO_RAW 0
#define PPSI_PROTO_UDP 1
#define PPSI_ROLE_AUTO 0
#define PPSI_ROLE_MASTER 1
#define PPSI_ROLE_SLAVE 2
#define PPSI_EXT_NONE 0
#define PPSI_EXT_WR 1
/* Servo */
extern
void
pp_servo_init
(
struct
pp_instance
*
ppi
);
extern
void
pp_servo_got_sync
(
struct
pp_instance
*
ppi
);
/* got t1 and t2 */
...
...
proto-ext-whiterabbit/hooks.c
View file @
f44d4a0a
...
...
@@ -37,12 +37,12 @@ static int wr_open(struct pp_globals *ppg, struct pp_runtime_opts *rt_opts)
* wr_data. May I move it to pp_globals? */
ppg
->
pp_instances
[
i
].
ext_data
=
&
wr_data
;
if
(
ppi
->
cfg
.
ext
)
{
if
(
ppi
->
cfg
.
ext
==
PPSI_EXT_WR
)
{
switch
(
ppi
->
cfg
.
role
)
{
case
1
:
case
PPSI_ROLE_MASTER
:
WR_DSPOR
(
ppi
)
->
wrConfig
=
WR_M_ONLY
;
break
;
case
2
:
case
PPSI_ROLE_SLAVE
:
WR_DSPOR
(
ppi
)
->
wrConfig
=
WR_S_ONLY
;
break
;
default:
...
...
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