fixed jungfrau image after programfpga, fixed resetfpga

This commit is contained in:
Dhanya Maliakal 2017-09-14 15:55:55 +02:00
parent 49378e6d09
commit c635b19941
7 changed files with 31 additions and 16 deletions

View File

@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorSoftware/jungfrauDetectorServer
URL: origin git@git.psi.ch:sls_detectors_software/sls_detector_software.git
Repository Root: origin git@git.psi.ch:sls_detectors_software/sls_detector_software.git
Repsitory UUID: c58dfe801770ceb63a9baab0be5b4cd16794b57e
Revision: 89
Branch: 3.0-rc
Repsitory UUID: 037182a000f003ee636f25cd50a622c608c9e646
Revision: 90
Branch: developer
Last Changed Author: Dhanya_Maliakal
Last Changed Rev: 1495
Last Changed Date: 2017-08-15 14:14:32.000000002 +0200 ./RegisterDefs.h
Last Changed Rev: 1562
Last Changed Date: 2017-09-14 11:50:30.000000002 +0200 ./Makefile

View File

@ -1,11 +1,11 @@
//#define SVNPATH ""
#define SVNURL "git@git.psi.ch:sls_detectors_software/sls_detector_software.git"
//#define SVNREPPATH ""
#define SVNREPUUID "c58dfe801770ceb63a9baab0be5b4cd16794b57e"
//#define SVNREV 0x1495
#define SVNREPUUID "037182a000f003ee636f25cd50a622c608c9e646"
//#define SVNREV 0x1562
//#define SVNKIND ""
//#define SVNSCHED ""
#define SVNAUTH "Dhanya_Maliakal"
#define SVNREV 0x1495
#define SVNDATE 0x20170815
#define SVNREV 0x1562
#define SVNDATE 0x20170914
//

View File

@ -254,7 +254,7 @@ u_int32_t getDetectorIP(){
/* initialization */
void initControlServer(){
clkPhase[0] = 0; clkPhase[1] = 0;
setupDetector();
printf("\n");
}
@ -336,7 +336,7 @@ void setupDetector() {
}
}
bus_w(DAQ_REG, 0x0); /* Only once at server startup */
bus_w(DAQ_REG, 0x0); /* Only once at server startup */
setSpeed(CLOCK_DIVIDER, HALF_SPEED);
cleanFifos(); /* todo might work without */
resetCore(); /* todo might work without */

View File

@ -7249,6 +7249,15 @@ int slsDetector::programFPGA(string fname){
if (ret==FORCE_UPDATE)
updateDetector();
}
//remapping stop server
fnum=F_RESET_FPGA;
int stopret;
if (connectStop() == OK){
stopSocket->SendDataOnly(&fnum,sizeof(fnum));
stopSocket->ReceiveDataOnly(&stopret,sizeof(stopret));
disconnectControl();
}
}
//free resources
@ -7272,17 +7281,15 @@ int slsDetector::resetFPGA(){
std::cout<< "Sending reset to FPGA " << endl;
#endif
if (thisDetector->onlineFlag==ONLINE_FLAG) {
// control server
if (connectControl() == OK){
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
//check opening error
controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
if (ret==FAIL) {
controlSocket->ReceiveDataOnly(mess,sizeof(mess));
std::cout<< "Detector returned error: " << mess << std::endl;
setErrorMask((getErrorMask())|(RESET_ERROR));
}
disconnectControl();
if (ret==FORCE_UPDATE)
updateDetector();

View File

@ -37,6 +37,7 @@ int sockfd; // (updated in slsDetectorServer) as extern
int (*flist[NUM_DET_FUNCTIONS])(int);
char mess[MAX_STR_LENGTH];
int dataBytes = 10;
int isControlServer = 0;
/* initialization functions */
@ -59,8 +60,10 @@ void init_detector(int controlserver) {
#endif
#ifdef SLS_DETECTOR_FUNCTION_LIST
if (controlserver)
if (controlserver) {
isControlServer = 1;
initControlServer();
}
else initStopServer();
#endif
strcpy(mess,"dummy message");
@ -4601,6 +4604,9 @@ int program_fpga(int file_des) {
#ifdef VERY_VERBOSE
printf("Done with program receiving command\n");
#endif
if (isControlServer)
basictests();
init_detector(isControlServer);
}
#endif
if (ret==OK)
@ -4646,7 +4652,9 @@ int reset_fpga(int file_des) {
}
#ifdef SLS_DETECTOR_FUNCTION_LIST
else {
initControlServer();
if (isControlServer)
basictests();
init_detector(isControlServer);
ret = FORCE_UPDATE;
}
#endif