diff --git a/slsDetectorSoftware/gotthardDetectorServer/Makefile b/slsDetectorSoftware/gotthardDetectorServer/Makefile index 976c997df..ee8c1eb89 100755 --- a/slsDetectorSoftware/gotthardDetectorServer/Makefile +++ b/slsDetectorSoftware/gotthardDetectorServer/Makefile @@ -6,7 +6,7 @@ CROSS = bfin-uclinux- CC = $(CROSS)gcc -CFLAGS += -Wall -DMCB_FUNCS #-DVERBOSE #-DVERYVERBOSE #-DVIRTUAL +CFLAGS += -Wall -DMCB_FUNCS -DVERBOSE -DVERYVERBOSE #-DVIRTUAL #INCLUDES= /usr/src/kernels/2.6.18-238.12.1.el5-i686/include #/home/l_maliakal_d/bfin/blackfin-linux-dist/linux-2.6.x/include diff --git a/slsDetectorSoftware/gotthardDetectorServer/firmware_funcs.c b/slsDetectorSoftware/gotthardDetectorServer/firmware_funcs.c index 0d77fd9fb..234071c7e 100755 --- a/slsDetectorSoftware/gotthardDetectorServer/firmware_funcs.c +++ b/slsDetectorSoftware/gotthardDetectorServer/firmware_funcs.c @@ -891,8 +891,12 @@ int loadImage(int index, short int ImageVals[]){ address = GAIN_IMAGE_REG; break; } - int *ptr=(u_int16_t*)(CSP0BASE+address*2); - dma_memcpy(ptr,ImageVals ,2560); + volatile u_int16_t *ptr; + ptr=(u_int16_t*)(CSP0BASE+address*2); + memcpy(ptr,ImageVals ,2560); +#ifdef VERBOSE + printf("Loaded x%08x address with image of index %d\n",ptr,index); +#endif return 0; } diff --git a/slsDetectorSoftware/gotthardDetectorServer/mcb_funcs.h b/slsDetectorSoftware/gotthardDetectorServer/mcb_funcs.h index 1f1ab85ec..a93f76200 100755 --- a/slsDetectorSoftware/gotthardDetectorServer/mcb_funcs.h +++ b/slsDetectorSoftware/gotthardDetectorServer/mcb_funcs.h @@ -29,7 +29,8 @@ enum dacsVal{VREF_DS, VCASCN_PB, VCASCP_PB, VOUT_CM, VCASC_OUT, VIN_CM, VREF_COM enum adcVals{TEMP_FPGA, TEMP_ADC}; //dynamic range -#define MAX5523 +/* +#define MAX5523 commented out by dhanya #ifndef MAX5523 #define MAX5533 #endif @@ -37,8 +38,9 @@ enum adcVals{TEMP_FPGA, TEMP_ADC}; #define DAC_DR 4096 #endif #ifdef MAX5523 +*/ #define DAC_DR 1024 -#endif +//#endif //reference voltage diff --git a/slsDetectorSoftware/gotthardDetectorServer/server_funcs.c b/slsDetectorSoftware/gotthardDetectorServer/server_funcs.c index 1092b5a74..6a3cb55a2 100755 --- a/slsDetectorSoftware/gotthardDetectorServer/server_funcs.c +++ b/slsDetectorSoftware/gotthardDetectorServer/server_funcs.c @@ -2794,7 +2794,7 @@ int load_image(int file_des) { sprintf(mess,"Can't load image\n"); - n = receiveDataOnly(file_des,index,sizeof(index)); + n = receiveDataOnly(file_des,&index,sizeof(index)); if (n < 0) { sprintf(mess,"Error reading from socket\n"); ret=FAIL; @@ -2814,7 +2814,7 @@ int load_image(int file_des) { break; case GAIN_IMAGE : #ifdef VERBOSE - printf(" Loading Dark image\n"); + printf(" Loading Gain image\n"); #endif break; default: @@ -2822,16 +2822,16 @@ int load_image(int file_des) { sprintf(mess,"Unknown index %d\n",index); ret=FAIL; } - +#ifdef VERYVERBOSE printf("%d\n%d\n",ImageVals[0],ImageVals[1]); - +#endif if (ret==OK) { if (differentClients==1 && lockStatus==1) { ret=FAIL; sprintf(mess,"Detector locked by %s\n",lastClientIP); } else{ retval=loadImage(index,ImageVals); - if (retval= -1) + if (retval==-1) ret = FAIL; } }