mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-28 01:00:02 +02:00
reset to hardware evn if no file
This commit is contained in:
parent
30078d6c1f
commit
6620027439
@ -456,6 +456,8 @@ int readConfigFile() {
|
||||
|
||||
FILE *fd = fopen(CONFIG_FILE, "r");
|
||||
if (fd == NULL) {
|
||||
// reset to hardware settings if not in config file (if overwritten)
|
||||
resetToHardwareSettings();
|
||||
return OK;
|
||||
}
|
||||
LOG(logINFO, ("Reading config file %s\n", CONFIG_FILE));
|
||||
@ -565,6 +567,18 @@ int readConfigFile() {
|
||||
fclose(fd);
|
||||
|
||||
// reset to hardware settings if not in config file (if overwritten)
|
||||
resetToHardwareSettings();
|
||||
|
||||
if (strlen(initErrorMessage)) {
|
||||
initError = FAIL;
|
||||
LOG(logERROR, ("%s\n\n", initErrorMessage));
|
||||
} else {
|
||||
LOG(logINFO, ("Successfully read config file\n"));
|
||||
}
|
||||
return initError;
|
||||
}
|
||||
|
||||
int resetToHardwareSettings() {
|
||||
#ifndef VIRTUAL
|
||||
if (top == -1) {
|
||||
if (!Beb_SetTop(TOP_HARDWARE)) {
|
||||
@ -595,14 +609,6 @@ int readConfigFile() {
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (strlen(initErrorMessage)) {
|
||||
initError = FAIL;
|
||||
LOG(logERROR, ("%s\n\n", initErrorMessage));
|
||||
} else {
|
||||
LOG(logINFO, ("Successfully read config file\n"));
|
||||
}
|
||||
return initError;
|
||||
}
|
||||
|
||||
/* set up detector */
|
||||
|
@ -115,6 +115,9 @@ int setDefaultDacs();
|
||||
#if defined(GOTTHARD2D) || defined(EIGERD)
|
||||
int readConfigFile();
|
||||
#endif
|
||||
#ifdef EIGERD
|
||||
int resetToHardwareSettings();
|
||||
#endif
|
||||
|
||||
// advanced read/write reg
|
||||
#ifdef EIGERD
|
||||
|
Loading…
x
Reference in New Issue
Block a user