Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC TDC 1ns 5cha - 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 TDC 1ns 5cha - Software
Commits
5b333eb5
Commit
5b333eb5
authored
Oct 16, 2012
by
Samuel Iglesias Gonsálvez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tdc: fix error in pulse width calculation
Signed-off-by:
Samuel Iglesias Gonsalvez
<
siglesias@igalia.com
>
parent
7460f9a8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
tdc-fmc.c
drivers/tdc-fmc.c
+9
-3
No files found.
drivers/tdc-fmc.c
View file @
5b333eb5
...
...
@@ -90,20 +90,26 @@ static int tdc_fmc_check_lost_events(u32 curr_wr_ptr, u32 prev_wr_ptr, int *coun
static
inline
int
tdc_is_valid_pulse_width
(
struct
tdc_event
rising
,
struct
tdc_event
falling
)
{
int
diff
;
diff
=
falling
.
fine_time
-
rising
.
fine_time
;
/* Check pulse width from smaller to bigger quantities. */
if
(
likely
(
rising
.
fine_time
<
(
falling
.
fine_time
-
124
)
))
{
if
(
likely
(
diff
>
124
))
{
/* Valid pulse width (higher or equal to 100 ns) */
return
1
;
}
else
{
if
(
likely
(
rising
.
coarse_time
<
(
falling
.
coarse_time
-
13
)))
diff
=
falling
.
coarse_time
-
rising
.
coarse_time
;
if
(
likely
(
diff
>
13
))
{
/* Valid pulse width (higher or equal to 100 ns) */
return
1
;
}
else
{
if
(
likely
(
rising
.
local_utc
<
(
falling
.
local_utc
-
1
)))
diff
=
falling
.
local_utc
-
rising
.
local_utc
;
if
(
likely
(
diff
>
1
))
{
/* Valid pulse width (higher or equal to 100 ns) */
return
1
;
}
}
}
...
...
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