Changeset 98 for hvcontrol/src/HV.cc


Ignore:
Timestamp:
07/29/09 08:50:44 (15 years ago)
Author:
ogrimm
Message:
Fixed bug with loading of HV settings. Negative DAC values are set to zero without error.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • hvcontrol/src/HV.cc

    r93 r98  
    162162
    163163/* Set high voltage - uses TRead() and has same return values */
    164 int HVBoard::SetHV(int chain, unsigned int channel, unsigned int hv) {
     164int HVBoard::SetHV(int chain, unsigned int channel, int hv) {
    165165
    166166  if (fTestMode){
     
    171171  unsigned char wbuf[] = {0,0,0};
    172172
    173   if (!(hv>=0 && hv<=0x3FFF)) {
    174     m->PrintMessage(" Error: HV beyond limits [0 - 0x3FFF]\n");
    175     return 0;
    176   }
     173  if (hv > 0x3FFF) {
     174    m->PrintMessage(" Error: HV beyond upper 0x3FFF\n");
     175    return 0;
     176  }
     177  if (hv<0) hv = 0;
    177178 
    178179  switch (chain) {
Note: See TracChangeset for help on using the changeset viewer.