a check in gotthard server to ensure that it is really gotthard and not moench module

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@522 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
l_maliakal_d 2013-04-26 08:29:43 +00:00
parent 6ca969e08f
commit 507debd7f4
6 changed files with 27 additions and 8 deletions

View File

@ -295,7 +295,7 @@ int setDAQRegister()
//depended on pcb rev
int tokenTiming = TOKEN_TIMING_REV2;
if(bus_r(PCB_REV_REG)==1)
if((bus_r(PCB_REV_REG)&BOARD_REVISION_MASK)==1)
tokenTiming= TOKEN_TIMING_REV1;

View File

@ -134,6 +134,14 @@
#define SHIFTMOD 2
#define SHIFTFIFO 9
/** for PCB_REV_REG */
#define DETECTOR_TYPE_MASK 0xF0000
#define DETECTOR_TYPE_OFFSET 16
#define BOARD_REVISION_MASK 0xFFFF
#define MOENCH_MODULE 2
/* for control register */
#define START_ACQ_BIT 0x00000001

View File

@ -35,6 +35,8 @@ int main(int argc, char *argv[])
}
}
if (argc==1) {
portno = DEFAULT_PORTNO;
sprintf(cmd,"%s %d &",argv[0],DEFAULT_PORTNO+1);

View File

@ -52,19 +52,28 @@ char mess[1000];
int digitalTestBit = 0;
void check_detector_type(){
if (((bus_r(PCB_REV_REG) & DETECTOR_TYPE_MASK)>> DETECTOR_TYPE_OFFSET) == MOENCH_MODULE){
printf("This is a MOENCH detector. Exiting Gotthard Server.\n");
exit(-1);
}
}
int init_detector( int b) {
#ifndef PICASSOD
printf("This is a GOTTHARD detector with %d chips per module\n", NCHIP);
#else
printf("This is a PICASSO detector with %d chips per module\n", NCHIP);
#endif
if (mapCSP0()==FAIL) { printf("Could not map memory\n");
exit(1);
exit(-1);
}
//check if it is really gotthard
check_detector_type();
//testFpga();
if (b) {
#ifdef MCB_FUNCS

View File

@ -23,7 +23,7 @@ int sockfd;
int function_table();
int decode_function(int);
void check_detector_type();
int init_detector(int);
int M_nofunc(int);