mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-22 03:40:04 +02:00
m3 server: setting counter mask, set vth[i] for counter[i] and its M_VTH1, not VTH1
This commit is contained in:
parent
ac613171ec
commit
224c8d9f8d
@ -5,8 +5,8 @@
|
||||
#include "RegisterDefs.h"
|
||||
#include "clogger.h"
|
||||
#include "common.h"
|
||||
#include "mythen3.h"
|
||||
#include "loadPattern.h"
|
||||
#include "mythen3.h"
|
||||
#include "sharedMemory.h"
|
||||
#include "sls/versionAPI.h"
|
||||
#ifdef VIRTUAL
|
||||
@ -21,7 +21,6 @@
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
|
||||
// Global variable from slsDetectorServer_funcs
|
||||
extern int debugflag;
|
||||
extern int updateFlag;
|
||||
@ -379,7 +378,6 @@ void allocateDetectorStructureMemory() {
|
||||
memset(channelMask, 0, NCHIP * NCHAN * sizeof(char));
|
||||
detectorDacs = malloc(NDAC * sizeof(int));
|
||||
|
||||
|
||||
LOG(logDEBUG1,
|
||||
("modules from 0x%x to 0x%x\n", detectorModules, detectorModules));
|
||||
LOG(logDEBUG1, ("chans from 0x%x to 0x%x\n", detectorChans, detectorChans));
|
||||
@ -938,8 +936,9 @@ void setCounterMask(uint32_t arg) {
|
||||
for (int i = 0; i < NCOUNTERS; ++i) {
|
||||
// if change in enable
|
||||
if ((arg & (1 << i)) ^ (oldmask & (1 << i))) {
|
||||
// will disable if counter disabled
|
||||
setDAC(VTH1, vthEnabledVals[i], 0);
|
||||
// will disable if counter disabled, else set corresponding vth dac
|
||||
enum DACINDEX vth = (i == 0 ? M_VTH1 : (i == 1 ? M_VTH2 : M_VTH3));
|
||||
setDAC(vth, vthEnabledVals[i], 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1074,7 +1073,6 @@ int setDACS(int* dacs){
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
||||
int setModule(sls_detector_module myMod, char *mess) {
|
||||
LOG(logINFO, ("Setting module\n"));
|
||||
|
||||
@ -1267,6 +1265,12 @@ void setDAC(enum DACINDEX ind, int val, int mV) {
|
||||
return;
|
||||
}
|
||||
|
||||
// out of scope, NDAC + 1 for vthreshold
|
||||
if ((int)ind > NDAC + 1) {
|
||||
LOG(logERROR, ("Unknown dac index %d\n", ind));
|
||||
return;
|
||||
}
|
||||
|
||||
if (ind == M_VTHRESHOLD) {
|
||||
LOG(logINFO,
|
||||
("Setting Threshold voltages to %d %s\n", val, (mV ? "mv" : "")));
|
||||
@ -1373,9 +1377,7 @@ int setHighVoltage(int val) {
|
||||
return highvoltage;
|
||||
}
|
||||
|
||||
int isMaster(){
|
||||
return !(bus_r(0x18) >> 31);
|
||||
}
|
||||
int isMaster() { return !(bus_r(0x18) >> 31); }
|
||||
|
||||
/* parameters - timing */
|
||||
void setTiming(enum timingMode arg) {
|
||||
|
@ -289,8 +289,6 @@ int64_t getMeasurementTime();
|
||||
int setModule(sls_detector_module myMod, char *mess);
|
||||
#endif
|
||||
#ifdef MYTHEN3D
|
||||
int setBit(int ibit, int patword);
|
||||
int clearBit(int ibit, int patword);
|
||||
int setTrimbits(int *trimbits);
|
||||
int setAllTrimbits(int val);
|
||||
int getAllTrimbits();
|
||||
|
Loading…
x
Reference in New Issue
Block a user