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
9ce60c0e
Commit
9ce60c0e
authored
Jun 30, 2015
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrtd:rt: make assign_trigger function more readable
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
d359e690
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
14 deletions
+7
-14
rt-fd.c
applications/wrtd/rt/fd/rt-fd.c
+7
-14
No files found.
applications/wrtd/rt/fd/rt-fd.c
View file @
9ce60c0e
...
...
@@ -590,7 +590,9 @@ static inline void ctl_chan_enable (uint32_t seq, struct wrnc_msg *ibuf)
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
lrt_output_rule
rule
;
struct
lrt_trigger_handle
handle
;
...
...
@@ -624,21 +626,8 @@ static inline void ctl_trig_assign (uint32_t seq, struct wrnc_msg *ibuf)
out
=
&
outputs
[
ch
];
out
->
flags
|=
WRTD_TRIGGER_ASSIGNED
;
struct
wrnc_msg
obuf
=
ctl_claim_out_buf
();
uint32_t
id_trigger_handle
=
WRTD_REP_TRIGGER_HANDLE
;
/* Create the response */
wrnc_msg_header
(
&
obuf
,
&
id_trigger_handle
,
&
seq
);
if
(
!
is_cond
)
// unconditional trigger
{
wrnc_msg_int32
(
&
obuf
,
&
handle
.
channel
);
wrnc_msg_uint32
(
&
obuf
,
(
uint32_t
*
)
&
handle
.
cond
);
wrnc_msg_uint32
(
&
obuf
,
(
uint32_t
*
)
&
handle
.
trig
);
hmq_msg_send
(
&
obuf
);
return
;
}
goto
out
;
/* Get the condition ID */
wrtd_msg_trig_id
(
ibuf
,
&
id
);
...
...
@@ -652,6 +641,10 @@ static inline void ctl_trig_assign (uint32_t seq, struct wrnc_msg *ibuf)
handle
.
cond
=
hash_add
(
&
id
,
ch
,
&
rule
);
out:
/* Create the response */
obuf
=
ctl_claim_out_buf
();
wrnc_msg_header
(
&
obuf
,
&
id_trigger_handle
,
&
seq
);
wrnc_msg_int32
(
&
obuf
,
&
handle
.
channel
);
wrnc_msg_uint32
(
&
obuf
,
(
uint32_t
*
)
&
handle
.
cond
);
wrnc_msg_uint32
(
&
obuf
,
(
uint32_t
*
)
&
handle
.
trig
);
...
...
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