SatCat5
tick_timer.cc
1 // Copyright 2024 The Aerospace Corporation.
3 // This file is a part of SatCat5, licensed under CERN-OHL-W v2 or later.
5 
6 // FreeRTOS includes
7 extern "C"{
8  #include <FreeRTOS.h>
9  #include <FreeRTOSConfig.h>
10  #include <task.h>
11 };
12 
13 #include <hal_freertos/tick_timer.h>
14 
16 
17 TickTimer::TickTimer()
18  : TimeRef(configTICK_RATE_HZ)
19 {
20  satcat5::poll::timekeeper.suggest_clock(this);
21 }
22 
24 {
25  return (u32) xTaskGetTickCount();
26 }
27 
SatCat5 time reference using the FreeRTOS tick counter.
Definition: tick_timer.h:19
u32 raw() override
Get FreeRTOS Tick Count.
Definition: tick_timer.cc:23
void suggest_clock(satcat5::util::TimeRef *timer)
Compare the provided reference to the current TimeRef, and keep whichever is "better" by an internal ...
Definition: polling.cc:257
Provides a FreeRTOS task function and hooks for using SatCat5 as a task inside a larger FreeRTOS proj...