update clock every 5 minutes
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
This commit is contained in:
parent
8858084f6e
commit
3e17de0127
@ -14,6 +14,7 @@ PusTmFunnel::PusTmFunnel(object_id_t objectId, TimeReaderIF &timeReader, Storage
|
||||
eventStore(objects::EVENT_STORE, "event", RolloverInterval::HOURLY, 1, currentTv, sdcMan),
|
||||
sdcMan(sdcMan) {
|
||||
Clock::getClock_timeval(¤tTv);
|
||||
Clock::getUptime(&lastTvUpdate);
|
||||
miscStore.addApid(config::EIVE_PUS_APID);
|
||||
miscStore.addService(17);
|
||||
eventStore.addApid(config::EIVE_PUS_APID);
|
||||
@ -60,6 +61,14 @@ ReturnValue_t PusTmFunnel::handlePacket(TmTcMessage &message) {
|
||||
sourceSequenceCount = sourceSequenceCount % ccsds::LIMIT_SEQUENCE_COUNT;
|
||||
packet.updateErrorControl();
|
||||
|
||||
timeval currentUptime;
|
||||
Clock::getUptime(¤tUptime);
|
||||
if (currentUptime.tv_sec - lastTvUpdate.tv_sec >
|
||||
static_cast<signed int>(TV_UPDATE_INTERVAL_SECS)) {
|
||||
Clock::getClock_timeval(¤tTv);
|
||||
lastTvUpdate = currentUptime;
|
||||
}
|
||||
|
||||
if (sdcMan.isSdCardUsable(std::nullopt)) {
|
||||
if (not storesInitialized) {
|
||||
miscStore.updateBaseDir();
|
||||
|
@ -40,7 +40,8 @@ class PusTmFunnel : public TmFunnelBase {
|
||||
uint16_t sourceSequenceCount = 0;
|
||||
TimeReaderIF &timeReader;
|
||||
bool storesInitialized = false;
|
||||
timeval currentTv;
|
||||
timeval currentTv{};
|
||||
timeval lastTvUpdate{};
|
||||
TmStore miscStore;
|
||||
TmStore eventStore;
|
||||
SdCardMountedIF &sdcMan;
|
||||
|
Loading…
Reference in New Issue
Block a user