Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Schedules
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
Software for White Rabbit PTP Core
Commits
c0b2a8ad
Commit
c0b2a8ad
authored
Oct 20, 2012
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
warnings: kill all warnings in pps_gen.[ch]
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
1459a6d5
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
13 deletions
+13
-13
pps_gen.c
dev/pps_gen.c
+3
-7
pps_gen.h
include/pps_gen.h
+6
-6
wrc.h
include/wrc.h
+4
-0
No files found.
dev/pps_gen.c
View file @
c0b2a8ad
#include <wrc.h>
#include "board.h"
#include "board.h"
#include "pps_gen.h"
#include "pps_gen.h"
...
@@ -18,7 +19,7 @@
...
@@ -18,7 +19,7 @@
#define ppsg_read(reg) \
#define ppsg_read(reg) \
*(volatile uint32_t *) (BASE_PPS_GEN + (offsetof(struct PPSG_WB, reg)))
*(volatile uint32_t *) (BASE_PPS_GEN + (offsetof(struct PPSG_WB, reg)))
int
pps_gen_init
()
void
pps_gen_init
()
{
{
uint32_t
cr
;
uint32_t
cr
;
...
@@ -38,8 +39,6 @@ int pps_gen_init()
...
@@ -38,8 +39,6 @@ int pps_gen_init()
/* Adjusts the nanosecond (refclk cycle) counter by atomically adding (how_much) cycles. */
/* Adjusts the nanosecond (refclk cycle) counter by atomically adding (how_much) cycles. */
int
pps_gen_adjust
(
int
counter
,
int64_t
how_much
)
int
pps_gen_adjust
(
int
counter
,
int64_t
how_much
)
{
{
uint32_t
cr
;
TRACE_DEV
(
"Adjust: counter = %s [%c%d]
\n
"
,
TRACE_DEV
(
"Adjust: counter = %s [%c%d]
\n
"
,
counter
==
PPSG_ADJUST_SEC
?
"seconds"
:
"nanoseconds"
,
counter
==
PPSG_ADJUST_SEC
?
"seconds"
:
"nanoseconds"
,
how_much
<
0
?
'-'
:
'+'
,
(
int32_t
)
abs
(
how_much
));
how_much
<
0
?
'-'
:
'+'
,
(
int32_t
)
abs
(
how_much
));
...
@@ -61,10 +60,8 @@ int pps_gen_adjust(int counter, int64_t how_much)
...
@@ -61,10 +60,8 @@ int pps_gen_adjust(int counter, int64_t how_much)
}
}
/* Sets the current time */
/* Sets the current time */
int
pps_gen_set_time
(
uint64_t
seconds
,
uint32_t
nanoseconds
)
void
pps_gen_set_time
(
uint64_t
seconds
,
uint32_t
nanoseconds
)
{
{
uint32_t
cr
;
ppsg_write
(
ADJ_UTCLO
,
(
uint32_t
)
(
seconds
&
0xffffffffLL
));
ppsg_write
(
ADJ_UTCLO
,
(
uint32_t
)
(
seconds
&
0xffffffffLL
));
ppsg_write
(
ADJ_UTCHI
,
(
uint32_t
)
(
seconds
>>
32
)
&
0xff
);
ppsg_write
(
ADJ_UTCHI
,
(
uint32_t
)
(
seconds
>>
32
)
&
0xff
);
ppsg_write
(
ADJ_NSEC
,
ppsg_write
(
ADJ_NSEC
,
...
@@ -72,7 +69,6 @@ int pps_gen_set_time(uint64_t seconds, uint32_t nanoseconds)
...
@@ -72,7 +69,6 @@ int pps_gen_set_time(uint64_t seconds, uint32_t nanoseconds)
(
int64_t
)
REF_CLOCK_PERIOD_PS
));
(
int64_t
)
REF_CLOCK_PERIOD_PS
));
ppsg_write
(
CR
,
(
ppsg_read
(
CR
)
&
0xfffffffb
)
|
PPSG_CR_CNT_SET
);
ppsg_write
(
CR
,
(
ppsg_read
(
CR
)
&
0xfffffffb
)
|
PPSG_CR_CNT_SET
);
return
0
;
}
}
uint64_t
pps_get_utc
(
void
)
uint64_t
pps_get_utc
(
void
)
...
...
include/pps_gen.h
View file @
c0b2a8ad
...
@@ -7,21 +7,21 @@
...
@@ -7,21 +7,21 @@
#define PPSG_ADJUST_NSEC 0x2
#define PPSG_ADJUST_NSEC 0x2
/* Initializes the PPS Generator. 0 on success, negative on failure. */
/* Initializes the PPS Generator. 0 on success, negative on failure. */
int
shw_pps_gen_init
(
);
void
pps_gen_init
(
void
);
/* Adjusts the <counter> (PPSG_ADJUST_SEC/NSEC) by (how_much) seconds/nanoseconds */
/* Adjusts the <counter> (PPSG_ADJUST_SEC/NSEC) by (how_much) seconds/nanoseconds */
int
shw_
pps_gen_adjust
(
int
counter
,
int64_t
how_much
);
int
pps_gen_adjust
(
int
counter
,
int64_t
how_much
);
/* Returns 1 when the PPS is busy adjusting its time counters, 0 if PPS gen idle */
/* Returns 1 when the PPS is busy adjusting its time counters, 0 if PPS gen idle */
int
shw_pps_gen_busy
(
);
int
pps_gen_busy
(
void
);
/* Enables/disables PPS Generator PPS output */
/* Enables/disables PPS Generator PPS output */
int
shw_
pps_gen_enable_output
(
int
enable
);
int
pps_gen_enable_output
(
int
enable
);
/* Reads the current time and stores at <seconds,nanoseconds>. */
/* Reads the current time and stores at <seconds,nanoseconds>. */
void
shw_
pps_gen_get_time
(
uint64_t
*
seconds
,
uint32_t
*
nanoseconds
);
void
pps_gen_get_time
(
uint64_t
*
seconds
,
uint32_t
*
nanoseconds
);
/* Sets the time to <seconds,nanoseconds>. */
/* Sets the time to <seconds,nanoseconds>. */
void
shw_
pps_gen_set_time
(
uint64_t
seconds
,
uint32_t
nanoseconds
);
void
pps_gen_set_time
(
uint64_t
seconds
,
uint32_t
nanoseconds
);
#endif
#endif
include/wrc.h
View file @
c0b2a8ad
...
@@ -12,6 +12,10 @@ int mprintf(char const *format, ...)
...
@@ -12,6 +12,10 @@ int mprintf(char const *format, ...)
int
wrc_mon_gui
(
void
);
int
wrc_mon_gui
(
void
);
/* This is in the library, somewhere */
extern
int
abs
(
int
val
);
/* The following from ptp-noposix */
/* The following from ptp-noposix */
extern
void
wr_servo_reset
(
void
);
extern
void
wr_servo_reset
(
void
);
...
...
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