Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Software for White Rabbit PTP Core
Manage
Activity
Members
Labels
Plan
Issues
39
Issue boards
Milestones
Wiki
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
Software for White Rabbit PTP Core
Commits
c0b2a8ad
Commit
c0b2a8ad
authored
12 years ago
by
Alessandro Rubini
Browse files
Options
Downloads
Patches
Plain Diff
warnings: kill all warnings in pps_gen.[ch]
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
1459a6d5
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dev/pps_gen.c
+3
-7
3 additions, 7 deletions
dev/pps_gen.c
include/pps_gen.h
+6
-6
6 additions, 6 deletions
include/pps_gen.h
include/wrc.h
+4
-0
4 additions, 0 deletions
include/wrc.h
with
13 additions
and
13 deletions
dev/pps_gen.c
+
3
−
7
View file @
c0b2a8ad
#include
<wrc.h>
#include
"board.h"
#include
"pps_gen.h"
...
...
@@ -18,7 +19,7 @@
#define ppsg_read(reg) \
*(volatile uint32_t *) (BASE_PPS_GEN + (offsetof(struct PPSG_WB, reg)))
int
pps_gen_init
()
void
pps_gen_init
()
{
uint32_t
cr
;
...
...
@@ -38,8 +39,6 @@ int pps_gen_init()
/* Adjusts the nanosecond (refclk cycle) counter by atomically adding (how_much) cycles. */
int
pps_gen_adjust
(
int
counter
,
int64_t
how_much
)
{
uint32_t
cr
;
TRACE_DEV
(
"Adjust: counter = %s [%c%d]
\n
"
,
counter
==
PPSG_ADJUST_SEC
?
"seconds"
:
"nanoseconds"
,
how_much
<
0
?
'-'
:
'+'
,
(
int32_t
)
abs
(
how_much
));
...
...
@@ -61,10 +60,8 @@ int pps_gen_adjust(int counter, int64_t how_much)
}
/* 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_UTCHI
,
(
uint32_t
)
(
seconds
>>
32
)
&
0xff
);
ppsg_write
(
ADJ_NSEC
,
...
...
@@ -72,7 +69,6 @@ int pps_gen_set_time(uint64_t seconds, uint32_t nanoseconds)
(
int64_t
)
REF_CLOCK_PERIOD_PS
));
ppsg_write
(
CR
,
(
ppsg_read
(
CR
)
&
0xfffffffb
)
|
PPSG_CR_CNT_SET
);
return
0
;
}
uint64_t
pps_get_utc
(
void
)
...
...
This diff is collapsed.
Click to expand it.
include/pps_gen.h
+
6
−
6
View file @
c0b2a8ad
...
...
@@ -7,21 +7,21 @@
#define PPSG_ADJUST_NSEC 0x2
/* 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 */
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 */
int
shw_
pps_gen_busy
();
int
pps_gen_busy
(
void
);
/* 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>. */
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>. */
void
shw_
pps_gen_set_time
(
uint64_t
seconds
,
uint32_t
nanoseconds
);
void
pps_gen_set_time
(
uint64_t
seconds
,
uint32_t
nanoseconds
);
#endif
This diff is collapsed.
Click to expand it.
include/wrc.h
+
4
−
0
View file @
c0b2a8ad
...
...
@@ -12,6 +12,10 @@ int mprintf(char const *format, ...)
int
wrc_mon_gui
(
void
);
/* This is in the library, somewhere */
extern
int
abs
(
int
val
);
/* The following from ptp-noposix */
extern
void
wr_servo_reset
(
void
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment