Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
Mock Turtle
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
Mock Turtle
Commits
0aab136f
Commit
0aab136f
authored
Jul 28, 2015
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrtd:rt: fix condition assign
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
6d99061f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
22 deletions
+21
-22
rt-fd.c
applications/wrtd/rt/fd/rt-fd.c
+21
-22
No files found.
applications/wrtd/rt/fd/rt-fd.c
View file @
0aab136f
...
...
@@ -804,16 +804,18 @@ static inline void ctl_trig_assign (uint32_t seq, struct wrnc_msg *ibuf)
uint32_t
id_trigger_handle
=
WRTD_REP_TRIGGER_HANDLE
;
int
ch
,
is_cond
;
struct
wrnc_msg
obuf
;
struct
wrtd_trig_id
id
;
struct
wrtd_trig_id
id
,
cond
;
struct
lrt_output_rule
rule
;
struct
lrt_trigger_handle
handle
;
struct
lrt_trigger_handle
handle
=
{
NULL
,
NULL
,
0
,
0
}
;
struct
lrt_output
*
out
;
wrnc_msg_int32
(
ibuf
,
&
ch
);
handle
.
channel
=
ch
;
/* Get the trigger ID (direct) */
wrtd_msg_trig_id
(
ibuf
,
&
id
);
wrnc_msg_int32
(
ibuf
,
&
is_cond
);
wrtd_msg_trig_id
(
ibuf
,
&
cond
);
int
n_req
=
is_cond
?
2
:
1
;
...
...
@@ -822,13 +824,26 @@ static inline void ctl_trig_assign (uint32_t seq, struct wrnc_msg *ibuf)
ctl_nack
(
seq
,
-
1
);
return
;
}
/* Set condition trigger */
if
(
is_cond
)
{
memset
(
&
rule
,
0
,
sizeof
(
struct
lrt_output_rule
));
rule
.
delay_cycles
=
100000000
/
8000
;
rule
.
state
=
HASH_ENT_CONDITION
|
HASH_ENT_DISABLED
;
handle
.
cond
=
rtfd_trigger_entry_update
(
&
cond
,
ch
,
&
rule
);
}
/* Create an empty rule with default edelay of 100 us */
memset
(
&
rule
,
0
,
sizeof
(
struct
lrt_output_rule
));
rule
.
delay_cycles
=
100000000
/
8000
;
rule
.
state
=
(
is_cond
?
HASH_ENT_CONDITIONAL
:
HASH_ENT_DIRECT
)
|
HASH_ENT_DISABLED
;
handle
.
channel
=
ch
;
handle
.
cond
=
NULL
;
rule
.
state
|=
HASH_ENT_DISABLED
;
if
(
is_cond
)
{
rule
.
state
|=
HASH_ENT_CONDITIONAL
;
rule
.
cond_ptr
=
&
handle
.
cond
->
ocfg
[
ch
];
}
else
{
rule
.
state
|=
HASH_ENT_DIRECT
;
rule
.
cond_ptr
=
NULL
;
}
handle
.
trig
=
rtfd_trigger_entry_update
(
&
id
,
ch
,
&
rule
);
/* Notify that there is at least one trigger
...
...
@@ -836,22 +851,6 @@ static inline void ctl_trig_assign (uint32_t seq, struct wrnc_msg *ibuf)
out
=
&
outputs
[
ch
];
out
->
flags
|=
WRTD_TRIGGER_ASSIGNED
;
if
(
!
is_cond
)
// unconditional trigger
goto
out
;
/* Get the condition ID */
wrtd_msg_trig_id
(
ibuf
,
&
id
);
/* Create default conditional rule */
rule
.
delay_cycles
=
100000000
/
8000
;
rule
.
delay_frac
=
0
;
rule
.
state
=
HASH_ENT_CONDITION
|
HASH_ENT_DISABLED
;
rule
.
cond_ptr
=
(
struct
lrt_output_rule
*
)
handle
.
trig
;
handle
.
cond
=
rtfd_trigger_entry_update
(
&
id
,
ch
,
&
rule
);
out:
/* Create the response */
obuf
=
ctl_claim_out_buf
();
wrnc_msg_header
(
&
obuf
,
&
id_trigger_handle
,
&
seq
);
...
...
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