FACT++  1.0
template<class T , class S >
int StateMachineFTM< T, S >::SetRegister ( const EventImp evt)
inlineprivate

Definition at line 1478 of file ftmctrl.cc.

References Error(), EventImp::GetSize(), and EventImp::Ptr().

Referenced by StateMachineFTM< T, S >::StateMachineFTM().

1479  {
1480  if (!CheckEventSize(evt.GetSize(), "SetRegister", 8))
1481  return T::kSM_FatalError;
1482 
1483  const uint32_t *dat = evt.Ptr<uint32_t>();
1484 
1485  if (dat[1]>uint16_t(-1))
1486  {
1487  ostringstream msg;
1488  msg << hex << "Value " << dat[1] << " out of range.";
1489  T::Error(msg);
1490  return T::GetCurrentState();
1491  }
1492 
1493 
1494  if (dat[0]>uint16_t(-1) || !fFTM.CmdSetRegister(dat[0], dat[1]))
1495  {
1496  ostringstream msg;
1497  msg << hex << "Address " << dat[0] << " out of range.";
1498  T::Error(msg);
1499  }
1500 
1501  return T::GetCurrentState();
1502  }
bool CheckEventSize(size_t has, const char *name, size_t size)
Definition: ftmctrl.cc:1467
Error()
Definition: HeadersFTM.h:197
const T * Ptr(size_t offset=0) const
Definition: EventImp.h:74
virtual size_t GetSize() const
Definition: EventImp.h:55

+ Here is the call graph for this function:

+ Here is the caller graph for this function: