F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
BlockDriver.cpp
Go to the documentation of this file.
2 #include <Fw/Types/Assert.hpp>
4 
5 namespace Ref {
6 
7 BlockDriver::BlockDriver(const char* compName)
8  : BlockDriverComponentBase(compName), m_cycles(0), m_schedQueued(false) {}
9 
11 
12 void BlockDriver::BufferIn_handler(FwIndexType portNum, Drv::DataBuffer& buffer) {
13  // just a pass-through
14  this->BufferOut_out(0, buffer);
15 }
16 
17 void BlockDriver::Sched_handler(FwIndexType portNum, U32 context) {
18  bool expected = false;
19  if (this->m_schedQueued.compare_exchange_strong(expected, true)) {
20  this->SchedInternal_internalInterfaceInvoke();
21  }
22 }
23 
24 void BlockDriver::SchedInternal_overflowHook() {
25  this->m_schedQueued = false;
26 }
27 
28 void BlockDriver::SchedInternal_internalInterfaceHandler() {
29  this->m_schedQueued = false;
30  this->tlmWrite_BD_Cycles(this->m_cycles++);
31 }
32 
33 void BlockDriver::PingIn_handler(const FwIndexType portNum, U32 key) {
34  // call ping output port
35  this->PingOut_out(0, key);
36 }
37 
38 } // namespace Ref
BlockDriver(const char *compName)
Definition: BlockDriver.cpp:7
PlatformIndexType FwIndexType