diff --git a/slsDetectorSoftware/jungfrauDetectorServer/RegisterDefs.h b/slsDetectorSoftware/jungfrauDetectorServer/RegisterDefs.h index 0875a7a35..03aba561d 100644 --- a/slsDetectorSoftware/jungfrauDetectorServer/RegisterDefs.h +++ b/slsDetectorSoftware/jungfrauDetectorServer/RegisterDefs.h @@ -302,6 +302,8 @@ #define DAQ_SETTINGS_MSK (DAQ_HIGH_GAIN_MSK | DAQ_FIX_GAIN_MSK | DAQ_FRCE_SWTCH_GAIN_MSK) #define DAQ_HIGH_GAIN_OFST (0) #define DAQ_HIGH_GAIN_MSK (0x00000001 << DAQ_HIGH_GAIN_OFST) +#define DAQ_FIX_GAIN_DYNMC_VAL ((0x0 << DAQ_HIGH_GAIN_OFST) & DAQ_HIGH_GAIN_MSK) +#define DAQ_FIX_GAIN_HIGHGAIN_VAL ((0x1 << DAQ_HIGH_GAIN_OFST) & DAQ_HIGH_GAIN_MSK) #define DAQ_FIX_GAIN_OFST (1) #define DAQ_FIX_GAIN_MSK (0x00000003 << DAQ_FIX_GAIN_OFST) #define DAQ_FIX_GAIN_STG_1_VAL ((0x1 << DAQ_FIX_GAIN_OFST) & DAQ_FIX_GAIN_MSK) diff --git a/slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServer_jungfraunew b/slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServer_jungfraunew index 67b9fb957..e9ded63e4 100755 Binary files a/slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServer_jungfraunew and b/slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServer_jungfraunew differ diff --git a/slsDetectorSoftware/jungfrauDetectorServer/gitInfo.txt b/slsDetectorSoftware/jungfrauDetectorServer/gitInfo.txt index 6afa90e77..0475cfcf1 100644 --- a/slsDetectorSoftware/jungfrauDetectorServer/gitInfo.txt +++ b/slsDetectorSoftware/jungfrauDetectorServer/gitInfo.txt @@ -1,9 +1,9 @@ Path: slsDetectorsPackage/slsDetectorSoftware/jungfrauDetectorServer URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git -Repsitory UUID: 03e781a0ac53cb73af5d00003a131383125ab40f -Revision: 141 +Repsitory UUID: c9675d111a61075ebe4031ec6bdf285a76be0fce +Revision: 142 Branch: jungfraunew Last Changed Author: Dhanya_Thattil -Last Changed Rev: 3776 -Last Changed Date: 2018-04-23 16:06:57.000000002 +0200 ./RegisterDefs.h +Last Changed Rev: 3777 +Last Changed Date: 2018-04-26 15:44:15.000000002 +0200 ./RegisterDefs.h diff --git a/slsDetectorSoftware/jungfrauDetectorServer/gitInfoJungfrau.h b/slsDetectorSoftware/jungfrauDetectorServer/gitInfoJungfrau.h index 61955d913..12f7a694c 100644 --- a/slsDetectorSoftware/jungfrauDetectorServer/gitInfoJungfrau.h +++ b/slsDetectorSoftware/jungfrauDetectorServer/gitInfoJungfrau.h @@ -1,6 +1,6 @@ #define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git" -#define GITREPUUID "03e781a0ac53cb73af5d00003a131383125ab40f" +#define GITREPUUID "c9675d111a61075ebe4031ec6bdf285a76be0fce" #define GITAUTH "Dhanya_Thattil" -#define GITREV 0x3776 -#define GITDATE 0x20180423 +#define GITREV 0x3777 +#define GITDATE 0x20180426 #define GITBRANCH "jungfraunew" diff --git a/slsDetectorSoftware/jungfrauDetectorServer/slsDetectorFunctionList.c b/slsDetectorSoftware/jungfrauDetectorServer/slsDetectorFunctionList.c index 5a7cb80d1..650450dc7 100644 --- a/slsDetectorSoftware/jungfrauDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorSoftware/jungfrauDetectorServer/slsDetectorFunctionList.c @@ -824,7 +824,7 @@ enum detectorSettings setSettings(enum detectorSettings sett, int imod){ break; case DYNAMICHG0: bus_w(DAQ_REG, bus_r(DAQ_REG) & ~DAQ_SETTINGS_MSK); - bus_w(DAQ_REG, bus_r(DAQ_REG) | DAQ_HIGH_GAIN_MSK); + bus_w(DAQ_REG, bus_r(DAQ_REG) | DAQ_FIX_GAIN_HIGHGAIN_VAL); printf("\nConfigured settings - Dyanmic High Gain 0, DAQ Reg: 0x%x\n", bus_r(DAQ_REG)); break; case FIXGAIN1: @@ -862,37 +862,37 @@ enum detectorSettings setSettings(enum detectorSettings sett, int imod){ enum detectorSettings getSettings(){ - uint32_t val = bus_r(DAQ_REG); + uint32_t val = bus_r(DAQ_REG) & DAQ_SETTINGS_MSK; printf("\nGetting Settings\n Reading DAQ Register :0x%x\n", val); - if (val & DAQ_FRCE_GAIN_STG_2_VAL) { - thisSettings = FORCESWITCHG2; - printf("Settings read: FORCESWITCHG2\n"); - } - - else if (val & DAQ_FRCE_GAIN_STG_1_VAL) { - thisSettings = FORCESWITCHG1; - printf("Settings read: FORCESWITCHG1\n"); - } - - else if (val & DAQ_FIX_GAIN_STG_2_VAL) { - thisSettings = FIXGAIN2; - printf("Settings read: FIXGAIN2\n"); - } - - else if (val & DAQ_FIX_GAIN_STG_1_VAL) { - thisSettings = FIXGAIN1; - printf("Settings read: FIXGAIN1\n"); - } - - else if (val & DAQ_HIGH_GAIN_MSK) { - thisSettings = DYNAMICHG0; - printf("Settings read: DYNAMICHG0\n"); - } - - else { - thisSettings = DYNAMICGAIN; + switch(val) { + case DAQ_FIX_GAIN_DYNMC_VAL: + thisSettings = DYNAMICGAIN; printf("Settings read: DYNAMICGAIN\n"); + break; + case DAQ_FIX_GAIN_HIGHGAIN_VAL: + thisSettings = DYNAMICHG0; + printf("Settings read: DYNAMICHG0\n"); + break; + case DAQ_FIX_GAIN_STG_1_VAL: + thisSettings = FIXGAIN1; + printf("Settings read: FIXGAIN1\n"); + break; + case DAQ_FIX_GAIN_STG_2_VAL: + thisSettings = FIXGAIN2; + printf("Settings read: FIXGAIN2\n"); + break; + case DAQ_FRCE_GAIN_STG_1_VAL: + thisSettings = FORCESWITCHG1; + printf("Settings read: FORCESWITCHG1\n"); + break; + case DAQ_FRCE_GAIN_STG_2_VAL: + thisSettings = FORCESWITCHG2; + printf("Settings read: FORCESWITCHG2\n"); + break; + default: + thisSettings = UNDEFINED; + printf("Settings read: Undefined. Value read:0x%x\n", val); } return thisSettings;