mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 18:17:59 +02:00
Defaultdacs (#214)
This commit is contained in:
Binary file not shown.
@ -681,18 +681,7 @@ void allocateDetectorStructureMemory() {
|
||||
void setupDetector() {
|
||||
|
||||
allocateDetectorStructureMemory();
|
||||
// set dacs
|
||||
LOG(logINFOBLUE, ("Setting Default Dac values\n"));
|
||||
{
|
||||
const int defaultvals[NDAC] = DEFAULT_DAC_VALS;
|
||||
for (int i = 0; i < NDAC; ++i) {
|
||||
setDAC((enum DACINDEX)i, defaultvals[i], 0);
|
||||
if ((detectorModules)->dacs[i] != defaultvals[i]) {
|
||||
LOG(logERROR, ("Setting dac %d failed, wrote %d, read %d\n", i,
|
||||
defaultvals[i], (detectorModules)->dacs[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
setDefaultDacs();
|
||||
#ifdef VIRTUAL
|
||||
sharedMemory_setStatus(IDLE);
|
||||
#endif
|
||||
@ -754,6 +743,21 @@ void setupDetector() {
|
||||
LOG(logDEBUG1, ("Setup detector done\n\n"));
|
||||
}
|
||||
|
||||
int setDefaultDacs() {
|
||||
int ret = OK;
|
||||
LOG(logINFOBLUE, ("Setting Default Dac values\n"));
|
||||
const int defaultvals[NDAC] = DEFAULT_DAC_VALS;
|
||||
for (int i = 0; i < NDAC; ++i) {
|
||||
setDAC((enum DACINDEX)i, defaultvals[i], 0);
|
||||
if ((detectorModules)->dacs[i] != defaultvals[i]) {
|
||||
ret = FAIL;
|
||||
LOG(logERROR, ("Setting dac %d failed, wrote %d, read %d\n", i,
|
||||
defaultvals[i], (detectorModules)->dacs[i]));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* advanced read/write reg */
|
||||
int writeRegister(uint32_t offset, uint32_t data) {
|
||||
#ifdef VIRTUAL
|
||||
|
Reference in New Issue
Block a user