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
585979c6
Commit
585979c6
authored
Jun 12, 2013
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trivial: */main-loop: fit 80 columns
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
a4244b11
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
20 deletions
+26
-20
main-loop.c
arch-unix/main-loop.c
+13
-10
main-loop.c
arch-wrs/main-loop.c
+13
-10
No files found.
arch-unix/main-loop.c
View file @
585979c6
...
...
@@ -27,8 +27,8 @@ static int run_all_state_machines(struct pp_globals *ppg)
/* delay_ms is the least delay_ms among all instances */
if
(
j
==
0
)
delay_ms
=
delay_ms_j
;
else
delay_ms
=
delay_ms_j
<
delay_ms
?
delay_ms_j
:
delay_ms
;
if
(
delay_ms_j
<
delay_ms
)
delay_ms
=
delay_ms_j
;
}
return
delay_ms
;
...
...
@@ -65,10 +65,12 @@ void unix_main_loop(struct pp_globals *ppg)
while
(
1
)
{
int
i
;
/*
* If Ebest was changed in previous loop, run best
* master clock before checking for new packets, which
* would affect port state again
*/
if
(
ppg
->
ebest_updated
)
{
/* If Ebest was changed in previous loop, run best master
* clock before checking for new packets, which would affect
* port state again */
for
(
j
=
0
;
j
<
ppg
->
nlinks
;
j
++
)
{
int
new_state
;
struct
pp_instance
*
ppi
=
&
ppg
->
pp_instances
[
j
];
...
...
@@ -101,18 +103,19 @@ void unix_main_loop(struct pp_globals *ppg)
ppi
=
&
ppg
->
pp_instances
[
j
];
if
((
NP
(
ppi
)
->
ch
[
PP_NP_GEN
].
pkt_present
)
||
(
NP
(
ppi
)
->
ch
[
PP_NP_EVT
].
pkt_present
))
{
/* We got some packets. If not ours, go on to the next ppi */
(
NP
(
ppi
)
->
ch
[
PP_NP_EVT
].
pkt_present
))
{
i
=
ppi
->
n_ops
->
recv
(
ppi
,
ppi
->
rx_frame
,
PP_MAX_FRAME_LENGTH
-
4
,
&
ppi
->
last_rcv_time
);
ppi
->
last_rcv_time
.
seconds
+=
DSPRO
(
ppi
)
->
currentUtcOffset
;
ppi
->
last_rcv_time
.
seconds
+=
DSPRO
(
ppi
)
->
currentUtcOffset
;
if
(
i
<
PP_MINIMUM_LENGTH
)
{
pp_diag
(
ppi
,
frames
,
1
,
"Error or short packet: %d < %d
\n
"
,
i
,
pp_diag
(
ppi
,
frames
,
1
,
"Error or short frame: "
"%d < %d
\n
"
,
i
,
PP_MINIMUM_LENGTH
);
continue
;
...
...
arch-wrs/main-loop.c
View file @
585979c6
...
...
@@ -27,8 +27,8 @@ static int run_all_state_machines(struct pp_globals *ppg)
/* delay_ms is the least delay_ms among all instances */
if
(
j
==
0
)
delay_ms
=
delay_ms_j
;
else
delay_ms
=
delay_ms_j
<
delay_ms
?
delay_ms_j
:
delay_ms
;
if
(
delay_ms_j
<
delay_ms
)
delay_ms
=
delay_ms_j
;
}
return
delay_ms
;
...
...
@@ -67,10 +67,12 @@ void wrs_main_loop(struct pp_globals *ppg)
minipc_server_action
(
ppsi_ch
,
10
/* ms */
);
/*
* If Ebest was changed in previous loop, run best
* master clock before checking for new packets, which
* would affect port state again
*/
if
(
ppg
->
ebest_updated
)
{
/* If Ebest was changed in previous loop, run best master
* clock before checking for new packets, which would affect
* port state again */
for
(
j
=
0
;
j
<
ppg
->
nlinks
;
j
++
)
{
int
new_state
;
struct
pp_instance
*
ppi
=
&
ppg
->
pp_instances
[
j
];
...
...
@@ -103,18 +105,19 @@ void wrs_main_loop(struct pp_globals *ppg)
ppi
=
&
ppg
->
pp_instances
[
j
];
if
((
NP
(
ppi
)
->
ch
[
PP_NP_GEN
].
pkt_present
)
||
(
NP
(
ppi
)
->
ch
[
PP_NP_EVT
].
pkt_present
))
{
/* We got some packets. If not ours, go on to the next ppi */
(
NP
(
ppi
)
->
ch
[
PP_NP_EVT
].
pkt_present
))
{
i
=
ppi
->
n_ops
->
recv
(
ppi
,
ppi
->
rx_frame
,
PP_MAX_FRAME_LENGTH
-
4
,
&
ppi
->
last_rcv_time
);
ppi
->
last_rcv_time
.
seconds
+=
DSPRO
(
ppi
)
->
currentUtcOffset
;
ppi
->
last_rcv_time
.
seconds
+=
DSPRO
(
ppi
)
->
currentUtcOffset
;
if
(
i
<
PP_MINIMUM_LENGTH
)
{
pp_diag
(
ppi
,
frames
,
1
,
"Error or short packet: %d < %d
\n
"
,
i
,
pp_diag
(
ppi
,
frames
,
1
,
"Error or short frame: "
"%d < %d
\n
"
,
i
,
PP_MINIMUM_LENGTH
);
continue
;
...
...
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