µOS++ IIIe Reference  v6.3.15
“Perfekt ist nicht gut genug”
The third edition of µOS++, a POSIX inspired open source system, written in C++.

C++ API timers definitions. More...


class  os::rtos::timer::attributes
 Timer attributes. More...
class  os::rtos::timer::attributes_periodic
 Periodic timer attributes. More...
struct  os::rtos::timer::run
 Timer run types. More...
struct  os::rtos::timer::state
 Timer states. More...
class  os::rtos::timer
 User single-shot or periodic timer. More...


using os::rtos::timer::func_args_t = void *
 Timer call back function arguments. More...
using os::rtos::timer::func_t = void(*)(func_args_t args)
 Entry point of a timer call back function. More...
using os::rtos::timer::state_t = uint8_t
 Type of of variables holding timer states. More...
using os::rtos::timer::type_t = uint8_t
 Type of of variables holding timer run types. More...


static const attributes_periodic os::rtos::timer::periodic_initializer
 Default periodic timer initialiser. More...

Detailed Description

C++ API timers definitions.

tmfunc (void* args )
printf ("%s\n", __func__);
os_main (int argc, char* argv[])
// Single-shot timer.
timer tm1
{ tmfunc, nullptr };
sysclock.sleep_for (1); // Sync
tm1.start (1);
tm1.stop ();
// Named single-shot timer.
timer tm2
{ "tm2", tmfunc, nullptr };
sysclock.sleep_for (1); // Sync
tm2.start (1);
tm2.stop ();
// Named periodic timer.
timer tm3
{ "tm3", tmfunc, nullptr, timer::periodic_initializer };
sysclock.sleep_for (1); // Sync
tm3.start (1);
tm3.stop ();


◆ func_args_t

Timer call back function arguments.

Definition at line 61 of file os-timer.h.

◆ func_t

using os::rtos::timer::func_t = void (*) (func_args_t args)

Entry point of a timer call back function.

Definition at line 67 of file os-timer.h.

◆ state_t

using os::rtos::timer::state_t = uint8_t

Type of of variables holding timer states.

Definition at line 100 of file os-timer.h.

◆ type_t

using os::rtos::timer::type_t = uint8_t

Type of of variables holding timer run types.

Definition at line 73 of file os-timer.h.

Variable Documentation

◆ periodic_initializer

const timer::attributes_periodic os::rtos::timer::periodic_initializer

Default periodic timer initialiser.

This variable can be used to create a periodic timer.

Definition at line 252 of file os-timer.h.