mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-21 11:20:04 +02:00
changed from int to uint32_t in read and writeRegister
This commit is contained in:
parent
3878212ffd
commit
339956e5de
@ -4834,16 +4834,16 @@ int multiSlsDetector::saveCalibrationFile(string fname, int imod) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int multiSlsDetector::writeRegister(int addr, int val){
|
uint32_t multiSlsDetector::writeRegister(uint32_t addr, uint32_t val){
|
||||||
|
|
||||||
int ret, ret1=-100;
|
uint32_t ret, ret1;
|
||||||
|
|
||||||
for (int i=0; i<thisMultiDetector->numberOfDetectors; ++i) {
|
for (int i=0; i<thisMultiDetector->numberOfDetectors; ++i) {
|
||||||
if (detectors[i]) {
|
if (detectors[i]) {
|
||||||
ret=detectors[i]->writeRegister(addr,val);
|
ret=detectors[i]->writeRegister(addr,val);
|
||||||
if(detectors[i]->getErrorMask())
|
if(detectors[i]->getErrorMask())
|
||||||
setErrorMask(getErrorMask()|(1<<i));
|
setErrorMask(getErrorMask()|(1<<i));
|
||||||
if (ret1==-100)
|
if (i==0)
|
||||||
ret1=ret;
|
ret1=ret;
|
||||||
else if (ret!=ret1) {
|
else if (ret!=ret1) {
|
||||||
// not setting it to -1 as it is a possible value
|
// not setting it to -1 as it is a possible value
|
||||||
@ -4881,16 +4881,16 @@ int multiSlsDetector::writeAdcRegister(int addr, int val){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int multiSlsDetector::readRegister(int addr){
|
uint32_t multiSlsDetector::readRegister(uint32_t addr){
|
||||||
|
|
||||||
int ret, ret1=-100;
|
uint32_t ret, ret1;
|
||||||
|
|
||||||
for (int i=0; i<thisMultiDetector->numberOfDetectors; ++i) {
|
for (int i=0; i<thisMultiDetector->numberOfDetectors; ++i) {
|
||||||
if (detectors[i]) {
|
if (detectors[i]) {
|
||||||
ret=detectors[i]->readRegister(addr);
|
ret=detectors[i]->readRegister(addr);
|
||||||
if(detectors[i]->getErrorMask())
|
if(detectors[i]->getErrorMask())
|
||||||
setErrorMask(getErrorMask()|(1<<i));
|
setErrorMask(getErrorMask()|(1<<i));
|
||||||
if (ret1==-100)
|
if (i==0)
|
||||||
ret1=ret;
|
ret1=ret;
|
||||||
else if (ret!=ret1) {
|
else if (ret!=ret1) {
|
||||||
// not setting it to -1 as it is a possible value
|
// not setting it to -1 as it is a possible value
|
||||||
|
@ -1066,13 +1066,13 @@ class multiSlsDetector : public slsDetectorUtils {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int writeRegister(int addr, int val);
|
uint32_t writeRegister(uint32_t addr, uint32_t val);
|
||||||
|
|
||||||
|
|
||||||
int writeAdcRegister(int addr, int val);
|
int writeAdcRegister(int addr, int val);
|
||||||
|
|
||||||
|
|
||||||
int readRegister(int addr);
|
uint32_t readRegister(uint32_t addr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
sets a bit in a register
|
sets a bit in a register
|
||||||
|
@ -2309,13 +2309,13 @@ int slsDetector::digitalTest( digitalTestMode mode, int imod){
|
|||||||
|
|
||||||
/* write or read register */
|
/* write or read register */
|
||||||
|
|
||||||
int slsDetector::writeRegister(int addr, int val){
|
uint32_t slsDetector::writeRegister(uint32_t addr, uint32_t val){
|
||||||
|
|
||||||
int retval=-1;
|
uint32_t retval = 0;
|
||||||
int fnum=F_WRITE_REGISTER;
|
int fnum=F_WRITE_REGISTER;
|
||||||
int ret=FAIL;
|
int ret=FAIL;
|
||||||
char mess[MAX_STR_LENGTH]="";
|
char mess[MAX_STR_LENGTH]="";
|
||||||
int arg[2];
|
uint32_t arg[2];
|
||||||
arg[0]=addr;
|
arg[0]=addr;
|
||||||
arg[1]=val;
|
arg[1]=val;
|
||||||
|
|
||||||
@ -2358,7 +2358,7 @@ int slsDetector::writeAdcRegister(int addr, int val){
|
|||||||
int ret=FAIL;
|
int ret=FAIL;
|
||||||
char mess[MAX_STR_LENGTH]="";
|
char mess[MAX_STR_LENGTH]="";
|
||||||
|
|
||||||
int arg[2];
|
uint32_t arg[2];
|
||||||
arg[0]=addr;
|
arg[0]=addr;
|
||||||
arg[1]=val;
|
arg[1]=val;
|
||||||
|
|
||||||
@ -2397,13 +2397,13 @@ int slsDetector::writeAdcRegister(int addr, int val){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int slsDetector::readRegister(int addr){
|
uint32_t slsDetector::readRegister(uint32_t addr){
|
||||||
|
|
||||||
int retval=-1;
|
uint32_t retval = 0;
|
||||||
int fnum=F_READ_REGISTER;
|
int fnum=F_READ_REGISTER;
|
||||||
int ret=FAIL;
|
int ret=FAIL;
|
||||||
char mess[MAX_STR_LENGTH]="";
|
char mess[MAX_STR_LENGTH]="";
|
||||||
int arg;
|
uint32_t arg;
|
||||||
arg=addr;
|
arg=addr;
|
||||||
|
|
||||||
|
|
||||||
|
@ -864,7 +864,7 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
|
|||||||
\returns current register value
|
\returns current register value
|
||||||
|
|
||||||
*/
|
*/
|
||||||
int writeRegister(int addr, int val);
|
uint32_t writeRegister(uint32_t addr, uint32_t val);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -882,7 +882,7 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
|
|||||||
\returns current register value
|
\returns current register value
|
||||||
|
|
||||||
*/
|
*/
|
||||||
int readRegister(int addr);
|
uint32_t readRegister(uint32_t addr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
sets a bit in a register
|
sets a bit in a register
|
||||||
|
@ -497,7 +497,7 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
|
|||||||
|
|
||||||
DO NOT USE!!! ONLY EXPERT USER!!!
|
DO NOT USE!!! ONLY EXPERT USER!!!
|
||||||
*/
|
*/
|
||||||
virtual int writeRegister(int addr, int val)=0;
|
virtual uint32_t writeRegister(uint32_t addr, uint32_t val)=0;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -518,7 +518,7 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
|
|||||||
|
|
||||||
DO NOT USE!!! ONLY EXPERT USER!!!
|
DO NOT USE!!! ONLY EXPERT USER!!!
|
||||||
*/
|
*/
|
||||||
virtual int readRegister(int addr)=0;
|
virtual uint32_t readRegister(uint32_t addr)=0;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user