diff --git a/slsDetectorSoftware/gotthardDetectorServer/Makefile b/slsDetectorSoftware/gotthardDetectorServer/Makefile index ca169b4fd..3f3f77b2c 100755 --- a/slsDetectorSoftware/gotthardDetectorServer/Makefile +++ b/slsDetectorSoftware/gotthardDetectorServer/Makefile @@ -5,7 +5,7 @@ CROSS = bfin-uclinux- CC = $(CROSS)gcc -CFLAGS += -Wall -DMCB_FUNCS# -DVERBOSE -DVERYVERBOSE #-DVIRTUAL +CFLAGS += -Wall -DMCB_FUNCS #-DVERBOSE -DVERYVERBOSE #-DVIRTUAL PROGS= gotthardDetectorServer diff --git a/slsDetectorSoftware/gotthardDetectorServer/communication_funcs.c b/slsDetectorSoftware/gotthardDetectorServer/communication_funcs.c index de00290c6..3ce534616 100755 --- a/slsDetectorSoftware/gotthardDetectorServer/communication_funcs.c +++ b/slsDetectorSoftware/gotthardDetectorServer/communication_funcs.c @@ -431,7 +431,7 @@ int receiveModule(int file_des, sls_detector_module* myMod) { free(dacptr); return FAIL; } - +/* if (nadcdiff<=0) { ts+=receiveDataOnly(file_des,myMod->adcs, sizeof(double)*nAdcs); #ifdef VERBOSE @@ -444,8 +444,7 @@ int receiveModule(int file_des, sls_detector_module* myMod) { ts+=receiveDataOnly(file_des,adcptr, sizeof(double)*nadcdiff); free(adcptr); return FAIL; - } - + }*/ if (nchipdiff<=0) { ts+=receiveDataOnly(file_des,myMod->chipregs, sizeof(int)*nChips); #ifdef VERBOSE diff --git a/slsDetectorSoftware/gotthardDetectorServer/firmware_funcs.c b/slsDetectorSoftware/gotthardDetectorServer/firmware_funcs.c index 89500f882..9dbf06111 100755 --- a/slsDetectorSoftware/gotthardDetectorServer/firmware_funcs.c +++ b/slsDetectorSoftware/gotthardDetectorServer/firmware_funcs.c @@ -1187,6 +1187,8 @@ int setDACRegister(int idac, int val, int imod) { return -1; break; } + //saving only the msb + val=val>>2; off=(idac%3)*10; mask=~((0x3ff)<>off)&0x3ff; + //since we saved only the msb + val=val<<2; + //val=(bus_r(addr)>>off)&0x3ff; - + #ifdef VERBOSE printf("Dac %d module %d register is %d\n\n",idac,imod,val); #endif diff --git a/slsDetectorSoftware/gotthardDetectorServer/mcb_funcs.c b/slsDetectorSoftware/gotthardDetectorServer/mcb_funcs.c index f6e13b7b6..9f09e8a69 100755 --- a/slsDetectorSoftware/gotthardDetectorServer/mcb_funcs.c +++ b/slsDetectorSoftware/gotthardDetectorServer/mcb_funcs.c @@ -816,6 +816,7 @@ int initDACs(int* v,int imod) #endif int iaddr; // sDac=0; + for (iaddr=0; iaddr<8; iaddr++) { clearDACSregister(imod); if (v[iaddr]>=0) { diff --git a/slsDetectorSoftware/gotthardDetectorServer/server_funcs.c b/slsDetectorSoftware/gotthardDetectorServer/server_funcs.c index 09b189990..87a7c3e22 100755 --- a/slsDetectorSoftware/gotthardDetectorServer/server_funcs.c +++ b/slsDetectorSoftware/gotthardDetectorServer/server_funcs.c @@ -990,8 +990,8 @@ int set_dac(int file_des) { strcpy(mess,"Weird value read back or it has not been set yet\n"); else ret=OK; - } - else if (retval==val || val==-1) + }//since v r saving only msb + else if ((retval-val)<=3 || val==-1) ret=OK; } #endif @@ -1416,7 +1416,7 @@ int set_module(int file_des) { printf("Setting module\n"); #endif ret=receiveModule(file_des, &myModule); - + if (ret>=0) ret=OK;