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; }