LSH-Core
Deterministic firmware core for Controllino-based Labo Smart Home nodes
 
Loading...
Searching...
No Matches
timeKeeper Namespace Reference

Utility namespace that exposes the controller time used by the main loop. More...

Functions

auto getTime () -> uint32_t
 Gets the cached timestamp from the last timeKeeper::update() call.
 
 __attribute__ ((always_inline)) inline void update()
 Refresh the cached timestamp from millis().
 
auto getRealTime () -> uint32_t
 Gets the current time directly by calling millis().
 

Variables

uint32_t now = 0U
 Cached millis() value refreshed once per main-loop iteration.
 

Detailed Description

Utility namespace that exposes the controller time used by the main loop.

Function Documentation

◆ getRealTime()

auto timeKeeper::getRealTime ( ) -> uint32_t
inline

Gets the current time directly by calling millis().

Use this when a fresh, non-cached timestamp is required.

Returns
The current, real-time value from millis().
Here is the caller graph for this function:

◆ getTime()

auto timeKeeper::getTime ( ) -> uint32_t
inline

Gets the cached timestamp from the last timeKeeper::update() call.

This avoids multiple calls to millis() within the same loop iteration, ensuring consistency.

Returns
The cached time in milliseconds.
Here is the caller graph for this function: