From 1427fbd2fe9ea40788fc0cd6f3fe6f8db1493e6d Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Sun, 22 Dec 2024 18:37:44 +0100 Subject: [PATCH] added monotonic clock which is independend of clock jumps in the system clock --- src/fsfw/osal/freertos/Clock.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fsfw/osal/freertos/Clock.cpp b/src/fsfw/osal/freertos/Clock.cpp index 59ccc109..4c8dde54 100644 --- a/src/fsfw/osal/freertos/Clock.cpp +++ b/src/fsfw/osal/freertos/Clock.cpp @@ -5,6 +5,7 @@ #include "FreeRTOS.h" #include "fsfw/globalfunctions/timevalOperations.h" +#include "fsfw/serviceinterface/ServiceInterfacePrinter.h" #include "fsfw/osal/freertos/Timekeeper.h" #include "task.h" @@ -47,8 +48,9 @@ ReturnValue_t Clock::getClock(timeval* time) { } ReturnValue_t Clock::getClockMonotonic(timeval* time) { - // TODO: I don't actually know if the timekeeper is monotonic.. - return getClock_timeval(time); + TickType_t ticks = Timekeeper::getTicks(); + *time = Timekeeper::ticksToTimeval(ticks); + return returnvalue::OK; } ReturnValue_t Clock::getUptime(timeval* uptime) {