Changeset 10554 for trunk/FACT++


Ignore:
Timestamp:
05/04/11 10:20:17 (14 years ago)
Author:
tbretz
Message:
Fixed a 64bit issue for DimFtuList::IsActive; added ToggleFTU
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/HeadersFTM.h

    r10551 r10554  
    336336        void DisableFTU(int i) { fActiveFTU[i/10] &= ~(1<<(i%10)); }
    337337
    338         void EnableAllFTU()  { for (int i=0; i<4; i++) fActiveFTU[i] = 0x3ff; }
    339         void DisableAllFTU() { for (int i=0; i<4; i++) fActiveFTU[i] = 0;     }
     338        void EnableAllFTU()    { for (int i=0; i<4; i++) fActiveFTU[i] = 0x3ff; }
     339        void DisableAllFTU()   { for (int i=0; i<4; i++) fActiveFTU[i] = 0;     }
     340
     341        void ToggleFTU(int i)  { fActiveFTU[i/10] ^= (1<<(i%10)); }
    340342
    341343    } __attribute__((__packed__));
     
    591593        DimFtuList(const Header &h, const FtuList &d) :
    592594            fTimeStamp(h.fTimeStamp),
    593             fActiveFTU(d.fActiveFTU[0] | (d.fActiveFTU[1]<<10) | (d.fActiveFTU[2]<<20) | (d.fActiveFTU[3]<<30)),
     595            fActiveFTU( uint64_t(d.fActiveFTU[0])      |
     596                       (uint64_t(d.fActiveFTU[1])<<10) |
     597                       (uint64_t(d.fActiveFTU[2])<<20) |
     598                       (uint64_t(d.fActiveFTU[3])<<30)),
    594599            fNumBoards(d.fNumBoards)
    595600        {
     
    605610        }
    606611
    607         bool IsActive(int i) const { return fActiveFTU&(1<<i); }
     612        bool IsActive(int i) const { return fActiveFTU&(uint64_t(1)<<i); }
    608613
    609614    } __attribute__((__packed__));
Note: See TracChangeset for help on using the changeset viewer.