From 8f283c8ab6ffd2650a744a74aa724ca5f6ebd111 Mon Sep 17 00:00:00 2001 From: hadaq Date: Mon, 11 Jan 2010 10:59:40 +0000 Subject: [PATCH] error code update --- libtrbnet/trberror.c | 20 ++++++-------------- libtrbnet/trbnet.c | 24 +++++++++++++++--------- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/libtrbnet/trberror.c b/libtrbnet/trberror.c index e1381fc..47806f3 100644 --- a/libtrbnet/trberror.c +++ b/libtrbnet/trberror.c @@ -80,30 +80,22 @@ const char* trb_strterm(TRB_TERM term) "Ch0_TrigMissing: timing trigger missing", /* status */ "", "", - "", - "", - "", - "", - "Ch0_BufferHalfFull: data-buffers half full", /* status */ + "Ch0_BuffersHalfFull: data-buffers half full", /* status */ "Ch0_BuffersFull: data-buffers almost full", /* status */ "Ch0_NotConfigured: endpoint is not configured", /* status */ - "", "", "", "", "" + "", "", "", "", "", "", "", "", "" }; static const char ch1StatusBits[16][64] = { - "Ch1_TrigNum: trigger number mismatch", /* status */ + "Ch1_EvtNum: data stream event number mismatch", /* status */ "Ch1_TrigCode: trigger code / random mismatch", /* status */ - "Ch1_Length: wrong length", /* status */ + "Ch1_Length: invalid length", /* status */ "Ch1_NoAnswer: answer missing", /* status */ - "", - "", - "", - "", - "Ch1_NotFound: sent trigger number mismatch", /* status */ + "Ch1_NotFound: requested event number mismatch", /* status */ "Ch1_DataMissing: parts of the data are missing",/* status */ "Ch1_Sync: serious sync problem detected", /* status */ "Ch1_EvtBroken: event data corrupted", /* status */ - "", "", "", "" + "", "", "", "", "", "", "", "" }; static const char ch2StatusBits[16][64] = { diff --git a/libtrbnet/trbnet.c b/libtrbnet/trbnet.c index 3bb63da..5739c1a 100644 --- a/libtrbnet/trbnet.c +++ b/libtrbnet/trbnet.c @@ -1,4 +1,4 @@ -const char trbnet_version[] = "$Revision: 2.55 $"; +const char trbnet_version[] = "$Revision: 2.56 $"; #include #include @@ -164,31 +164,37 @@ typedef enum { Status_C_WordMiss = 2, /* word missing, */ Status_C_Checksum = 3, /* checksum error, */ Status_C_DontKnow = 4, /* dont understand, */ - Status_C_BufferMatch = 5 /* buffer mismatch */ + Status_C_BufferMisMatch = 5, /* buffer mismatch */ + Status_C_AnswerMissing = 6 /* answer missing */ } Status_Common; typedef enum { Status_Ch0_TrigCtr = 0, /* trigger counter mismatch */ + Status_Ch0_TrigMiss = 1, /* timing trigger missing */ Status_Ch0_BufferHalfFull = 4, /* buffers half full */ - Status_Ch0_BuffersFull = 5 /* buffers almost full */ + Status_Ch0_BuffersFull = 5, /* buffers almost full */ + Status_Ch0_NotConfig = 6 /* not configured */ } Status_CH0; typedef enum { - Status_Ch1_TrigNum = 0, /* trigger number mismatch */ + Status_Ch1_EvtNum = 0, /* event number mismatch */ Status_Ch1_TrigCode = 1, /* trigger code / random mismatch */ Status_Ch1_Length = 2, /* wrong length */ Status_Ch1_NoAnswer = 3, /* answer missing */ - Status_Ch1_NotFound = 8 /* not found */ + Status_Ch1_NotFound = 4, /* not found */ + Status_Ch1_DataMiss = 5, /* data missing */ + Status_Ch1_Sync = 6, /* sync error */ + Status_Ch1_EvtBroken = 7 /* event broken */ } Status_CH1; typedef enum { - Status_Ch2_NONE = 0 + Status_Ch2_None = -1 } Status_CH2; typedef enum { Status_Ch3_Address = 0, /* unknown address */ - Status_Ch3_TimeOut = 4, /* timeout */ - Status_Ch3_NoData = 5 /* nomoredata */ + Status_Ch3_TimeOut = 1, /* timeout */ + Status_Ch3_NoData = 2 /* nomoredata */ } Status_CH3; /* ------ Internal Functions for FPGA access ------------------------------ */ @@ -896,7 +902,7 @@ static int trb_fifo_read(uint8_t channel, return -1; } - if ((trb_term.status_common & 0x003e) != 0) { + if ((trb_term.status_common & 0x007e) != 0) { trb_errno = TRB_STATUS_ERROR; return -1; } -- 2.43.0