F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
LinuxTimerComponentImplTaskDelay.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title LinuxTimerImpl.cpp
3 // \author tim
4 // \brief cpp file for LinuxTimer component implementation class
5 //
6 // \copyright
7 // Copyright 2009-2015, by the California Institute of Technology.
8 // ALL RIGHTS RESERVED. United States Government Sponsorship
9 // acknowledged.
10 //
11 // ======================================================================
12 
13 
15 #include <FpConfig.hpp>
16 #include <Os/Task.hpp>
17 
18 namespace Svc {
19 
21  while (true) {
22  Os::Task::delay(interval);
23  this->m_mutex.lock();
24  bool quit = this->m_quit;
25  this->m_mutex.unLock();
26  if (quit) {
27  return;
28  }
29  this->m_timer.take();
30  this->CycleOut_out(0,this->m_timer);
31  }
32  }
33 
34 } // end namespace Svc
PlatformIntType NATIVE_INT_TYPE
Definition: BasicTypes.h:51
C++-compatible configuration header for fprime configuration.
void unLock()
unlock the mutex
Definition: Mutex.cpp:13
void lock()
lock the mutex
Definition: Mutex.cpp:12
static TaskStatus delay(NATIVE_UINT_TYPE msecs)
delay the task
Definition: Task.cpp:43
void CycleOut_out(NATIVE_INT_TYPE portNum, Svc::TimerVal &cycleStart)
Invoke output port CycleOut.
void startTimer(NATIVE_INT_TYPE interval)
Start timer.
void take()
Function to store a timer value.
Definition: TimerVal.cpp:38