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
8f2add6b
Commit
8f2add6b
authored
Jan 06, 2013
by
Aurelio Colosimo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
general redefinition of timers to achieve ms granularity
Signed-off-by:
Aurelio Colosimo
<
aurelio@aureliocolosimo.it
>
parent
e138d5e1
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
80 additions
and
65 deletions
+80
-65
posix-timer.c
arch-gnu-linux/posix-timer.c
+16
-16
main-loop.c
arch-spec/main-loop.c
+1
-1
spec-timer.c
arch-spec/spec-timer.c
+8
-7
ppsi.h
include/ppsi/ppsi.h
+3
-3
common-fun.c
proto-ext-whiterabbit/common-fun.c
+2
-2
state-master.c
proto-ext-whiterabbit/state-master.c
+4
-3
state-passive.c
proto-ext-whiterabbit/state-passive.c
+2
-1
state-slave.c
proto-ext-whiterabbit/state-slave.c
+6
-4
state-wr-calibrated.c
proto-ext-whiterabbit/state-wr-calibrated.c
+2
-2
state-wr-calibration.c
proto-ext-whiterabbit/state-wr-calibration.c
+5
-2
state-wr-locked.c
proto-ext-whiterabbit/state-wr-locked.c
+2
-2
state-wr-m-lock.c
proto-ext-whiterabbit/state-wr-m-lock.c
+2
-2
state-wr-present.c
proto-ext-whiterabbit/state-wr-present.c
+2
-2
state-wr-resp-calib-req.c
proto-ext-whiterabbit/state-wr-resp-calib-req.c
+8
-5
state-wr-s-lock.c
proto-ext-whiterabbit/state-wr-s-lock.c
+2
-2
wr-constants.h
proto-ext-whiterabbit/wr-constants.h
+1
-1
common-fun.c
proto-standard/common-fun.c
+2
-2
state-master.c
proto-standard/state-master.c
+4
-3
state-passive.c
proto-standard/state-passive.c
+2
-1
state-slave.c
proto-standard/state-slave.c
+6
-4
No files found.
arch-gnu-linux/posix-timer.c
View file @
8f2add6b
...
...
@@ -41,36 +41,40 @@ int posix_timer_init(struct pp_instance *ppi)
}
int
posix_timer_start
(
uint32_t
interval
,
struct
pp_timer
*
tm
)
int
posix_timer_start
(
uint32_t
interval
_ms
,
struct
pp_timer
*
tm
)
{
time_t
now
;
now
=
time
(
NULL
);
tm
->
start
=
(
uint32_t
)
now
;
tm
->
interval
=
interval
;
struct
timespec
now
;
clock_gettime
(
CLOCK_MONOTONIC_RAW
,
&
now
);
tm
->
start
=
((
uint64_t
)(
now
->
tv_sec
))
*
1000
+
(
now
->
tv_nsec
/
1000000
);
tm
->
interval_ms
=
interval_ms
;
return
0
;
}
int
posix_timer_stop
(
struct
pp_timer
*
tm
)
{
tm
->
interval
=
0
;
tm
->
interval
_ms
=
0
;
tm
->
start
=
0
;
return
0
;
}
int
posix_timer_expired
(
struct
pp_timer
*
tm
)
{
time_t
now
;
struct
timespec
now
;
uint64_t
now_ms
;
if
(
tm
->
start
==
0
)
{
PP_PRINTF
(
"%p Warning: posix_timer_expired: timer not started
\n
"
,
tm
);
return
0
;
}
now
=
time
(
NULL
);
clock_gettime
(
CLOCK_MONOTONIC_RAW
,
&
now
);
now_ms
=
((
uint64_t
)(
now
->
tv_sec
))
*
1000
+
(
now
->
tv_nsec
/
1000000
);
if
(
tm
->
start
+
tm
->
interval
<
(
uint32_t
)
now
)
{
if
(
now_ms
>
tm
->
start
+
tm
->
interval
)
{
tm
->
start
=
now
;
return
1
;
}
...
...
@@ -80,18 +84,14 @@ int posix_timer_expired(struct pp_timer *tm)
void
posix_timer_adjust_all
(
struct
pp_instance
*
ppi
,
int32_t
diff
)
{
int
i
;
for
(
i
=
0
;
i
<
PP_TIMER_ARRAY_SIZE
;
i
++
)
{
ppi
->
timers
[
i
]
->
start
+=
diff
;
}
/* Do nothing, clock_gettime uses MONOTONIC_RAW tstamps */
}
int
pp_timer_init
(
struct
pp_instance
*
ppi
)
__attribute__
((
alias
(
"posix_timer_init"
)));
int
pp_timer_start
(
uint32_t
interval
,
struct
pp_timer
*
tm
)
int
pp_timer_start
(
uint32_t
interval
_ms
,
struct
pp_timer
*
tm
)
__attribute__
((
alias
(
"posix_timer_start"
)));
int
pp_timer_stop
(
struct
pp_timer
*
tm
)
...
...
arch-spec/main-loop.c
View file @
8f2add6b
...
...
@@ -36,7 +36,7 @@ void spec_main_loop(struct pp_instance *ppi)
/* Wait for a packet or for the timeout */
while
(
delay_ms
&&
!
minic_poll_rx
())
{
timer_delay
(
1
000
);
timer_delay
(
1
);
delay_ms
--
;
}
if
(
!
minic_poll_rx
())
{
...
...
arch-spec/spec-timer.c
View file @
8f2add6b
...
...
@@ -2,6 +2,7 @@
#include <ppsi/diag.h>
#include <pps_gen.h>
#include <syscon.h>
#include <ptpd_netif.h>
static
struct
pp_timer
spec_timers
[
PP_TIMER_ARRAY_SIZE
];
...
...
@@ -15,16 +16,16 @@ int spec_timer_init(struct pp_instance *ppi)
return
0
;
}
int
spec_timer_start
(
uint32_t
interval
,
struct
pp_timer
*
tm
)
int
spec_timer_start
(
uint32_t
interval
_ms
,
struct
pp_timer
*
tm
)
{
tm
->
start
=
spec_time
();
tm
->
interval
=
interval
;
tm
->
start
=
ptpd_netif_get_msec_tics
();
tm
->
interval
_ms
=
interval_ms
;
return
0
;
}
int
spec_timer_stop
(
struct
pp_timer
*
tm
)
{
tm
->
interval
=
0
;
tm
->
interval
_ms
=
0
;
tm
->
start
=
0
;
return
0
;
...
...
@@ -39,9 +40,9 @@ int spec_timer_expired(struct pp_timer *tm)
return
0
;
}
now
=
spec_time
();
now
=
ptpd_netif_get_msec_tics
();
if
(
tm
->
start
+
tm
->
interval
<=
now
)
{
if
(
now
>
tm
->
start
+
tm
->
interval_ms
)
{
tm
->
start
=
now
;
return
1
;
}
...
...
@@ -64,7 +65,7 @@ uint32_t spec_timer_get_msec_tics(void)
int
pp_timer_init
(
struct
pp_instance
*
ppi
)
__attribute__
((
alias
(
"spec_timer_init"
)));
int
pp_timer_start
(
uint32_t
interval
,
struct
pp_timer
*
tm
)
int
pp_timer_start
(
uint32_t
interval
_ms
,
struct
pp_timer
*
tm
)
__attribute__
((
alias
(
"spec_timer_start"
)));
int
pp_timer_stop
(
struct
pp_timer
*
tm
)
...
...
include/ppsi/ppsi.h
View file @
8f2add6b
...
...
@@ -94,8 +94,8 @@ struct pp_frgn_master {
* for timer expiration computation. Both are seconds
*/
struct
pp_timer
{
uint
32
_t
start
;
uint32_t
interval
;
uint
64
_t
start
;
uint32_t
interval
_ms
;
};
...
...
@@ -260,7 +260,7 @@ extern int pp_send_packet(struct pp_instance *ppi, void *pkt, int len,
/* Timers */
extern
int
pp_timer_init
(
struct
pp_instance
*
ppi
);
/* initializes timer common
structure */
extern
int
pp_timer_start
(
uint32_t
interval
,
struct
pp_timer
*
tm
);
extern
int
pp_timer_start
(
uint32_t
interval
_ms
,
struct
pp_timer
*
tm
);
extern
int
pp_timer_stop
(
struct
pp_timer
*
tm
);
extern
int
pp_timer_expired
(
struct
pp_timer
*
tm
);
/* returns 1 when expired */
/* pp_adj_timers is called after pp_set_tstamp and must be defined for those
...
...
proto-ext-whiterabbit/common-fun.c
View file @
8f2add6b
...
...
@@ -68,8 +68,8 @@ void st_com_restart_annrec_timer(struct pp_instance *ppi)
if
(
DSPOR
(
ppi
)
->
logAnnounceInterval
<
0
)
PP_PRINTF
(
"Error: logAnnounceInterval < 0"
);
pp_timer_start
((
DSPOR
(
ppi
)
->
announceReceiptTimeout
)
<<
DSPOR
(
ppi
)
->
logAnnounceInterval
,
pp_timer_start
((
(
DSPOR
(
ppi
)
->
announceReceiptTimeout
)
<<
DSPOR
(
ppi
)
->
logAnnounceInterval
)
*
1000
,
ppi
->
timers
[
PP_TIMER_ANN_RECEIPT
]);
}
...
...
proto-ext-whiterabbit/state-master.c
View file @
8f2add6b
...
...
@@ -29,13 +29,14 @@ int pp_master(struct pp_instance *ppi, unsigned char *pkt, int plen)
if
(
ppi
->
is_new_state
)
{
DSPOR
(
ppi
)
->
portState
=
PPS_MASTER
;
pp_timer_start
(
1
<<
DSPOR
(
ppi
)
->
logSyncInterval
,
pp_timer_start
(
(
1
<<
DSPOR
(
ppi
)
->
logSyncInterval
)
*
1000
,
ppi
->
timers
[
PP_TIMER_SYNC
]);
pp_timer_start
(
1
<<
DSPOR
(
ppi
)
->
logAnnounceInterval
,
pp_timer_start
(
(
1
<<
DSPOR
(
ppi
)
->
logAnnounceInterval
)
*
1000
,
ppi
->
timers
[
PP_TIMER_ANN_INTERVAL
]);
pp_timer_start
(
1
<<
DSPOR
(
ppi
)
->
logMinPdelayReqInterval
,
pp_timer_start
(
(
1
<<
DSPOR
(
ppi
)
->
logMinPdelayReqInterval
)
*
1000
,
ppi
->
timers
[
PP_TIMER_PDELAYREQ
]);
/* Send an announce immediately, when becomes master */
if
(
msg_issue_announce
(
ppi
)
<
0
)
...
...
proto-ext-whiterabbit/state-passive.c
View file @
8f2add6b
...
...
@@ -12,7 +12,8 @@ int pp_passive(struct pp_instance *ppi, unsigned char *pkt, int plen)
if
(
ppi
->
is_new_state
)
{
DSPOR
(
ppi
)
->
portState
=
PPS_PASSIVE
;
pp_timer_start
(
1
<<
DSPOR
(
ppi
)
->
logMinPdelayReqInterval
,
pp_timer_start
(
(
1
<<
DSPOR
(
ppi
)
->
logMinPdelayReqInterval
)
*
1000
,
ppi
->
timers
[
PP_TIMER_PDELAYREQ
]);
st_com_restart_annrec_timer
(
ppi
);
...
...
proto-ext-whiterabbit/state-slave.c
View file @
8f2add6b
...
...
@@ -38,11 +38,13 @@ int pp_slave(struct pp_instance *ppi, unsigned char *pkt, int plen)
st_com_restart_annrec_timer
(
ppi
);
if
(
OPTS
(
ppi
)
->
e2e_mode
)
pp_timer_start
(
1
<<
DSPOR
(
ppi
)
->
logMinDelayReqInterval
,
ppi
->
timers
[
PP_TIMER_DELAYREQ
]);
pp_timer_start
(
(
1
<<
DSPOR
(
ppi
)
->
logMinDelayReqInterval
)
*
1000
,
ppi
->
timers
[
PP_TIMER_DELAYREQ
]);
else
pp_timer_start
(
1
<<
DSPOR
(
ppi
)
->
logMinPdelayReqInterval
,
ppi
->
timers
[
PP_TIMER_PDELAYREQ
]);
pp_timer_start
(
(
1
<<
DSPOR
(
ppi
)
->
logMinPdelayReqInterval
)
*
1000
,
ppi
->
timers
[
PP_TIMER_PDELAYREQ
]);
}
if
(
st_com_check_record_update
(
ppi
))
...
...
proto-ext-whiterabbit/state-wr-calibrated.c
View file @
8f2add6b
...
...
@@ -13,7 +13,7 @@ int wr_calibrated(struct pp_instance *ppi, unsigned char *pkt, int plen)
if
(
ppi
->
is_new_state
)
{
DSPOR
(
ppi
)
->
wrPortState
=
WRS_CALIBRATED
;
ppi
->
next_delay
=
PP_DEFAULT_NEXT_DELAY_MS
;
pp_timer_start
(
DSPOR
(
ppi
)
->
wrStateTimeout
/
1000
,
pp_timer_start
(
DSPOR
(
ppi
)
->
wrStateTimeout
,
ppi
->
timers
[
PP_TIMER_WRS_CALIBRATED
]);
}
...
...
@@ -46,6 +46,6 @@ state_updated:
pp_timer_stop
(
ppi
->
timers
[
PP_TIMER_WRS_CALIBRATED
]);
ret:
ppi
->
next_delay
=
PP_DEFAULT_NEXT_DELAY_MS
;
ppi
->
next_delay
=
DSPOR
(
ppi
)
->
wrStateTimeout
;
return
0
;
}
proto-ext-whiterabbit/state-wr-calibration.c
View file @
8f2add6b
...
...
@@ -16,8 +16,11 @@ int wr_calibration(struct pp_instance *ppi, unsigned char *pkt, int plen)
DSPOR
(
ppi
)
->
wrPortState
=
WRS_CALIBRATION
;
e
=
msg_issue_wrsig
(
ppi
,
CALIBRATE
);
pp_timer_start
(
DSPOR
(
ppi
)
->
calPeriod
/
1000
,
pp_timer_start
(
DSPOR
(
ppi
)
->
calPeriod
,
ppi
->
timers
[
PP_TIMER_WRS_CALIBRATION
]);
if
(
DSPOR
(
ppi
)
->
calibrated
)
{
DSPOR
(
ppi
)
->
wrPortState
=
WRS_CALIBRATION_2
;
}
}
if
(
pp_timer_expired
(
ppi
->
timers
[
PP_TIMER_WRS_CALIBRATION
]))
{
...
...
@@ -127,7 +130,7 @@ state_updated:
if
(
ppi
->
next_state
!=
ppi
->
state
)
pp_timer_stop
(
ppi
->
timers
[
PP_TIMER_WRS_CALIBRATION
]);
ppi
->
next_delay
=
PP_DEFAULT_NEXT_DELAY_MS
;
ppi
->
next_delay
=
DSPOR
(
ppi
)
->
wrStateTimeout
;
return
e
;
}
proto-ext-whiterabbit/state-wr-locked.c
View file @
8f2add6b
...
...
@@ -14,7 +14,7 @@ int wr_locked(struct pp_instance *ppi, unsigned char *pkt, int plen)
if
(
ppi
->
is_new_state
)
{
DSPOR
(
ppi
)
->
portState
=
PPS_UNCALIBRATED
;
DSPOR
(
ppi
)
->
wrPortState
=
WRS_LOCKED
;
pp_timer_start
(
DSPOR
(
ppi
)
->
wrStateTimeout
/
1000
,
pp_timer_start
(
DSPOR
(
ppi
)
->
wrStateTimeout
,
ppi
->
timers
[
PP_TIMER_WRS_LOCKED
]);
e
=
msg_issue_wrsig
(
ppi
,
LOCKED
);
...
...
@@ -47,7 +47,7 @@ state_updated:
if
(
ppi
->
next_state
!=
ppi
->
state
)
pp_timer_stop
(
ppi
->
timers
[
PP_TIMER_WRS_LOCKED
]);
ppi
->
next_delay
=
PP_DEFAULT_NEXT_DELAY_MS
;
ppi
->
next_delay
=
DSPOR
(
ppi
)
->
wrStateTimeout
;
return
e
;
}
proto-ext-whiterabbit/state-wr-m-lock.c
View file @
8f2add6b
...
...
@@ -16,7 +16,7 @@ int wr_m_lock(struct pp_instance *ppi, unsigned char *pkt, int plen)
DSPOR
(
ppi
)
->
wrPortState
=
WRS_M_LOCK
;
DSPOR
(
ppi
)
->
wrMode
=
WR_MASTER
;
e
=
msg_issue_wrsig
(
ppi
,
LOCK
);
pp_timer_start
(
WR_M_LOCK_TIMEOUT_MS
/
1000
,
pp_timer_start
(
WR_M_LOCK_TIMEOUT_MS
,
ppi
->
timers
[
PP_TIMER_WRS_M_LOCK
]);
}
...
...
@@ -46,7 +46,7 @@ state_updated:
if
(
ppi
->
next_state
!=
ppi
->
state
)
pp_timer_stop
(
ppi
->
timers
[
PP_TIMER_WRS_M_LOCK
]);
ppi
->
next_delay
=
PP_DEFAULT_NEXT_DELAY_MS
;
ppi
->
next_delay
=
DSPOR
(
ppi
)
->
wrStateTimeout
;
return
e
;
}
proto-ext-whiterabbit/state-wr-present.c
View file @
8f2add6b
...
...
@@ -17,7 +17,7 @@ int wr_present(struct pp_instance *ppi, unsigned char *pkt, int plen)
DSPOR
(
ppi
)
->
portState
=
PPS_UNCALIBRATED
;
DSPOR
(
ppi
)
->
wrPortState
=
WRS_PRESENT
;
DSPOR
(
ppi
)
->
wrMode
=
WR_SLAVE
;
pp_timer_start
(
DSPOR
(
ppi
)
->
wrStateTimeout
/
1000
,
pp_timer_start
(
DSPOR
(
ppi
)
->
wrStateTimeout
,
ppi
->
timers
[
PP_TIMER_WRS_PRESENT
]);
st_com_restart_annrec_timer
(
ppi
);
e
=
msg_issue_wrsig
(
ppi
,
SLAVE_PRESENT
);
...
...
@@ -54,7 +54,7 @@ state_updated:
pp_timer_stop
(
ppi
->
timers
[
PP_TIMER_ANN_RECEIPT
]);
}
ppi
->
next_delay
=
PP_DEFAULT_NEXT_DELAY_MS
;
ppi
->
next_delay
=
DSPOR
(
ppi
)
->
wrStateTimeout
;
return
e
;
}
proto-ext-whiterabbit/state-wr-resp-calib-req.c
View file @
8f2add6b
...
...
@@ -14,14 +14,17 @@ int wr_resp_calib_req(struct pp_instance *ppi, unsigned char *pkt, int plen)
if
(
ppi
->
is_new_state
)
{
DSPOR
(
ppi
)
->
wrPortState
=
WRS_RESP_CALIB_REQ
;
ppi
->
next_delay
=
PP_DEFAULT_NEXT_DELAY_MS
;
if
(
DSPOR
(
ppi
)
->
otherNodeCalSendPattern
)
if
(
DSPOR
(
ppi
)
->
otherNodeCalSendPattern
)
{
wr_calibration_pattern_enable
(
ppi
,
0
,
0
,
0
);
pp_timer_start
(
WR_M_LOCK_TIMEOUT_MS
/
1000
,
ppi
->
timers
[
PP_TIMER_WRS_RESP_CALIB_REQ
]);
pp_timer_start
(
DSPOR
(
ppi
)
->
otherNodeCalPeriod
/
1000
,
ppi
->
timers
[
PP_TIMER_WRS_RESP_CALIB_REQ
]);
}
}
if
(
pp_timer_expired
(
ppi
->
timers
[
PP_TIMER_WRS_RESP_CALIB_REQ
]))
{
if
((
DSPOR
(
ppi
)
->
otherNodeCalSendPattern
)
&&
(
pp_timer_expired
(
ppi
->
timers
[
PP_TIMER_WRS_RESP_CALIB_REQ
])))
{
if
(
DSPOR
(
ppi
)
->
wrMode
==
WR_MASTER
)
ppi
->
next_state
=
PPS_MASTER
;
else
...
...
@@ -53,7 +56,7 @@ state_updated:
if
(
ppi
->
next_state
!=
ppi
->
state
)
pp_timer_stop
(
ppi
->
timers
[
PP_TIMER_WRS_M_LOCK
]);
ppi
->
next_delay
=
PP_DEFAULT_NEXT_DELAY_MS
;
ppi
->
next_delay
=
DSPOR
(
ppi
)
->
wrStateTimeout
;
return
e
;
}
proto-ext-whiterabbit/state-wr-s-lock.c
View file @
8f2add6b
...
...
@@ -14,7 +14,7 @@ int wr_s_lock(struct pp_instance *ppi, unsigned char *pkt, int plen)
DSPOR
(
ppi
)
->
wrPortState
=
WRS_S_LOCK
;
ppi
->
next_delay
=
PP_DEFAULT_NEXT_DELAY_MS
;
wr_locking_enable
(
ppi
);
pp_timer_start
(
WR_S_LOCK_TIMEOUT_MS
/
1000
,
pp_timer_start
(
WR_S_LOCK_TIMEOUT_MS
,
ppi
->
timers
[
PP_TIMER_WRS_S_LOCK
]);
}
...
...
@@ -34,7 +34,7 @@ state_updated:
if
(
ppi
->
next_state
!=
ppi
->
state
)
pp_timer_stop
(
ppi
->
timers
[
PP_TIMER_WRS_S_LOCK
]);
ppi
->
next_delay
=
PP_DEFAULT_NEXT_DELAY_MS
;
ppi
->
next_delay
=
DSPOR
(
ppi
)
->
wrStateTimeout
;
return
e
;
}
proto-ext-whiterabbit/wr-constants.h
View file @
8f2add6b
...
...
@@ -22,7 +22,7 @@
#define WR_DEFAULT_CAL_PATTERN 0x3E0
/* 1111100000 */
#define WR_DEFAULT_CAL_PATTERN_LEN 0xA
/* 10 bits */
#define WR_DEFAULT_STATE_TIMEOUT_MS
2000
/* [ms] (was 300)
*/
#define WR_DEFAULT_STATE_TIMEOUT_MS
300
/* [ms]
*/
#define WR_M_LOCK_TIMEOUT_MS 10000
#define WR_S_LOCK_TIMEOUT_MS 10000
#define WR_DEFAULT_STATE_REPEAT 3
...
...
proto-standard/common-fun.c
View file @
8f2add6b
...
...
@@ -59,8 +59,8 @@ void st_com_restart_annrec_timer(struct pp_instance *ppi)
if
(
DSPOR
(
ppi
)
->
logAnnounceInterval
<
0
)
PP_PRINTF
(
"Error: logAnnounceInterval < 0"
);
pp_timer_start
((
DSPOR
(
ppi
)
->
announceReceiptTimeout
)
<<
DSPOR
(
ppi
)
->
logAnnounceInterval
,
pp_timer_start
((
(
DSPOR
(
ppi
)
->
announceReceiptTimeout
)
<<
DSPOR
(
ppi
)
->
logAnnounceInterval
)
*
1000
,
ppi
->
timers
[
PP_TIMER_ANN_RECEIPT
]);
}
...
...
proto-standard/state-master.c
View file @
8f2add6b
...
...
@@ -22,13 +22,14 @@ int pp_master(struct pp_instance *ppi, unsigned char *pkt, int plen)
if
(
ppi
->
is_new_state
)
{
DSPOR
(
ppi
)
->
portState
=
PPS_MASTER
;
pp_timer_start
(
1
<<
DSPOR
(
ppi
)
->
logSyncInterval
,
pp_timer_start
(
(
1
<<
DSPOR
(
ppi
)
->
logSyncInterval
)
*
1000
,
ppi
->
timers
[
PP_TIMER_SYNC
]);
pp_timer_start
(
1
<<
DSPOR
(
ppi
)
->
logAnnounceInterval
,
pp_timer_start
(
(
1
<<
DSPOR
(
ppi
)
->
logAnnounceInterval
)
*
1000
,
ppi
->
timers
[
PP_TIMER_ANN_INTERVAL
]);
pp_timer_start
(
1
<<
DSPOR
(
ppi
)
->
logMinPdelayReqInterval
,
pp_timer_start
(
(
1
<<
DSPOR
(
ppi
)
->
logMinPdelayReqInterval
)
*
1000
,
ppi
->
timers
[
PP_TIMER_PDELAYREQ
]);
/* Send an announce immediately, when becomes master */
if
(
msg_issue_announce
(
ppi
)
<
0
)
...
...
proto-standard/state-passive.c
View file @
8f2add6b
...
...
@@ -12,7 +12,8 @@ int pp_passive(struct pp_instance *ppi, unsigned char *pkt, int plen)
if
(
ppi
->
is_new_state
)
{
DSPOR
(
ppi
)
->
portState
=
PPS_PASSIVE
;
pp_timer_start
(
1
<<
DSPOR
(
ppi
)
->
logMinPdelayReqInterval
,
pp_timer_start
(
(
1
<<
DSPOR
(
ppi
)
->
logMinPdelayReqInterval
)
*
1000
,
ppi
->
timers
[
PP_TIMER_PDELAYREQ
]);
st_com_restart_annrec_timer
(
ppi
);
...
...
proto-standard/state-slave.c
View file @
8f2add6b
...
...
@@ -36,11 +36,13 @@ int pp_slave(struct pp_instance *ppi, unsigned char *pkt, int plen)
st_com_restart_annrec_timer
(
ppi
);
if
(
OPTS
(
ppi
)
->
e2e_mode
)
pp_timer_start
(
1
<<
DSPOR
(
ppi
)
->
logMinDelayReqInterval
,
ppi
->
timers
[
PP_TIMER_DELAYREQ
]);
pp_timer_start
(
(
1
<<
DSPOR
(
ppi
)
->
logMinDelayReqInterval
)
*
1000
,
ppi
->
timers
[
PP_TIMER_DELAYREQ
]);
else
pp_timer_start
(
1
<<
DSPOR
(
ppi
)
->
logMinPdelayReqInterval
,
ppi
->
timers
[
PP_TIMER_PDELAYREQ
]);
pp_timer_start
(
(
1
<<
DSPOR
(
ppi
)
->
logMinPdelayReqInterval
)
*
1000
,
ppi
->
timers
[
PP_TIMER_PDELAYREQ
]);
}
if
(
st_com_check_record_update
(
ppi
))
...
...
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