ctb server: hv select is actually internal hv select

This commit is contained in:
maliakal_d 2019-07-02 10:15:25 +02:00
parent 3bb0daeefb
commit e16b857ba2
2 changed files with 6 additions and 6 deletions

View File

@ -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)

View File

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