Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 4cha - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
FMC DEL 1ns 4cha - Software
Commits
661065d7
Commit
661065d7
authored
May 04, 2012
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fd-zio: use zero_offset for delay output
parent
6155e5de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
1 deletion
+24
-1
fd-zio.c
fd-zio.c
+24
-1
No files found.
fd-zio.c
View file @
661065d7
...
...
@@ -274,6 +274,7 @@ static int fd_zio_conf_set(struct device *dev, struct zio_attribute *zattr,
* We are over with attributes, now there's real I/O
*/
/* Subtract an offset (used for the input timestamp) */
static
void
fd_ts_sub
(
struct
fd_time
*
t
,
uint64_t
pico
)
{
uint32_t
coarse
,
frac
;
...
...
@@ -393,7 +394,29 @@ static void __fd_zio_output(struct spec_fd *fd, int index1_4, uint32_t *attrs)
}
if
(
mode
==
FD_OUT_MODE_DELAY
)
{
/* FIXME: subtract zero offset */
uint32_t
coarse
,
frac
;
/* To use fd_ts_sub(), but I'd need to convert twice */
fd_split_pico
(
fd
->
calib
.
zero_offset
[
ch
],
&
coarse
,
&
frac
);
if
(
attrs
[
FD_ATTR_OUT_START_FINE
]
>=
frac
)
{
attrs
[
FD_ATTR_OUT_START_FINE
]
-=
frac
;
}
else
{
attrs
[
FD_ATTR_OUT_START_FINE
]
+=
4096
;
attrs
[
FD_ATTR_OUT_START_FINE
]
-=
frac
;
coarse
++
;
}
if
(
attrs
[
FD_ATTR_OUT_START_COARSE
]
>=
coarse
)
{
attrs
[
FD_ATTR_OUT_START_COARSE
]
-=
coarse
;
}
else
{
attrs
[
FD_ATTR_OUT_START_COARSE
]
+=
125
*
1000
*
1000
;
attrs
[
FD_ATTR_OUT_START_COARSE
]
-=
coarse
;
if
(
likely
(
attrs
[
FD_ATTR_OUT_START_L
]
!=
0
))
{
attrs
[
FD_ATTR_OUT_START_L
]
--
;
}
else
{
attrs
[
FD_ATTR_OUT_START_L
]
=
~
0
;
attrs
[
FD_ATTR_OUT_START_H
]
--
;
}
}
}
fd_ch_writel
(
fd
,
ch
,
fd
->
ch
[
ch
].
frr_cur
,
FD_REG_FRR
);
...
...
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