Commit 575cefa9 authored by Federico Vaga's avatar Federico Vaga

wrtd:rt: sw trig, fix take into account host delay

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent aa0cd9ec
...@@ -400,15 +400,19 @@ static inline void ctl_chan_get_state (uint32_t seq, struct wrnc_msg *ibuf) ...@@ -400,15 +400,19 @@ static inline void ctl_chan_get_state (uint32_t seq, struct wrnc_msg *ibuf)
static inline void ctl_software_trigger (uint32_t seq, struct wrnc_msg *ibuf) static inline void ctl_software_trigger (uint32_t seq, struct wrnc_msg *ibuf)
{ {
struct wr_timestamp ts;
/* and dumbly copy the trigger entry */ /* and dumbly copy the trigger entry */
struct wrtd_trigger_entry ent; struct wrtd_trigger_entry ent;
wrtd_msg_trigger_entry(ibuf, &ent); wrtd_msg_trigger_entry(ibuf, &ent);
ctl_ack(seq); ctl_ack(seq);
ent.ts.seconds = lr_readl(WRN_CPU_LR_REG_TAI_SEC); /* trigger entity ts from the host contains the delay.
ent.ts.ticks = lr_readl(WRN_CPU_LR_REG_TAI_CYCLES); So add to it the current time */
ent.ts.frac = 0; ts.seconds = lr_readl(WRN_CPU_LR_REG_TAI_SEC);
ts.ticks = lr_readl(WRN_CPU_LR_REG_TAI_CYCLES);
ts.frac = 0;
ts_add(&ent.ts, &ts);
/* Send trigger */ /* Send trigger */
send_trigger(&ent); send_trigger(&ent);
......
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