diff --git a/slsDetectorSoftware/jungfrauDetectorServer/firmware_funcs.c b/slsDetectorSoftware/jungfrauDetectorServer/firmware_funcs.c index 46532b854..4d9ea38c1 100755 --- a/slsDetectorSoftware/jungfrauDetectorServer/firmware_funcs.c +++ b/slsDetectorSoftware/jungfrauDetectorServer/firmware_funcs.c @@ -167,11 +167,13 @@ void resetFPGA(){ cprintf(BLUE,"\n*** Reseting FPGA ***\n"); FPGAdontTouchFlash(); FPGATouchFlash(); + usleep(250*1000); } void FPGAdontTouchFlash(){ //tell FPGA to not touch flash system("echo 0 > /sys/class/gpio/gpio9/value"); + //usleep(100*1000); } void FPGATouchFlash(){ @@ -1645,7 +1647,7 @@ int configureInterface(uint32_t destip,uint64_t destmac,uint64_t sourcemac,int #endif - bus_w(CONTROL_REG,GB10_RESET_BIT); + //bus_w(CONTROL_REG,GB10_RESET_BIT); //usleep(50 * 1000); bus_w(CONTROL_REG,0); //usleep(500* 1000); @@ -1691,7 +1693,7 @@ int configureMAC(uint32_t destip,uint64_t destmac,uint64_t sourcemac,int source - + /*volatile u_int32_t conf= bus_r(CONFIG_REG);*/ uint32_t sourceport = 0x7e9a; // 0xE185; int interface=0; int ngb; diff --git a/slsDetectorSoftware/jungfrauDetectorServer/jungfrauDetectorServerv2.2.0 b/slsDetectorSoftware/jungfrauDetectorServer/jungfrauDetectorServerv2.2.0 index f39d3b28b..787bef067 100755 Binary files a/slsDetectorSoftware/jungfrauDetectorServer/jungfrauDetectorServerv2.2.0 and b/slsDetectorSoftware/jungfrauDetectorServer/jungfrauDetectorServerv2.2.0 differ diff --git a/slsDetectorSoftware/jungfrauDetectorServer/registers_m.h b/slsDetectorSoftware/jungfrauDetectorServer/registers_m.h index 1fd30a8e2..9e4889e53 100755 --- a/slsDetectorSoftware/jungfrauDetectorServer/registers_m.h +++ b/slsDetectorSoftware/jungfrauDetectorServer/registers_m.h @@ -312,7 +312,7 @@ #define RUNSTATE_0_BIT 0x00001000 #define RUNSTATE_1_BIT 0x00002000 #define RUNSTATE_2_BIT 0x00004000 -#define STOPPED_BIT 0x00008000 // error! +#define STOPPED_BIT 0x00008000 // stopped! #define ALL_FIFO_EMPTY_BIT 0x00010000 // data ready #define RUNMACHINE_BUSY_BIT 0x00020000 #define READMACHINE_BUSY_BIT 0x00040000 diff --git a/slsDetectorSoftware/jungfrauDetectorServer/server_funcs.c b/slsDetectorSoftware/jungfrauDetectorServer/server_funcs.c index 9eb31029a..1aa941a7b 100755 --- a/slsDetectorSoftware/jungfrauDetectorServer/server_funcs.c +++ b/slsDetectorSoftware/jungfrauDetectorServer/server_funcs.c @@ -58,8 +58,8 @@ int init_detector(int b) { if(b){ defineGPIOpins(); resetFPGA(); - usleep(250*1000); - } + }else + usleep(300*1000); if (mapCSP0()==FAIL) { printf("Could not map memory\n"); @@ -3180,7 +3180,6 @@ int reset_fpga(int file_des) { sprintf(mess,"Reset FPGA unsuccessful\n"); resetFPGA(); - usleep(250*1000); initializeDetector(); ret = FORCE_UPDATE; diff --git a/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp b/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp index ddfd8fa43..e57fc2c48 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp @@ -37,6 +37,9 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) { descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdStatus; i++; + descrToFuncMap[i].m_pFuncName="datastream"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDataStream; + i++; /* Detector structure configuration and debugging commands */ @@ -1361,6 +1364,44 @@ string slsDetectorCommand::helpStatus(int narg, char *args[], int action) { } + +string slsDetectorCommand::cmdDataStream(int narg, char *args[], int action) { + +#ifdef VERBOSE + cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); +#endif + int ival=-1; + char ans[100]=""; + + myDet->setOnline(ONLINE_FLAG); + myDet->setReceiverOnline(ONLINE_FLAG); + + if (action==HELP_ACTION) + return helpStatus(narg,args,HELP_ACTION); + + if (action==PUT_ACTION) { + if (!sscanf(args[1],"%d",&ival)) + return string ("cannot scan datastream mode"); + + myDet->enableDataStreamingFromReceiver(ival); + } + sprintf(ans,"%d",myDet->enableDataStreamingFromReceiver()); + return string(ans); +} + + +string slsDetectorCommand::helpDataStream(int narg, char *args[], int action) { + + ostringstream os; + if (action==GET_ACTION || action==HELP_ACTION) + os << string("datastream \t gets if zmq data stream from receiver is enabled. \n"); + if (action==PUT_ACTION || action==HELP_ACTION) + os << string("datastream i\t enables/disables the zmq data stream from receiver. \n"); + return os.str(); +} + + + string slsDetectorCommand::cmdFree(int narg, char *args[], int action) { #ifdef VERBOSE diff --git a/slsDetectorSoftware/slsDetector/slsDetectorCommand.h b/slsDetectorSoftware/slsDetector/slsDetectorCommand.h index 454e01f9f..dd8b4c73c 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorCommand.h +++ b/slsDetectorSoftware/slsDetector/slsDetectorCommand.h @@ -38,6 +38,7 @@ class slsDetectorCommand : public virtual slsDetectorDefs { static string helpData(int narg, char *args[], int action); static string helpFrame(int narg, char *args[], int action); static string helpStatus(int narg, char *args[], int action); + static string helpDataStream(int narg, char *args[], int action); static string helpFree(int narg, char *args[], int action); static string helpAdd(int narg, char *args[], int action); static string helpRemove(int narg, char *args[], int action); @@ -109,6 +110,7 @@ class slsDetectorCommand : public virtual slsDetectorDefs { string cmdData(int narg, char *args[], int action); string cmdFrame(int narg, char *args[], int action); string cmdStatus(int narg, char *args[], int action); + string cmdDataStream(int narg, char *args[], int action); string cmdFree(int narg, char *args[], int action); string cmdAdd(int narg, char *args[], int action); string cmdRemove(int narg, char *args[], int action);