OS  v1.7.5
Documentation
Loading...
Searching...
No Matches
qOS::clock Class Referencefinal

A class to encapsulate the OS clock. More...

#include <clock.hpp>

Public Member Functions

 clock (clock &other)=delete
 
void operator= (const clock &)=delete
 

Static Public Member Functions

static void sysTick (void) noexcept
 Feed the system tick.
 
static bool timeDeadLineCheck (const qOS::clock_t ti, const qOS::clock_t td) noexcept
 Perform a timestamp check. This function computes the amount of time elapsed between the current instant and the init timestamp ti and checks if the result is greater than td.
 
static bool setTickProvider (const getTickFcn_t provider) noexcept
 Set the clock-tick provider function.
 

Static Public Attributes

static getTickFcn_t getTick
 Return the current tick used by the OS.
 
static const qOS::duration_t NONE
 To specify a null time value.
 
static const qOS::duration_t IMMEDIATE
 To specify a non-wait time value.
 

Detailed Description

A class to encapsulate the OS clock.

Constructor & Destructor Documentation

◆ clock()

qOS::clock::clock ( clock & other)
delete

Member Function Documentation

◆ operator=()

void qOS::clock::operator= ( const clock & )
delete

◆ setTickProvider()

static bool qOS::clock::setTickProvider ( const getTickFcn_t provider)
staticnoexcept

Set the clock-tick provider function.

Parameters
[in]providerA pointer to the tick provider function
Returns
true on success, otherwise returns false.

◆ sysTick()

static void qOS::clock::sysTick ( void )
staticnoexcept

Feed the system tick.

Note
This call is mandatory and must be called once inside the dedicated timer interrupt service routine (ISR). Example
void interrupt xPeriodicTimer_ISR( void ) {
}
static void sysTick(void) noexcept
Feed the system tick.

◆ timeDeadLineCheck()

static bool qOS::clock::timeDeadLineCheck ( const qOS::clock_t ti,
const qOS::clock_t td )
staticnoexcept

Perform a timestamp check. This function computes the amount of time elapsed between the current instant and the init timestamp ti and checks if the result is greater than td.

Parameters
[in]tiInit timestamp in epochs
[in]tdElapsed time to check in epochs
Returns
true if the elapsed time (t-ti) is greater or equal to td. Otherwise returns false

Member Data Documentation

◆ getTick

getTickFcn_t qOS::clock::getTick
static

Return the current tick used by the OS.

Returns
time (t) in epochs.

◆ IMMEDIATE

const qOS::duration_t qOS::clock::IMMEDIATE
static

To specify a non-wait time value.

◆ NONE

const qOS::duration_t qOS::clock::NONE
static

To specify a null time value.