From 4aa0d26f26a16d48ddd265128f02b39e7140127f Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Fri, 21 Sep 2018 17:29:43 +0200 Subject: [PATCH] gotthard server: trying to resolve roi problem that is only affected by latest firmware --- .../gotthardDetectorServer/firmware_funcs.c | 33 ++++++++++++++----- .../gotthardDetectorServer/gitInfo.txt | 8 ++--- .../gotthardDetectorServer/gitInfoGotthard.h | 6 ++-- .../gotthardDetectorServer/server_funcs.c | 4 +-- 4 files changed, 33 insertions(+), 18 deletions(-) diff --git a/slsDetectorSoftware/gotthardDetectorServer/firmware_funcs.c b/slsDetectorSoftware/gotthardDetectorServer/firmware_funcs.c index 5e28d88a6..ab12ef2af 100755 --- a/slsDetectorSoftware/gotthardDetectorServer/firmware_funcs.c +++ b/slsDetectorSoftware/gotthardDetectorServer/firmware_funcs.c @@ -64,6 +64,8 @@ int slaveadcphase = 0; int rsttosw1delay = 2; int startacqdelay = 1; +int detectorFirstServer = 1; + #ifdef MCB_FUNCS extern const int nChans; @@ -273,12 +275,20 @@ void setMasterSlaveConfiguration(){ } else { cprintf(RED,"could not scan masterflags %s value from config file\n",value); + fclose(fd); exit(EXIT_FAILURE); } + + if (!detectorFirstServer) { + cprintf(BLUE, "Server has been started up before. Ignoring rest of config file\n"); + fclose(fd); + return; + } } else { if(sscanf(value,"%d",&ival)<=0) { cprintf(RED,"could not scan patternphase %s value from config file\n",value); + fclose(fd); exit(EXIT_FAILURE); } @@ -298,6 +308,7 @@ void setMasterSlaveConfiguration(){ startacqdelay = ival; else { cprintf(RED,"could not scan parameter name %s from config file\n",key); + fclose(fd); exit(EXIT_FAILURE); } } @@ -384,6 +395,7 @@ int setPhaseShiftOnce(){ //bus_w(addr,0x0); //clear the reg if(reg==0){ + detectorFirstServer = 1; printf("\nImplementing phase shift of %d\n",phase_shift); for (i=1;i>(23-i))&0x1)<