From af6cced054268fc1f1262c1ea0049c3ef00445d5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B6rn=20Adamczewski-Musch?= Date: Fri, 1 Nov 2013 12:42:48 +0100 Subject: [PATCH] Mask out the new trb3 trigger type in bits 4...7 of subevent decoding word. --- hadaq/subevt.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/hadaq/subevt.h b/hadaq/subevt.h index d66ac29..16960a2 100644 --- a/hadaq/subevt.h +++ b/hadaq/subevt.h @@ -37,8 +37,8 @@ enum SubEvtDecoding { #define SubEvt_isSwapped HadTu_isSwapped #define SubEvt_hdrValue HadTu_hdrValue #define SubEvt_setHdrValue HadTu_setHdrValue -#define SubEvt_decoding HadTu_decoding -#define SubEvt_setDecoding HadTu_setDecoding +/*#define SubEvt_decoding HadTu_decoding JAM: replaced by function that also masks the trb3 trigger type info*/ +/* #define SubEvt_setDecoding HadTu_setDecoding */ #define SubEvt_alignment HadTu_alignment #define SubEvt_size HadTu_size #define SubEvt_setSize HadTu_setSize @@ -120,6 +120,20 @@ static void SubEvt_setTrigNr(void *my, uint32_t trigNr) SubEvt_setHdrValue(my, SubEvtIdx_trigNr, trigNr); } +static uint32_t SubEvt_decoding(const void *my) +{ +/* JAM: mask out the trb3 trigger type info in bits 4...7*/ + return (HadTu_decoding(my) & 0xFFFFFF0F); +} + +static void SubEvt_setDecoding(void *my, uint32_t decoding) +{ + /* JAM: save and restore trb3 trigger type info in bits 4...7*/ + uint32_t oldtriggertype= HadTu_decoding(my) & 0xF0; + HadTu_setDecoding(my, (decoding | oldtriggertype)); +} + + void *newSubEvt(uint32_t decoding, uint32_t id, uint32_t trigNr); void deleteSubEvt(void *my); void *SubEvt_appendData(void *my, const void *data, size_t size); -- 2.43.0