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),
|
eventStore(objects::EVENT_STORE, "event", RolloverInterval::HOURLY, 1, currentTv, sdcMan),
|
||||||
sdcMan(sdcMan) {
|
sdcMan(sdcMan) {
|
||||||
Clock::getClock_timeval(¤tTv);
|
Clock::getClock_timeval(¤tTv);
|
||||||
|
Clock::getUptime(&lastTvUpdate);
|
||||||
miscStore.addApid(config::EIVE_PUS_APID);
|
miscStore.addApid(config::EIVE_PUS_APID);
|
||||||
miscStore.addService(17);
|
miscStore.addService(17);
|
||||||
eventStore.addApid(config::EIVE_PUS_APID);
|
eventStore.addApid(config::EIVE_PUS_APID);
|
||||||
@ -60,6 +61,14 @@ ReturnValue_t PusTmFunnel::handlePacket(TmTcMessage &message) {
|
|||||||
sourceSequenceCount = sourceSequenceCount % ccsds::LIMIT_SEQUENCE_COUNT;
|
sourceSequenceCount = sourceSequenceCount % ccsds::LIMIT_SEQUENCE_COUNT;
|
||||||
packet.updateErrorControl();
|
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 (sdcMan.isSdCardUsable(std::nullopt)) {
|
||||||
if (not storesInitialized) {
|
if (not storesInitialized) {
|
||||||
miscStore.updateBaseDir();
|
miscStore.updateBaseDir();
|
||||||
|
@ -40,7 +40,8 @@ class PusTmFunnel : public TmFunnelBase {
|
|||||||
uint16_t sourceSequenceCount = 0;
|
uint16_t sourceSequenceCount = 0;
|
||||||
TimeReaderIF &timeReader;
|
TimeReaderIF &timeReader;
|
||||||
bool storesInitialized = false;
|
bool storesInitialized = false;
|
||||||
timeval currentTv;
|
timeval currentTv{};
|
||||||
|
timeval lastTvUpdate{};
|
||||||
TmStore miscStore;
|
TmStore miscStore;
|
||||||
TmStore eventStore;
|
TmStore eventStore;
|
||||||
SdCardMountedIF &sdcMan;
|
SdCardMountedIF &sdcMan;
|
||||||
|
Loading…
Reference in New Issue
Block a user