mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-22 01:27:59 +02:00
trim crash fix
This commit is contained in:
@ -742,17 +742,21 @@ int setTrimbits(int *trimbits) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int setAllTrimbits(int val) {
|
int setAllTrimbits(int val) {
|
||||||
int trimbits[NCHAN];
|
int *trimbits = malloc(sizeof(int) * NCHAN);
|
||||||
int ichan = 0;
|
int ichan = 0;
|
||||||
for (ichan = 0; ichan < NCHAN; ++ichan) {
|
for (ichan = 0; ichan < NCHAN; ++ichan) {
|
||||||
trimbits[ichan] = val;
|
trimbits[ichan] = val;
|
||||||
}
|
}
|
||||||
if (setTrimbits(trimbits) == FAIL) {
|
if (setTrimbits(trimbits) == FAIL) {
|
||||||
LOG(logERROR, ("Could not set all trimbits to %d\n", val));
|
LOG(logERROR, ("Could not set all trimbits to %d\n", val));
|
||||||
|
free(trimbits);
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
// setSettings(UNDEFINED);
|
||||||
|
// LOG(logERROR, ("Settings has been changed to undefined (random "
|
||||||
|
// "trim file)\n"));
|
||||||
LOG(logINFO, ("All trimbits have been set to %d\n", val));
|
LOG(logINFO, ("All trimbits have been set to %d\n", val));
|
||||||
|
free(trimbits);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user