From: Jörn Adamczewski-Musch Date: Fri, 1 Nov 2013 11:42:48 +0000 (+0100) Subject: Mask out the new trb3 trigger type in bits 4...7 of subevent decoding X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=af6cced054268fc1f1262c1ea0049c3ef00445d5;p=daqdata.git Mask out the new trb3 trigger type in bits 4...7 of subevent decoding word. --- 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);