added monotonic clock which is independend of clock jumps in the system clock

This commit is contained in:
Jakob Meier 2024-12-22 18:37:44 +01:00
parent 21d5800bfa
commit 1427fbd2fe

View File

@ -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) {