#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
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);