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
e0287c64
Commit
e0287c64
authored
Jun 07, 2016
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrtd:rt: fix handle WR status flag
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
6affa246
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
9 deletions
+19
-9
wrtd-rt-fd.c
applications/wrtd/rt/fd/wrtd-rt-fd.c
+14
-9
wrtd-rt-tdc.c
applications/wrtd/rt/tdc/wrtd-rt-tdc.c
+5
-0
No files found.
applications/wrtd/rt/fd/wrtd-rt-fd.c
View file @
e0287c64
...
...
@@ -33,6 +33,14 @@ static uint32_t promiscuous_mode = 0;
struct
rt_application
app
;
struct
wrtd_out_trigger
triggers
[
FD_HASH_ENTRIES
];
/**< list of triggers */
struct
wrtd_out_trigger
*
ht
[
FD_HASH_ENTRIES
];
/* hash table */
unsigned
int
tlist_count
=
0
;
/**< number of valid trigger entry
in tlist */
static
struct
wrtd_out_channel
wrtd_out_channels
[
FD_NUM_CHANNELS
];
/**< Output
state
array */
static
struct
wrtd_out
wrtd_out_device
;
#define WR_LINK_OFFLINE 1
#define WR_LINK_ONLINE 2
...
...
@@ -69,8 +77,12 @@ void wr_enable_lock(int enable)
*/
void
wr_update_link
(
void
)
{
int
i
;
switch
(
wr_state
)
{
case
WR_LINK_OFFLINE
:
for
(
i
=
0
;
i
<
FD_NUM_CHANNELS
;
i
++
)
wrtd_out_channels
[
i
].
config
.
flags
|=
WRTD_NO_WR
;
if
(
wr_link_up
())
wr_state
=
WR_LINK_ONLINE
;
break
;
...
...
@@ -87,6 +99,8 @@ void wr_update_link(void)
}
break
;
case
WR_LINK_SYNCED
:
for
(
i
=
0
;
i
<
FD_NUM_CHANNELS
;
i
++
)
wrtd_out_channels
[
i
].
config
.
flags
&=
~
WRTD_NO_WR
;
break
;
}
...
...
@@ -103,15 +117,6 @@ int wr_is_timing_ok()
}
struct
wrtd_out_trigger
triggers
[
FD_HASH_ENTRIES
];
/**< list of triggers */
struct
wrtd_out_trigger
*
ht
[
FD_HASH_ENTRIES
];
/* hash table */
unsigned
int
tlist_count
=
0
;
/**< number of valid trigger entry
in tlist */
static
struct
wrtd_out_channel
wrtd_out_channels
[
FD_NUM_CHANNELS
];
/**< Output
state
array */
static
struct
wrtd_out
wrtd_out_device
;
/**
* Writes to FD output registers for output (out)
*/
...
...
applications/wrtd/rt/tdc/wrtd-rt-tdc.c
View file @
e0287c64
...
...
@@ -314,9 +314,12 @@ void wr_enable_lock(int enable)
*/
void
wr_update_link
(
void
)
{
int
i
;
switch
(
wr_state
)
{
case
WR_LINK_OFFLINE
:
for
(
i
=
0
;
i
<
TDC_NUM_CHANNELS
;
i
++
)
wrtd_in_channels
[
i
].
config
.
flags
|=
WRTD_NO_WR
;
if
(
wr_link_up
())
wr_state
=
WR_LINK_ONLINE
;
break
;
...
...
@@ -340,6 +343,8 @@ void wr_update_link(void)
}
break
;
case
WR_LINK_SYNCED
:
for
(
i
=
0
;
i
<
TDC_NUM_CHANNELS
;
i
++
)
wrtd_in_channels
[
i
].
config
.
flags
&=
~
WRTD_NO_WR
;
break
;
}
...
...
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