mirror of
https://github.com/nasa/fprime.git
synced 2025-12-11 04:35:25 -06:00
Instead of adding the name argument to a constructor when FW_OBJECT_NAMES is enabled, always supply a name argument. Add a marco that conditionally sets the name to "" if FW_OBJECT_NAMES is not set. This cleans up a lot of the conditional compilation switches that weren't being tested and would silently break, while still stripping the strings from the binary.
35 lines
769 B
C++
35 lines
769 B
C++
/*
|
|
* TestCommand1Impl.cpp
|
|
*
|
|
* Created on: Mar 28, 2014
|
|
* Author: tcanham
|
|
*/
|
|
|
|
#include <Svc/LinuxTime/LinuxTimeImpl.hpp>
|
|
#include <Fw/Time/Time.hpp>
|
|
#include <time.h>
|
|
|
|
namespace Svc {
|
|
|
|
LinuxTimeImpl::LinuxTimeImpl(const char* name) : TimeComponentBase(name)
|
|
{
|
|
}
|
|
|
|
LinuxTimeImpl::~LinuxTimeImpl() {
|
|
}
|
|
|
|
void LinuxTimeImpl::timeGetPort_handler(
|
|
NATIVE_INT_TYPE portNum, /*!< The port number*/
|
|
Fw::Time &time /*!< The U32 cmd argument*/
|
|
) {
|
|
timespec stime;
|
|
(void)clock_gettime(CLOCK_REALTIME,&stime);
|
|
time.set(TB_WORKSTATION_TIME,0, stime.tv_sec, stime.tv_nsec/1000);
|
|
}
|
|
|
|
void LinuxTimeImpl::init(NATIVE_INT_TYPE instance) {
|
|
TimeComponentBase::init(instance);
|
|
}
|
|
|
|
}
|