mirror of
https://github.com/nasa/fprime.git
synced 2025-12-11 13:54:34 -06:00
* Use Fw::TimeInterval in LinuxTimer * Fix Linux FD typo * Fix interval timer UT * Format * Fix assert casts * Fix ComLogger UTs * Fix FppTest microseconds * Fix casting * Fix overflow
55 lines
1.4 KiB
C++
55 lines
1.4 KiB
C++
// ======================================================================
|
|
// \title LinuxTimerImpl.hpp
|
|
// \author tim
|
|
// \brief hpp file for LinuxTimer component implementation class
|
|
//
|
|
// \copyright
|
|
// Copyright 2009-2015, by the California Institute of Technology.
|
|
// ALL RIGHTS RESERVED. United States Government Sponsorship
|
|
// acknowledged.
|
|
//
|
|
// ======================================================================
|
|
|
|
#ifndef LinuxTimer_HPP
|
|
#define LinuxTimer_HPP
|
|
|
|
#include "Fw/Time/TimeInterval.hpp"
|
|
#include "Os/Mutex.hpp"
|
|
#include "Os/RawTime.hpp"
|
|
#include "Svc/LinuxTimer/LinuxTimerComponentAc.hpp"
|
|
|
|
namespace Svc {
|
|
|
|
class LinuxTimer final : public LinuxTimerComponentBase {
|
|
public:
|
|
// ----------------------------------------------------------------------
|
|
// Construction, initialization, and destruction
|
|
// ----------------------------------------------------------------------
|
|
|
|
//! Construct object LinuxTimer
|
|
//!
|
|
LinuxTimer(const char* const compName /*!< The component name*/
|
|
);
|
|
|
|
//! Destroy object LinuxTimer
|
|
//!
|
|
~LinuxTimer();
|
|
|
|
//! Start timer
|
|
void startTimer(const Fw::TimeInterval& interval); //!< interval in milliseconds
|
|
|
|
//! Quit timer
|
|
void quit();
|
|
|
|
private:
|
|
Os::Mutex m_mutex; //!< mutex for quit flag
|
|
|
|
volatile bool m_quit; //!< flag to quit
|
|
|
|
Os::RawTime m_rawTime; //!< timestamp to pass to CycleOut port calls
|
|
};
|
|
|
|
} // end namespace Svc
|
|
|
|
#endif
|