From 89aff651824c551bdf26e77fab61ad95e686ce3d Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Wed, 28 Jul 2021 17:16:02 +0200 Subject: [PATCH] get should not change parameters --- .../slsDetectorFunctionList.c | 47 +------------------ 1 file changed, 2 insertions(+), 45 deletions(-) diff --git a/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c index 5e1174f84..4e30442db 100644 --- a/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c @@ -953,7 +953,7 @@ enum detectorSettings setSettings(enum detectorSettings sett) { configureChip(); } - return getSettings(); + return thisSettings; } void validateSettings() { @@ -991,50 +991,7 @@ void validateSettings() { } } -enum detectorSettings getSettings() { - - uint32_t regval = bus_r(DAQ_REG); - uint32_t val = regval & DAQ_SETTINGS_MSK; - LOG(logDEBUG1, ("Getting Settings\n Reading DAQ Register :0x%x\n", val)); - - switch (val) { - case DAQ_FIX_GAIN_DYNMC_VAL: - thisSettings = DYNAMICGAIN; - LOG(logDEBUG1, - ("Settings read: Dynamic Gain. DAQ Reg: 0x%x\n", regval)); - break; - case DAQ_FIX_GAIN_HIGHGAIN_VAL: - thisSettings = DYNAMICHG0; - LOG(logDEBUG1, - ("Settings read: Dynamig High Gain. DAQ Reg: 0x%x\n", regval)); - break; - /* - case DAQ_FIX_GAIN_STG_1_VAL: - thisSettings = FIXGAIN1; - LOG(logDEBUG1, ("Settings read: Fix Gain 1. DAQ Reg: 0x%x\n", regval)); - break; - case DAQ_FIX_GAIN_STG_2_VAL: - thisSettings = FIXGAIN2; - LOG(logDEBUG1, ("Settings read: Fix Gain 2. DAQ Reg: 0x%x\n", regval)); - break; - case DAQ_FRCE_GAIN_STG_1_VAL: - thisSettings = FORCESWITCHG1; - LOG(logDEBUG1, - ("Settings read: Force Switch Gain 1. DAQ Reg: 0x%x\n", regval)); - break; - case DAQ_FRCE_GAIN_STG_2_VAL: - thisSettings = FORCESWITCHG2; - LOG(logDEBUG1, - ("Settings read: Force Switch Gain 2. DAQ Reg: 0x%x\n", regval)); - break; - */ - default: - thisSettings = UNDEFINED; - LOG(logERROR, ("Settings read: Undefined. DAQ Reg: 0x%x\n", regval)); - } - validateSettings(); - return thisSettings; -} +enum detectorSettings getSettings() { return thisSettings; } /* parameters - dac, adc, hv */ void setDAC(enum DACINDEX ind, int val, int mV) {