13#if defined(OS_USE_OS_APP_CONFIG_H)
14#include <cmsis-plus/os-app-config.h>
22#pragma clang diagnostic ignored "-Wc++98-compat"
141 {
nullptr, function, args, attr }
176#if defined(OS_TRACE_RTOS_TIMER)
177 trace::printf (
"%s() @%p %s\n", __func__,
this, this->name ());
185 type_ = attr.tm_type;
189#if !defined(OS_USE_RTOS_PORT_TIMER)
190 clock_ = attr.clock !=
nullptr ? attr.clock : &
sysclock;
193#if defined(OS_USE_RTOS_PORT_TIMER)
195 port::timer::create (
this, function, args);
202 state_ = state::initialized;
217#if defined(OS_TRACE_RTOS_TIMER)
221#if defined(OS_USE_RTOS_PORT_TIMER)
223 port::timer::destroy (
this);
233 timer_node_.unlink ();
251#if defined(OS_TRACE_RTOS_TIMER)
252#pragma GCC diagnostic push
253#if defined(__clang__)
254#elif defined(__GNUC__)
255#pragma GCC diagnostic ignored "-Wuseless-cast"
258 static_cast<unsigned int> (period),
this,
name ());
259#pragma GCC diagnostic pop
272#if defined(OS_USE_RTOS_PORT_TIMER)
274 res = port::timer::start (
this, period);
280 timer_node_.timestamp = clock_->steady_now () + period;
287 timer_node_.unlink ();
289 clock_->steady_list ().link (timer_node_);
315#if defined(OS_TRACE_RTOS_TIMER)
329#if defined(OS_USE_RTOS_PORT_TIMER)
331 res = port::timer::stop (
this);
339 timer_node_.unlink ();
350#if !defined(OS_USE_RTOS_PORT_TIMER)
357 timer::internal_interrupt_service_routine (
void)
363 timer_node_.timestamp += period_;
366 clock_->steady_list ().link (timer_node_);
373#if defined(OS_USE_RTOS_PORT_TIMER)
const char * name(void) const
Get object name.
Interrupts critical section RAII helper.
User single-shot or periodic timer.
~timer()
Destruct the timer object instance.
timer(func_t function, func_args_t args, const attributes &attr=once_initializer)
Construct a timer object instance.
static const attributes once_initializer
Default one shot timer initialiser.
result_t stop(void)
Stop the timer.
result_t start(clock::duration_t period)
Start or restart the timer.
int puts(const char *s)
Write the string and a line terminator to the trace device.
int printf(const char *format,...)
Write a formatted string to the trace device.
port::clock::duration_t duration_t
Type of variables holding clock durations.
clock_systick sysclock
The system clock object instance.
void * func_args_t
Timer call back function arguments.
void(*)(func_args_t args) func_t
Entry point of a timer call back function.
static const attributes_periodic periodic_initializer
Default periodic timer initialiser.
bool in_handler_mode(void)
Check if the CPU is in handler mode.
@ ok
Function completed; no errors or events occurred.
uint32_t result_t
Type of values returned by RTOS functions.
#define os_assert_throw(__e, __er)
Assert or throw a system error exception.
#define os_assert_err(__e, __er)
Assert or return an error.
Single file µOS++ RTOS definitions.
@ periodic
Run periodically.