mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-21 09:08:00 +02:00
m3: vthreshold set/get only enabled counters but remember value, vth always overwrite, disable counter sets vth to 2800, enable counter sets saved values
This commit is contained in:
@ -1238,34 +1238,6 @@ int validateAndSetDac(enum dacIndex ind, int val, int mV) {
|
||||
ret = OK;
|
||||
} else {
|
||||
ret = FAIL;
|
||||
#ifdef MYTHEN3D
|
||||
// give a different exception message if counter not enabled
|
||||
int isCounterError = 0;
|
||||
if (serverDacIndex == M_VTHRESHOLD ||
|
||||
serverDacIndex == M_VTH1 || serverDacIndex == M_VTH2 ||
|
||||
serverDacIndex == M_VTH3) {
|
||||
uint32_t counter_retval = getCounterMask();
|
||||
// vthreshold, all counters should have been enabled
|
||||
if (serverDacIndex == M_VTHRESHOLD) {
|
||||
if (counter_retval != MAX_COUNTER_MSK) {
|
||||
isCounterError = 1;
|
||||
}
|
||||
}
|
||||
// corresponding counter should have been enabled
|
||||
else {
|
||||
int vthdacs[] = {M_VTH1, M_VTH2, M_VTH3};
|
||||
for (int i = 0; i < NCOUNTERS; ++i) {
|
||||
if ((vthdacs[i] == (int)serverDacIndex) &&
|
||||
(!(counter_retval & (1 << i)))) {
|
||||
isCounterError = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isCounterError) {
|
||||
strcpy(mess, "Could not set dac as counter disabled\n");
|
||||
} else
|
||||
#endif
|
||||
sprintf(mess, "Setting dac %d : wrote %d but read %d\n",
|
||||
serverDacIndex, val, retval);
|
||||
LOG(logERROR, (mess));
|
||||
|
Reference in New Issue
Block a user