From f461ddf2b7950d857a0a2ee8972f655be734bb5d Mon Sep 17 00:00:00 2001 From: Anna Bergamaschi Date: Mon, 23 Mar 2015 15:42:12 +0100 Subject: [PATCH] slsDetectorUSers re-added to Makefile - don't remove it again --- slsDetectorSoftware/Makefile | 4 +- .../jungfrauDetectorServer/firmware_funcs.c | 60 ++++++++++++++++++- .../jungfrauDetectorServer/server_funcs.c | 38 +----------- 3 files changed, 61 insertions(+), 41 deletions(-) diff --git a/slsDetectorSoftware/Makefile b/slsDetectorSoftware/Makefile index 0e65fc2be..00cbf4dec 100644 --- a/slsDetectorSoftware/Makefile +++ b/slsDetectorSoftware/Makefile @@ -14,10 +14,10 @@ INCLUDES?= -IcommonFiles -IslsDetector -I../slsReceiverSoftware/MySocketTCP -Ius #EPICSFLAGS=-D EPICS -I/usr/local/epics/base/include/ -I /usr/local/epics/base/include/os/Linux/ -L /usr/local/epics/base/lib/$(EPICS_HOST_ARCH) -Wl,-R/usr/local/epics/base/lib/$(EPICS_HOST_ARCH) -lca -lCom -SRC_CLNT=slsDetectorAnalysis/fileIO.cpp usersFunctions/usersFunctions.cpp slsDetector/slsDetectorUtils.cpp slsDetector/slsDetectorCommand.cpp slsDetectorAnalysis/angularConversion.cpp slsDetectorAnalysis/angularConversionStatic.cpp slsDetectorAnalysis/energyConversion.cpp slsDetector/slsDetectorActions.cpp slsDetectorAnalysis/postProcessing.cpp slsDetector/slsDetector.cpp multiSlsDetector/multiSlsDetector.cpp slsDetectorAnalysis/postProcessingFuncs.cpp slsReceiverInterface/receiverInterface.cpp +SRC_CLNT=slsDetectorAnalysis/fileIO.cpp usersFunctions/usersFunctions.cpp slsDetector/slsDetectorUtils.cpp slsDetector/slsDetectorCommand.cpp slsDetectorAnalysis/angularConversion.cpp slsDetectorAnalysis/angularConversionStatic.cpp slsDetectorAnalysis/energyConversion.cpp slsDetector/slsDetectorActions.cpp slsDetectorAnalysis/postProcessing.cpp slsDetector/slsDetector.cpp multiSlsDetector/multiSlsDetector.cpp slsDetectorAnalysis/postProcessingFuncs.cpp slsReceiverInterface/receiverInterface.cpp slsDetector/slsDetectorUsers.cpp # ../slsReceiverSoftware/MySocketTCP/MySocketTCP.cpp -# slsDetector/slsDetectorUsers.cpp +# $(info ) $(info #######################################) diff --git a/slsDetectorSoftware/jungfrauDetectorServer/firmware_funcs.c b/slsDetectorSoftware/jungfrauDetectorServer/firmware_funcs.c index 1778c0171..60fdc0554 100755 --- a/slsDetectorSoftware/jungfrauDetectorServer/firmware_funcs.c +++ b/slsDetectorSoftware/jungfrauDetectorServer/firmware_funcs.c @@ -1980,7 +1980,9 @@ u_int16_t* fifo_read_event() } } t = bus_r(LOOK_AT_ME_REG); +#ifdef VERBOSE printf("."); +#endif } // printf("%08x %08x\n", runState(), bus_r(LOOK_AT_ME_REG)); /* dma_memcpy(now_ptr,values ,dataBytes); */ @@ -1995,7 +1997,9 @@ u_int16_t* fifo_read_event() /* usleep(10); */ *dum=bus_r16(FIFO_DATA_REG); } +#ifdef VERBOSE printf("*"); +#endif return ram_values; } @@ -2014,7 +2018,11 @@ u_int16_t* fifo_read_frame() } // printf("%x %d\n",dum, ns); if (ns==0) return NULL; +#ifdef VERBOSE printf("+\n"); +#else + printf("+"); +#endif return ram_values; } @@ -2286,7 +2294,7 @@ int prepareADC(){ // writeADC(0x16,0x4);//output clock phase - writeADC(0x18,0x0);// vref 1V + // writeADC(0x18,0x0);// vref 1V writeADC(0x14,0x40);//lvds reduced range -- offset binary @@ -3073,6 +3081,10 @@ void initDac(int dacnum) { int setDacRegister(int dacnum,int dacvalue) { int val; + if (dacvalue==-100) + dacvalue=0xffff; + + if (dacnum%2) { val=((dacvalue & 0xffff)<<16) | getDacRegister(dacnum-1); } else { @@ -3123,7 +3135,46 @@ int setDac(int dacnum,int dacvalue){ printf("data bit=%d, clkbit=%d, csbit=%d",ddx,cdx,csdx); - codata=((((0x2)<<4)+((dacch)&0xf))<<16)+((dacvalue<<4)&0xfff0); + //modified to power down single channels + + // codata=((((0x2)<<4)+((dacch)&0xf))<<16)+((dacvalue<<4)&0xfff0); + codata=((((0x3)<<4)+((dacch)&0xf))<<16)+((dacvalue<<4)&0xfff0); + valw=0xffff; bus_w(offw,(valw)); // start point + valw=((valw&(~(0x1<>(24-i))&0x1)<>(24-i))&0x1)); + + + valw=((valw&(~(0x1<16535) val=-1; + retval=setDac(ind,val); /* if(idac==HIGH_VOLTAGE) */