Changeset 10551 for trunk/FACT++/src


Ignore:
Timestamp:
05/04/11 09:51:19 (14 years ago)
Author:
tbretz
Message:
Fixed some treatment of 64bit values.
File:
1 edited

Legend:

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

    r10535 r10551  
    313313        StaticDataBoard fBoard[4][10];      // 4 crates * 10 boards
    314314
    315         uint16_t fActiveFTU[4];
     315        uint16_t fActiveFTU[4];             // 4 crates * 10 bits
    316316
    317317        StaticData() { init(*this); }
     
    332332        StaticDataBoard &operator[](int i) { return fBoard[i/10][i%10]; }
    333333        const StaticDataBoard &operator[](int i) const { return fBoard[i/10][i%10]; }
     334
     335        void EnableFTU(int i)  { fActiveFTU[i/10] |=  (1<<(i%10)); }
     336        void DisableFTU(int i) { fActiveFTU[i/10] &= ~(1<<(i%10)); }
     337
     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;     }
    334340
    335341    } __attribute__((__packed__));
     
    377383        bool HasTimeMarker() const  { return fGeneralSettings & StaticData::kTimeMarker; }
    378384
    379         bool IsActive(int i) const { return fActiveFTU&(1<<i); }
     385        bool IsActive(int i) const { return fActiveFTU&(uint64_t(1)<<i); }
    380386        bool IsEnabled(int i) const { return fEnable[i/16]&(1<<(i%16)); }
    381387
     
    386392            fGeneralSettings(d.fGeneralSettings),
    387393            fStatusLEDs(d.fStatusLEDs),
    388             fActiveFTU(d.fActiveFTU[0] | (d.fActiveFTU[1]<<10) | (d.fActiveFTU[2]<<20) | (d.fActiveFTU[3]<<30)),
     394            fActiveFTU( uint64_t(d.fActiveFTU[0])      |
     395                       (uint64_t(d.fActiveFTU[1])<<10) |
     396                       (uint64_t(d.fActiveFTU[2])<<20) |
     397                       (uint64_t(d.fActiveFTU[3])<<30)),
    389398            fTriggerInterval(d.fTriggerInterval*4+8),
    390399            fTriggerSeqLP1((d.fTriggerSequence)&0x1f),
Note: See TracChangeset for help on using the changeset viewer.