mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-29 09:30: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");
|
FILE *fd = fopen(CONFIG_FILE, "r");
|
||||||
if (fd == NULL) {
|
if (fd == NULL) {
|
||||||
|
// reset to hardware settings if not in config file (if overwritten)
|
||||||
|
resetToHardwareSettings();
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
LOG(logINFO, ("Reading config file %s\n", CONFIG_FILE));
|
LOG(logINFO, ("Reading config file %s\n", CONFIG_FILE));
|
||||||
@ -565,6 +567,18 @@ int readConfigFile() {
|
|||||||
fclose(fd);
|
fclose(fd);
|
||||||
|
|
||||||
// reset to hardware settings if not in config file (if overwritten)
|
// 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
|
#ifndef VIRTUAL
|
||||||
if (top == -1) {
|
if (top == -1) {
|
||||||
if (!Beb_SetTop(TOP_HARDWARE)) {
|
if (!Beb_SetTop(TOP_HARDWARE)) {
|
||||||
@ -595,14 +609,6 @@ int readConfigFile() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#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 */
|
/* set up detector */
|
||||||
|
@ -115,6 +115,9 @@ int setDefaultDacs();
|
|||||||
#if defined(GOTTHARD2D) || defined(EIGERD)
|
#if defined(GOTTHARD2D) || defined(EIGERD)
|
||||||
int readConfigFile();
|
int readConfigFile();
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef EIGERD
|
||||||
|
int resetToHardwareSettings();
|
||||||
|
#endif
|
||||||
|
|
||||||
// advanced read/write reg
|
// advanced read/write reg
|
||||||
#ifdef EIGERD
|
#ifdef EIGERD
|
||||||
|
Loading…
x
Reference in New Issue
Block a user