From e16b857ba27a91c60723cb915a186752c96709fb Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Tue, 2 Jul 2019 10:15:25 +0200 Subject: [PATCH] ctb server: hv select is actually internal hv select --- slsDetectorServers/ctbDetectorServer/RegisterDefs.h | 4 ++-- .../ctbDetectorServer/slsDetectorFunctionList.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/slsDetectorServers/ctbDetectorServer/RegisterDefs.h b/slsDetectorServers/ctbDetectorServer/RegisterDefs.h index bf3dae964..8aa6c2ff7 100755 --- a/slsDetectorServers/ctbDetectorServer/RegisterDefs.h +++ b/slsDetectorServers/ctbDetectorServer/RegisterDefs.h @@ -439,8 +439,8 @@ #define POWER_ENBL_VLTG_RGLTR_OFST (16) #define POWER_ENBL_VLTG_RGLTR_MSK (0x0000001F << POWER_ENBL_VLTG_RGLTR_OFST) -#define POWER_HV_SLCT_OFST (31) -#define POWER_HV_SLCT_MSK (0x00000001 << POWER_HV_SLCT_OFST) +#define POWER_HV_INTERNAL_SLCT_OFST (31) +#define POWER_HV_INTERNAL_SLCT_MSK (0x00000001 << POWER_HV_INTERNAL_SLCT_OFST) /* Number of Words RW register TODO */ #define NUMBER_OF_WORDS_REG (0x5F << MEM_MAP_SHIFT) diff --git a/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c index df2281e81..b6b7e482c 100755 --- a/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c @@ -1422,14 +1422,14 @@ int setHighVoltage(int val){ FILE_LOG(logINFO, ("Setting High voltage: %d V\n", val)); uint32_t addr = POWER_REG; - // switch off high voltage - bus_w(addr, bus_r(addr) & (~POWER_HV_SLCT_MSK)); + // switch to external high voltage + bus_w(addr, bus_r(addr) & (~POWER_HV_INTERNAL_SLCT_OFST)); MAX1932_Set(val); - // switch on high voltage if val > 0 + // switch on internal high voltage, if set if (val > 0) - bus_w(addr, bus_r(addr) | POWER_HV_SLCT_MSK); + bus_w(addr, bus_r(addr) | POWER_HV_INTERNAL_SLCT_OFST); highvoltage = val; }