F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
LinuxTimerTaskDelay.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 #include <Fw/FPrimeBasicTypes.hpp>
14 #include <Os/Task.hpp>
16 
17 namespace Svc {
18 
19 void LinuxTimer::startTimer(const Fw::TimeInterval& interval) {
20  while (true) {
21  Os::Task::delay(interval);
22  this->m_mutex.lock();
23  bool quit = this->m_quit;
24  this->m_mutex.unLock();
25  if (quit) {
26  return;
27  }
28  this->m_rawTime.now();
29  this->CycleOut_out(0, this->m_rawTime);
30  }
31 }
32 
33 } // end namespace Svc
static Status delay(Fw::TimeInterval interval)
delay the current task
Definition: Task.cpp:204
void startTimer(const Fw::TimeInterval &interval)
Start timer.
void unLock()
unlock the mutex and assert success
Definition: Mutex.cpp:41
Status now() override
Get the current time.
Definition: RawTime.cpp:36
void CycleOut_out(FwIndexType portNum, Os::RawTime &cycleStart)
Invoke output port CycleOut.
void quit()
Quit timer.
RateGroupDivider component implementation.
void lock()
lock the mutex and assert success
Definition: Mutex.cpp:34