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
52300c09
Commit
52300c09
authored
Jan 25, 2021
by
Adam Wujek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
arch-wrpc: add setting of an offset
Signed-off-by:
Adam Wujek
<
adam.wujek@creotech.pl
>
parent
2dbbf69c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
7 deletions
+24
-7
wrc_ptp_ppsi.c
arch-wrpc/wrc_ptp_ppsi.c
+14
-2
wrpc.h
arch-wrpc/wrpc.h
+4
-0
wrpc-time.c
time-wrpc/wrpc-time.c
+6
-5
No files found.
arch-wrpc/wrc_ptp_ppsi.c
View file @
52300c09
...
...
@@ -121,8 +121,6 @@ int wrc_ptp_init()
pp_printf
(
"PPSi for WRPC. Commit %s, built on "
__DATE__
"
\n
"
,
PPSI_VERSION
);
ppg
->
timePropertiesDS
->
currentUtcOffset
=
CONFIG_LEAP_SECONDS_VAL
;
/* copy default ppi config */
memcpy
(
&
ppi
->
cfg
,
&
__pp_default_instance_cfg
,
sizeof
(
__pp_default_instance_cfg
));
ppi
->
ext_hooks
=&
pp_hooks
;
/* default value */
...
...
@@ -410,3 +408,17 @@ int wrc_pps_force(wrpc_pps_force_t action)
wrpc_enable_timing_output
(
ppg
,
2
);
return
action
&
1
;
}
void
wrc_ptp_set_leapsec
(
int
leapsec
)
{
TOPS
(
INST
(
ppg
,
0
))
->
set_utc_offset
(
NULL
,
leapsec
,
0
,
0
);
}
void
wrc_ptp_get_leapsec
(
int
*
ptp
,
int
*
system
)
{
int
tmp
;
*
ptp
=
ppg
->
timePropertiesDS
->
currentUtcOffset
;
TOPS
(
INST
(
ppg
,
0
))
->
get_utc_offset
(
NULL
,
system
,
&
tmp
,
&
tmp
);
return
;
}
arch-wrpc/wrpc.h
View file @
52300c09
...
...
@@ -72,6 +72,10 @@ int wrc_ptp_bmc_update(void);
int
wrc_ptp_link_down
(
void
);
int
wrc_pps_force
(
wrpc_pps_force_t
action
);
int
wrpc_get_GM_lock_state
(
struct
pp_globals
*
ppg
,
pp_timing_mode_state_t
*
state
);
void
wrc_ptp_set_leapsec
(
int
leapsec
);
void
wrc_ptp_get_leapsec
(
int
*
ptp
,
int
*
system
);
/* wrpc-calibration.c */
...
...
time-wrpc/wrpc-time.c
View file @
52300c09
...
...
@@ -10,6 +10,8 @@
#include "dev/syscon.h"
/* in wrpc-sw */
#include "../arch-wrpc/wrpc.h"
static
int
utcOffset
=
CONFIG_LEAP_SECONDS_VAL
;
static
int
wrpc_time_get_utc_time
(
struct
pp_instance
*
ppi
,
int
*
hours
,
int
*
minutes
,
int
*
seconds
)
{
/* no UTC time */
...
...
@@ -21,17 +23,16 @@ static int wrpc_time_get_utc_time(struct pp_instance *ppi, int *hours, int *minu
static
int
wrpc_time_get_utc_offset
(
struct
pp_instance
*
ppi
,
int
*
offset
,
int
*
leap59
,
int
*
leap61
)
{
/* no UTC offset */
*
leap59
=
0
;
*
leap61
=
0
;
*
offset
=
0
;
return
-
1
;
*
offset
=
utcOffset
;
return
0
;
}
static
int
wrpc_time_set_utc_offset
(
struct
pp_instance
*
ppi
,
int
offset
,
int
leap59
,
int
leap61
)
{
/* no UTC offset */
return
-
1
;
utcOffset
=
offset
;
return
0
;
}
static
int
wrpc_time_get
(
struct
pp_instance
*
ppi
,
struct
pp_time
*
t
)
...
...
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