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
b8dcb5ae
Commit
b8dcb5ae
authored
Jul 09, 2012
by
Aurelio Colosimo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pps_gen_get_time: optimized for minimum register reads
parent
eb204b22
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
pps_gen.c
arch-spec/dev/pps_gen.c
+9
-11
No files found.
arch-spec/dev/pps_gen.c
View file @
b8dcb5ae
...
...
@@ -82,19 +82,17 @@ int pps_gen_busy()
void
pps_gen_get_time
(
uint32_t
*
utc
,
uint32_t
*
cntr_nsec
)
{
uint32_t
cyc_before
,
cyc_after
;
uint32_t
utc_lo
;
uint32_t
nsec
;
uint32_t
utc_lo
1
,
utc_lo2
;
do
{
cyc_before
=
PPSG
->
CNTR_NSEC
&
0xfffffff
;
utc_lo
=
PPSG
->
CNTR_UTCLO
;
cyc_after
=
PPSG
->
CNTR_NSEC
&
0xfffffff
;
}
while
(
cyc_after
<
cyc_before
)
;
utc_lo1
=
PPSG
->
CNTR_UTCLO
;
nsec
=
PPSG
->
CNTR_NSEC
&
0xfffffff
;
utc_lo2
=
PPSG
->
CNTR_UTCLO
;
if
(
utc_lo2
!=
utc_lo1
)
nsec
=
PPSG
->
CNTR_NSEC
&
0xfffffff
;
// delay(100000);
if
(
utc
)
*
utc
=
utc_lo
;
if
(
cntr_nsec
)
*
cntr_nsec
=
cyc_after
;
if
(
utc
)
*
utc
=
utc_lo2
;
if
(
cntr_nsec
)
*
cntr_nsec
=
nsec
;
}
...
...
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