Commit 1e04c120 authored by Federico Vaga's avatar Federico Vaga

wrtd:rt: fix handle WR status flag

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>


NOTE
This commit has been created by `git subtree` on the Mock Turtle repository
on tag mock-turtle-2.0

This commit will not compile
parent 134495be
...@@ -33,6 +33,14 @@ static uint32_t promiscuous_mode = 0; ...@@ -33,6 +33,14 @@ static uint32_t promiscuous_mode = 0;
struct rt_application app; 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_OFFLINE 1
#define WR_LINK_ONLINE 2 #define WR_LINK_ONLINE 2
...@@ -69,8 +77,12 @@ void wr_enable_lock(int enable) ...@@ -69,8 +77,12 @@ void wr_enable_lock(int enable)
*/ */
void wr_update_link(void) void wr_update_link(void)
{ {
int i;
switch(wr_state) { switch(wr_state) {
case WR_LINK_OFFLINE: 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()) if (wr_link_up())
wr_state = WR_LINK_ONLINE; wr_state = WR_LINK_ONLINE;
break; break;
...@@ -87,6 +99,8 @@ void wr_update_link(void) ...@@ -87,6 +99,8 @@ void wr_update_link(void)
} }
break; break;
case WR_LINK_SYNCED: case WR_LINK_SYNCED:
for(i = 0; i < FD_NUM_CHANNELS; i++)
wrtd_out_channels[i].config.flags &= ~WRTD_NO_WR;
break; break;
} }
...@@ -103,15 +117,6 @@ int wr_is_timing_ok() ...@@ -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) * Writes to FD output registers for output (out)
*/ */
......
...@@ -314,9 +314,12 @@ void wr_enable_lock(int enable) ...@@ -314,9 +314,12 @@ void wr_enable_lock(int enable)
*/ */
void wr_update_link(void) void wr_update_link(void)
{ {
int i;
switch (wr_state) { switch (wr_state) {
case WR_LINK_OFFLINE: 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()) if (wr_link_up())
wr_state = WR_LINK_ONLINE; wr_state = WR_LINK_ONLINE;
break; break;
...@@ -340,6 +343,8 @@ void wr_update_link(void) ...@@ -340,6 +343,8 @@ void wr_update_link(void)
} }
break; break;
case WR_LINK_SYNCED: case WR_LINK_SYNCED:
for(i = 0; i < TDC_NUM_CHANNELS; i++)
wrtd_in_channels[i].config.flags &= ~WRTD_NO_WR;
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment