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
ae60e238
Commit
ae60e238
authored
Jul 20, 2018
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
abscal: only start pps when we start sending frames
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
133bc42e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
hooks.c
proto-ext-whiterabbit/hooks.c
+16
-1
state-wr-abscal.c
proto-ext-whiterabbit/state-wr-abscal.c
+3
-0
No files found.
proto-ext-whiterabbit/hooks.c
View file @
ae60e238
...
...
@@ -3,6 +3,13 @@
#include "../proto-standard/common-fun.h"
/* ext-whiterabbit must offer its own hooks */
#ifdef CONFIG_ABSCAL
/* absolute calibration only exists in arch-wrpc, so far */
extern
int
ptp_mode
;
#else
#define ptp_mode 0
/* not WRC_MODE_ABSCAL, which is 4 */
#endif
static
int
wr_init
(
struct
pp_instance
*
ppi
,
unsigned
char
*
pkt
,
int
plen
)
{
...
...
@@ -16,7 +23,15 @@ static int wr_init(struct pp_instance *ppi, unsigned char *pkt, int plen)
wrp
->
parentWrModeOn
=
0
;
wrp
->
calibrated
=
!
WR_DEFAULT_PHY_CALIBRATION_REQUIRED
;
if
((
wrp
->
wrConfig
&
WR_M_AND_S
)
==
WR_M_ONLY
)
#ifdef CONFIG_ABSCAL
/* absolute calibration only exists in arch-wrpc, so far */
extern
int
ptp_mode
;
if
(
ptp_mode
==
4
/* WRC_MODE_ABSCAL */
)
ppi
->
next_state
=
WRS_WR_LINK_ON
;
#endif
if
((
wrp
->
wrConfig
&
WR_M_AND_S
)
==
WR_M_ONLY
&&
ptp_mode
!=
4
/* WRC_MODE_ABSCAL -- not defined in wrs build */
)
wrp
->
ops
->
enable_timing_output
(
ppi
,
1
);
else
wrp
->
ops
->
enable_timing_output
(
ppi
,
0
);
...
...
proto-ext-whiterabbit/state-wr-abscal.c
View file @
ae60e238
...
...
@@ -26,6 +26,7 @@ static int next_pps_ms(struct pp_instance *ppi, struct pp_time *t)
int
wr_abscal
(
struct
pp_instance
*
ppi
,
uint8_t
*
pkt
,
int
plen
)
{
struct
pp_time
t
;
struct
wr_dsport
*
wrp
=
WR_DSPOR
(
ppi
);
int
len
,
i
;
if
(
ppi
->
is_new_state
)
{
...
...
@@ -38,6 +39,8 @@ int wr_abscal(struct pp_instance *ppi, uint8_t *pkt, int plen)
if
(
pp_timeout
(
ppi
,
PP_TO_EXT_0
))
{
uint64_t
secs
=
t
.
secs
;
wrp
->
ops
->
enable_timing_output
(
ppi
,
1
);
/* Wait for the second to tick */
while
(
ppi
->
t_ops
->
get
(
ppi
,
&
t
),
t
.
secs
==
secs
)
;
...
...
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