This commit is contained in:
maliakal_d 2021-07-29 17:39:22 +02:00
parent 3f08d6699c
commit c0312c9bb6
2 changed files with 17 additions and 17 deletions

View File

@ -1041,24 +1041,24 @@ void validateSettings() {
// if any special dac value is changed individually => undefined // if any special dac value is changed individually => undefined
const int specialDacs[NSPECIALDACS] = SPECIALDACINDEX; const int specialDacs[NSPECIALDACS] = SPECIALDACINDEX;
int *specialDacValues[] = {defaultDacValue_G0, defaultDacValue_HG0}; int *specialDacValues[] = {defaultDacValue_G0, defaultDacValue_HG0};
int settList[NUMSETTINGS] = {DYNAMICGAIN, DYNAMICHG0}; int settList[] = {DYNAMICGAIN, DYNAMICHG0};
enum detectorSettings sett = UNDEFINED; enum detectorSettings sett = UNDEFINED;
for (int isett = 0; isett != NUMSETTINGS; ++isett) { for (int isett = 0; isett != NUMSETTINGS; ++isett) {
// assume it matches current setting in list // assume it matches current setting in list
sett = settList[isett]; sett = settList[isett];
// if one value does not match, = undefined // if one value does not match, = undefined
for (int i = 0; i < NSPECIALDACS; ++i) { for (int i = 0; i < NSPECIALDACS; ++i) {
if (getDAC(specialDacs[i], 0) != specialDacValues[isett][i]) { if (getDAC(specialDacs[i], 0) != specialDacValues[isett][i]) {
sett = UNDEFINED; sett = UNDEFINED;
break; break;
} }
} }
// all values matchd a setting // all values matchd a setting
if (sett != UNDEFINED) { if (sett != UNDEFINED) {
break; break;
} }
} }
// update settings // update settings
if (thisSettings != sett) { if (thisSettings != sett) {

View File

@ -1368,7 +1368,7 @@ void validateSettings() {
const int specialDacs[NSPECIALDACS] = SPECIALDACINDEX; const int specialDacs[NSPECIALDACS] = SPECIALDACINDEX;
int *specialDacValues[] = {defaultDacValue_standard, defaultDacValue_fast, int *specialDacValues[] = {defaultDacValue_standard, defaultDacValue_fast,
defaultDacValue_highgain}; defaultDacValue_highgain};
int settList[NUMSETTINGS] = {STANDARD, FAST, HIGHGAIN}; int settList[] = {STANDARD, FAST, HIGHGAIN};
enum detectorSettings sett = UNDEFINED; enum detectorSettings sett = UNDEFINED;
for (int isett = 0; isett != NUMSETTINGS; ++isett) { for (int isett = 0; isett != NUMSETTINGS; ++isett) {