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
7
Merge Requests
7
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
5a4de885
Commit
5a4de885
authored
Aug 04, 2023
by
Vincent van Beveren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed overflow issue in pps_gen_utc
parent
e3af54f4
Pipeline
#4854
failed with stages
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
pps_gen.c
dev/pps_gen.c
+9
-1
No files found.
dev/pps_gen.c
View file @
5a4de885
...
...
@@ -85,11 +85,19 @@ void shw_pps_gen_set_time(uint64_t seconds, uint32_t nanoseconds, int counter)
static
uint64_t
pps_get_utc
(
void
)
{
uint64_t
out
;
uint32_t
low
,
high
;
uint32_t
low
,
low2
,
high
;
low
=
ppsg_read
(
CNTR_UTCLO
);
high
=
ppsg_read
(
CNTR_UTCHI
);
// check for wrap, if so, re-read registers
low2
=
ppsg_read
(
CNTR_UTCLO
);
if
(
low2
<
low
)
{
high
=
ppsg_read
(
CNTR_UTCHI
);
low
=
low2
;
}
high
&=
0xFF
;
/* CNTR_UTCHI has only 8 bits defined -- rest are HDL don't care */
out
=
(
uint64_t
)
low
|
(
uint64_t
)
high
<<
32
;
...
...
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