ROL GLOBAL DECLARATIONS: #include "vetrocLib.h" extern int nvetroc; /* Number of VETROCs in Crate */ static int VETROC_SLOT; static int VETROC_ROFLAG = 1; /* 0-noDMA, 1-board-by-board DMA, 2-chainedDMA */ /* for the calculation of maximum data words in the block transfer */ static unsigned int MAXVETROCWORDS = 10000; static unsigned int vetrocSlotMask; /* bit=slot (starting from 0) */ ROL Prestart(): nvetroc = vetrocInit((3<<19), 0x80000, 16+2, 0x111); /* 7 boards from slot 4, 7 boards from slot 13 */ if(nvetroc>0) { vetrocGSetProcMode(/*4000*/2000,/*4000*/2000); } if(nvetroc==1) VETROC_ROFLAG = 1; /*no chainedDMA if one board only*/ if((nvetroc>0) && (VETROC_ROFLAG==2)) vetrocEnableMultiBlock(1); else if(nvetroc>0) vetrocDisableMultiBlock(); /* Additional Configuration for each module */ vetrocSlotMask=0; for(ii=0; ii vetrocSlotMask=0x%08x\n",vetrocSlotMask); } /* VETROC stuff */ for(id=0; id0) { printf("expected mask 0x%08x, got 0x%08x\n",vetrocSlotMask,gbready); break; } } if(stat==0) printf("vetroc not ready !!!\n"); if(stat>0) { BANKOPEN(0xe105,1,rol->pid); for(jj=0; jj 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x\n", VETROC_SLOT,len,LSWAP(tdcbuf[dCnt+0]),LSWAP(tdcbuf[dCnt+1]),LSWAP(tdcbuf[dCnt+2]), LSWAP(tdcbuf[dCnt+3]),LSWAP(tdcbuf[dCnt+4]),LSWAP(tdcbuf[dCnt+5]),LSWAP(tdcbuf[dCnt+6])); dCnt += len; } if(dCnt<=0) { printf("VETROC: No data or error. dCnt = %d\n",dCnt); dCnt=0; } BANKCLOSE; } else { printf ("VETROCs: no events stat=%d intcount = %d gbready = 0x%08x VETROCSlotMask = 0x%08x\n", stat,tiGetIntCount(),gbready,vetrocSlotMask); printf("Missing slots:"); for(jj=1; jj<21; jj++) { mask = 1<