diff --git a/slsDetectorSoftware/jungfrauDetectorServer/firmware_funcs.c b/slsDetectorSoftware/jungfrauDetectorServer/firmware_funcs.c index d6e485f48..845972a73 100755 --- a/slsDetectorSoftware/jungfrauDetectorServer/firmware_funcs.c +++ b/slsDetectorSoftware/jungfrauDetectorServer/firmware_funcs.c @@ -91,7 +91,8 @@ u_int32_t progressMask=0; int phase_shift=0;//DEFAULT_PHASE_SHIFT; int ipPacketSize=DEFAULT_IP_PACKETSIZE; int udpPacketSize=DEFAULT_UDP_PACKETSIZE; -int clockdivider = 40; +int clockdivider_exptime = 40; +int clockdivider_fc = 20; /* #ifndef NEW_PLL_RECONFIG u_int32_t clkDivider[2]={32,16}; @@ -496,7 +497,7 @@ void configurePll(int i) { #endif if (i<2) { - tot= PLL_VCO_FREQ_MHZ/clockdivider; /* check if it always reads clock */ + tot= PLL_VCO_FREQ_MHZ/clockdivider_fc; /* which clock divider?????? Is it called? clean up!! */ l=tot/2; h=l; if (tot>2*l) { @@ -1192,15 +1193,15 @@ int64_t getFrames(){ int64_t setExposureTime(int64_t value){ if (value!=-1){ printf("\nSetting exptime to %lldns\n",(long long int)value); - value*=(1E-3*clockdivider); + value*=(1E-3*clockdivider_exptime); } - int64_t retval = set64BitReg(value,SET_EXPTIME_LSB_REG, SET_EXPTIME_MSB_REG)/(1E-3*clockdivider);//(1E-9*CLK_FREQ); + int64_t retval = set64BitReg(value,SET_EXPTIME_LSB_REG, SET_EXPTIME_MSB_REG)/(1E-3*clockdivider_exptime);//(1E-9*CLK_FREQ); printf("Getting exptime: %lldns\n",(long long int)retval); return retval; } int64_t getExposureTime(){ - return get64BitReg(GET_EXPTIME_LSB_REG, GET_EXPTIME_MSB_REG)/(1E-3*clockdivider);//(1E-9*CLK_FREQ); + return get64BitReg(GET_EXPTIME_LSB_REG, GET_EXPTIME_MSB_REG)/(1E-3*clockdivider_exptime);//(1E-9*CLK_FREQ); } int64_t setGates(int64_t value){ @@ -1219,31 +1220,31 @@ int64_t getGates(){ int64_t setPeriod(int64_t value){ if (value!=-1){ printf("\nSetting period to %lldns\n",(long long int)value); - value*=(1E-3*clockdivider); + value*=(1E-3*clockdivider_fc); } - int64_t retval = set64BitReg(value,SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG)/(1E-3*clockdivider);//(1E-9*CLK_FREQ); + int64_t retval = set64BitReg(value,SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG)/(1E-3*clockdivider_fc);//(1E-9*CLK_FREQ); printf("Getting period: %lldns\n",(long long int)retval); return retval; } int64_t getPeriod(){ - return get64BitReg(GET_PERIOD_LSB_REG, GET_PERIOD_MSB_REG)/(1E-3*clockdivider);//(1E-9*CLK_FREQ); + return get64BitReg(GET_PERIOD_LSB_REG, GET_PERIOD_MSB_REG)/(1E-3*clockdivider_fc);//(1E-9*CLK_FREQ); } int64_t setDelay(int64_t value){ if (value!=-1){ printf("\nSetting delay to %lldns\n",(long long int)value); - value*=(1E-3*clockdivider); + value*=(1E-3*clockdivider_fc); } - int64_t retval = set64BitReg(value,SET_DELAY_LSB_REG, SET_DELAY_MSB_REG)/(1E-3*clockdivider);//(1E-9*CLK_FREQ); + int64_t retval = set64BitReg(value,SET_DELAY_LSB_REG, SET_DELAY_MSB_REG)/(1E-3*clockdivider_fc);//(1E-9*CLK_FREQ); printf("Getting delay: %lldns\n",(long long int)retval); return retval; } int64_t getDelay(){ - return get64BitReg(GET_DELAY_LSB_REG, GET_DELAY_MSB_REG)/(1E-3*clockdivider);//(1E-9*CLK_FREQ); + return get64BitReg(GET_DELAY_LSB_REG, GET_DELAY_MSB_REG)/(1E-3*clockdivider_fc);//(1E-9*CLK_FREQ); } int64_t setTrains(int64_t value){ diff --git a/slsDetectorSoftware/jungfrauDetectorServer/jungfrauDetectorServerv2.2.1 b/slsDetectorSoftware/jungfrauDetectorServer/jungfrauDetectorServerv2.2.1 index 8f3ec4cf8..6014d803c 100755 Binary files a/slsDetectorSoftware/jungfrauDetectorServer/jungfrauDetectorServerv2.2.1 and b/slsDetectorSoftware/jungfrauDetectorServer/jungfrauDetectorServerv2.2.1 differ diff --git a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp index 03ae47e9f..d6317aa58 100644 --- a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp +++ b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp @@ -2266,6 +2266,7 @@ double* multiSlsDetector::decodeData(int *datain, double *fdata) { } } + return dataout; } @@ -5246,11 +5247,6 @@ void multiSlsDetector::startReceivingDataThread(){ memcpy((char*)(singleframe[ithread]),(char*)zmq_msg_data(&message),singleDatabytes/numReadoutPerDetector); //cprintf(GREEN,"%d copied data %d\n",ithread,singleDatabytes/numReadoutPerDetector); - if(!ithread){ - for(int i=0;i<30;i++) - cprintf(BLUE,"value[%d]:%d\n",i,(short int)singleframe[ithread][i]); - - } //jungfrau masking adcval if(jungfrau){ for(unsigned int i=0;ioffsetY[idet] + slsmaxY)) * maxX * bytesperchannel; //the left half or right half @@ -5361,19 +5358,12 @@ void multiSlsDetector::readFrameFromReceiver(){ else offsetX = thisMultiDetector->offsetX[idet] + halfreadoutoffset; offsetX *= bytesperchannel; - //cprintf(BLUE,"ireadout:%d, offsetx:%d offsety:%d maxx:%d slsmaxX:%d slsmaxY:%d bytesperchannel:%d\n", - // ireadout, offsetX,offsetY,maxX,slsmaxX,slsmaxY,bytesperchannel); - // cprintf(BLUE,"copying bytes:%d\n", (slsmaxX/numReadoutPerDetector)*bytesperchannel); - //interleaving with other detectors //bottom if(((idet+1)%2) == 0){ for(int i=0;i