From 9c8b1c697b3812958e7d00326ee12285e0484caf Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 10 Jul 2023 14:20:02 +0200 Subject: [PATCH] added back missing function --- src/fsfw/housekeeping/PeriodicHousekeepingHelper.cpp | 6 ++++++ src/fsfw/housekeeping/PeriodicHousekeepingHelper.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/fsfw/housekeeping/PeriodicHousekeepingHelper.cpp b/src/fsfw/housekeeping/PeriodicHousekeepingHelper.cpp index 852032fa..da3b6b8d 100644 --- a/src/fsfw/housekeeping/PeriodicHousekeepingHelper.cpp +++ b/src/fsfw/housekeeping/PeriodicHousekeepingHelper.cpp @@ -14,6 +14,10 @@ void PeriodicHousekeepingHelper::initialize(float collectionInterval, changeCollectionInterval(collectionInterval); } +float PeriodicHousekeepingHelper::getCollectionIntervalInSeconds() const { + return collectionInterval; +} + bool PeriodicHousekeepingHelper::checkOpNecessary() { if (hkGenerationCd.hasTimedOut()) { hkGenerationCd.resetTimer(); @@ -26,6 +30,8 @@ void PeriodicHousekeepingHelper::changeCollectionInterval(float newIntervalSecon uint32_t intervalMs = newIntervalSeconds * 1000; if (newIntervalSeconds <= 0) { intervalMs = minimumPeriodicInterval; + newIntervalSeconds = static_cast(minimumPeriodicInterval) / 1000.0; } + collectionInterval = newIntervalSeconds; hkGenerationCd.setTimeout(intervalMs); } diff --git a/src/fsfw/housekeeping/PeriodicHousekeepingHelper.h b/src/fsfw/housekeeping/PeriodicHousekeepingHelper.h index 2e168c85..19418977 100644 --- a/src/fsfw/housekeeping/PeriodicHousekeepingHelper.h +++ b/src/fsfw/housekeeping/PeriodicHousekeepingHelper.h @@ -22,6 +22,7 @@ class PeriodicHousekeepingHelper { private: LocalPoolDataSetBase* owner = nullptr; Countdown hkGenerationCd; + float collectionInterval = 0.0; dur_millis_t minimumPeriodicInterval = 0; };