mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-21 03:10:02 +02:00
gotthard server: trying to resolve roi problem that is only affected by latest firmware
This commit is contained in:
parent
9f84bf7175
commit
4aa0d26f26
@ -64,6 +64,8 @@ int slaveadcphase = 0;
|
|||||||
int rsttosw1delay = 2;
|
int rsttosw1delay = 2;
|
||||||
int startacqdelay = 1;
|
int startacqdelay = 1;
|
||||||
|
|
||||||
|
int detectorFirstServer = 1;
|
||||||
|
|
||||||
|
|
||||||
#ifdef MCB_FUNCS
|
#ifdef MCB_FUNCS
|
||||||
extern const int nChans;
|
extern const int nChans;
|
||||||
@ -273,12 +275,20 @@ void setMasterSlaveConfiguration(){
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
cprintf(RED,"could not scan masterflags %s value from config file\n",value);
|
cprintf(RED,"could not scan masterflags %s value from config file\n",value);
|
||||||
|
fclose(fd);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!detectorFirstServer) {
|
||||||
|
cprintf(BLUE, "Server has been started up before. Ignoring rest of config file\n");
|
||||||
|
fclose(fd);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(sscanf(value,"%d",&ival)<=0) {
|
if(sscanf(value,"%d",&ival)<=0) {
|
||||||
cprintf(RED,"could not scan patternphase %s value from config file\n",value);
|
cprintf(RED,"could not scan patternphase %s value from config file\n",value);
|
||||||
|
fclose(fd);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,6 +308,7 @@ void setMasterSlaveConfiguration(){
|
|||||||
startacqdelay = ival;
|
startacqdelay = ival;
|
||||||
else {
|
else {
|
||||||
cprintf(RED,"could not scan parameter name %s from config file\n",key);
|
cprintf(RED,"could not scan parameter name %s from config file\n",key);
|
||||||
|
fclose(fd);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -384,6 +395,7 @@ int setPhaseShiftOnce(){
|
|||||||
//bus_w(addr,0x0); //clear the reg
|
//bus_w(addr,0x0); //clear the reg
|
||||||
|
|
||||||
if(reg==0){
|
if(reg==0){
|
||||||
|
detectorFirstServer = 1;
|
||||||
printf("\nImplementing phase shift of %d\n",phase_shift);
|
printf("\nImplementing phase shift of %d\n",phase_shift);
|
||||||
for (i=1;i<phase_shift;i++) {
|
for (i=1;i<phase_shift;i++) {
|
||||||
bus_w(addr,(INT_RSTN_BIT|ENET_RESETN_BIT|SW1_BIT|PHASE_STEP_BIT));//0x2821
|
bus_w(addr,(INT_RSTN_BIT|ENET_RESETN_BIT|SW1_BIT|PHASE_STEP_BIT));//0x2821
|
||||||
@ -392,7 +404,7 @@ int setPhaseShiftOnce(){
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
printf("Multipupose reg now:%x\n",bus_r(addr));
|
printf("Multipupose reg now:%x\n",bus_r(addr));
|
||||||
#endif
|
#endif
|
||||||
}
|
} else detectorFirstServer = 0;
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
@ -1261,8 +1273,6 @@ int setADC(int adc){
|
|||||||
|
|
||||||
int configureMAC(int ipad,long long int macad,long long int detectormacad, int detipad, int ival, int udpport){
|
int configureMAC(int ipad,long long int macad,long long int detectormacad, int detipad, int ival, int udpport){
|
||||||
|
|
||||||
startReceiver(1);
|
|
||||||
|
|
||||||
#ifdef DDEBUG
|
#ifdef DDEBUG
|
||||||
printf("Chip of Intrst Reg:%x\n",bus_r(CHIP_OF_INTRST_REG));
|
printf("Chip of Intrst Reg:%x\n",bus_r(CHIP_OF_INTRST_REG));
|
||||||
printf("IP Packet Size:%d\n",ipPacketSize);
|
printf("IP Packet Size:%d\n",ipPacketSize);
|
||||||
@ -1858,7 +1868,7 @@ int configureADC(){
|
|||||||
|
|
||||||
|
|
||||||
// start point
|
// start point
|
||||||
valw=0xff;
|
valw=0xffffffff;
|
||||||
bus_w(ADC_SPI_REG,(valw));
|
bus_w(ADC_SPI_REG,(valw));
|
||||||
|
|
||||||
//chip sel bar down
|
//chip sel bar down
|
||||||
@ -1869,23 +1879,28 @@ int configureADC(){
|
|||||||
//cldwn
|
//cldwn
|
||||||
valw=valw&(~(0x1<<cdx));
|
valw=valw&(~(0x1<<cdx));
|
||||||
bus_w(ADC_SPI_REG,valw);
|
bus_w(ADC_SPI_REG,valw);
|
||||||
usleep(0);
|
//usleep(0);
|
||||||
|
|
||||||
//write data (i)
|
//write data (i)
|
||||||
valw=(valw&(~(0x1<<ddx)))+(((codata>>(23-i))&0x1)<<ddx);
|
valw=(valw&(~(0x1<<ddx)))+(((codata>>(23-i))&0x1)<<ddx);
|
||||||
bus_w(ADC_SPI_REG,valw);
|
bus_w(ADC_SPI_REG,valw);
|
||||||
usleep(0);
|
//usleep(0);
|
||||||
|
|
||||||
//clkup
|
//clkup
|
||||||
valw=valw+(0x1<<cdx);
|
valw=valw+(0x1<<cdx);
|
||||||
bus_w(ADC_SPI_REG,valw);
|
bus_w(ADC_SPI_REG,valw);
|
||||||
usleep(0);
|
//usleep(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
valw |= csmask;
|
||||||
|
bus_w(ADC_SPI_REG,valw);
|
||||||
|
//usleep(0);
|
||||||
|
|
||||||
// stop point =start point
|
// stop point =start point
|
||||||
valw=valw&(~(0x1<<cdx));
|
valw=valw&(~(0x1<<cdx));
|
||||||
usleep(0);
|
bus_w(ADC_SPI_REG,(valw));
|
||||||
valw=0xff;
|
|
||||||
|
valw = 0xffffffff;
|
||||||
bus_w(ADC_SPI_REG,(valw));
|
bus_w(ADC_SPI_REG,(valw));
|
||||||
|
|
||||||
//usleep in between
|
//usleep in between
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
Path: slsDetectorsPackage/slsDetectorSoftware/gotthardDetectorServer
|
Path: slsDetectorsPackage/slsDetectorSoftware/gotthardDetectorServer
|
||||||
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||||
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||||
Repsitory UUID: 255931bbde2721a1d7ddf3422ba9ee79ec7655f5
|
Repsitory UUID: 9f84bf71759d607b957bcf1fc88eb22c59d8378a
|
||||||
Revision: 237
|
Revision: 238
|
||||||
Branch: 4.0.0
|
Branch: 4.0.0
|
||||||
Last Changed Author: Dhanya_Thattil
|
Last Changed Author: Dhanya_Thattil
|
||||||
Last Changed Rev: 4000
|
Last Changed Rev: 4004
|
||||||
Last Changed Date: 2018-09-18 17:37:25.000000002 +0200 ./server_funcs.c
|
Last Changed Date: 2018-09-21 13:58:41.000000002 +0200 ./server_funcs.c
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
|
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
|
||||||
#define GITREPUUID "255931bbde2721a1d7ddf3422ba9ee79ec7655f5"
|
#define GITREPUUID "9f84bf71759d607b957bcf1fc88eb22c59d8378a"
|
||||||
#define GITAUTH "Dhanya_Thattil"
|
#define GITAUTH "Dhanya_Thattil"
|
||||||
#define GITREV 0x4000
|
#define GITREV 0x4004
|
||||||
#define GITDATE 0x20180918
|
#define GITDATE 0x20180921
|
||||||
#define GITBRANCH "4.0.0"
|
#define GITBRANCH "4.0.0"
|
||||||
|
@ -87,6 +87,7 @@ int init_detector( int b) {
|
|||||||
//gotthard specific
|
//gotthard specific
|
||||||
setPhaseShiftOnce();
|
setPhaseShiftOnce();
|
||||||
configureADC();
|
configureADC();
|
||||||
|
|
||||||
setADC(-1); //already does setdaqreg and clean fifo
|
setADC(-1); //already does setdaqreg and clean fifo
|
||||||
setSettings(DYNAMICGAIN,-1);
|
setSettings(DYNAMICGAIN,-1);
|
||||||
setDefaultDacs();
|
setDefaultDacs();
|
||||||
@ -101,9 +102,8 @@ int init_detector( int b) {
|
|||||||
setTiming(GET_EXTERNAL_COMMUNICATION_MODE);
|
setTiming(GET_EXTERNAL_COMMUNICATION_MODE);
|
||||||
setMaster(GET_MASTER);
|
setMaster(GET_MASTER);
|
||||||
setSynchronization(GET_SYNCHRONIZATION_MODE);
|
setSynchronization(GET_SYNCHRONIZATION_MODE);
|
||||||
startReceiver(0);
|
startReceiver(1);
|
||||||
setMasterSlaveConfiguration();
|
setMasterSlaveConfiguration();
|
||||||
setADC(-1);
|
|
||||||
}
|
}
|
||||||
strcpy(mess,"dummy message");
|
strcpy(mess,"dummy message");
|
||||||
strcpy(lastClientIP,"none");
|
strcpy(lastClientIP,"none");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user