Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Trigger Distribution
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
White Rabbit Trigger Distribution
Commits
39ccbd44
Commit
39ccbd44
authored
Sep 07, 2018
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fw:fd: minor refactoring, add comments.
parent
54068117
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
wrtd-rt-fd.c
software/firmware/fd/wrtd-rt-fd.c
+15
-10
No files found.
software/firmware/fd/wrtd-rt-fd.c
View file @
39ccbd44
...
...
@@ -182,10 +182,11 @@ static void ts_adjust_delay(struct wr_timestamp *ts, uint32_t cycles, uint32_t f
{
ts
->
frac
+=
frac
;
if
(
ts
->
frac
&
0x1000
)
if
(
ts
->
frac
&
0x1000
)
{
ts
->
ticks
++
;
ts
->
frac
&=
0xfff
;
}
ts
->
frac
&=
0xfff
;
ts
->
ticks
+=
cycles
;
if
(
ts
->
ticks
>=
125000000
)
{
...
...
@@ -347,11 +348,13 @@ static int check_output_timeout (struct wrtd_out_channel *out)
out
->
stats
.
last_programmed
.
ticks
);
}
delta
=
tc
.
seconds
-
out
->
stats
.
last_programmed
.
seconds
;
delta
*=
125
*
1000
*
1000
;
delta
+=
tc
.
ticks
-
out
->
stats
.
last_programmed
.
ticks
;
/* Current time exceeds FD setpoint? */
delta
=
tc
.
seconds
-
out
->
stats
.
last_programmed
.
seconds
;
if
(
delta
!=
0
)
return
delta
>
0
;
delta
=
tc
.
ticks
-
out
->
stats
.
last_programmed
.
ticks
;
return
(
delta
>
0
);
}
...
...
@@ -398,14 +401,14 @@ static void drop_trigger(struct wrtd_out_channel *out,
/* Drop the pulse */
pulse_queue_pop
(
q
);
pq_ent
->
rule
->
misses
++
;
pq_ent
->
rule
->
misses
++
;
switch
(
reason
)
{
case
WRTD_MISS_TIMEOUT
:
out
->
stats
.
miss_timeout
++
;
break
;
case
WRTD_MISS_NO_WR
:
out
->
stats
.
miss_no_timing
++
;
out
->
stats
.
miss_no_timing
++
;
break
;
}
...
...
@@ -439,8 +442,10 @@ static void do_output (struct wrtd_out_channel *out)
}
else
if
(
!
(
dcr
&
FD_DCR_PG_TRIG
))
{
/* Nope, armed but still waiting for trigger */
if
(
check_output_timeout
(
out
))
if
(
check_output_timeout
(
out
))
{
/* Will never trigger. Missed. */
drop_trigger
(
out
,
pq_ent
,
q
,
WRTD_MISS_TIMEOUT
);
}
}
else
{
out
->
stats
.
last_executed
=
pq_ent
->
trig
;
if
(
pq_ent
->
rule
)
...
...
@@ -490,7 +495,7 @@ static void do_output (struct wrtd_out_channel *out)
fd_ch_writel
(
out
,
FD_DCR_MODE
|
FD_DCR_PG_ARM
|
FD_DCR_ENABLE
,
FD_REG_DCR
);
ts
->
ticks
+=
1000
;
ts
->
ticks
+=
1000
;
/* 8ns */
if
(
ts
->
ticks
>=
125000000
)
{
ts
->
ticks
-=
125000000
;
ts
->
seconds
++
;
...
...
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