12#if defined(OS_USE_OS_APP_CONFIG_H)
13#include <cmsis-plus/os-app-config.h>
23#pragma clang diagnostic ignored "-Wc++98-compat"
63#if defined(OS_TRACE_RTOS_LISTS)
67 else if (prio <= after->thread_->priority ())
70#if defined(OS_TRACE_RTOS_LISTS)
75 else if (prio >
head ()->thread_->priority ())
77#pragma GCC diagnostic push
79#elif defined(__GNUC__)
80#pragma GCC diagnostic ignored "-Wuseless-cast"
85#pragma GCC diagnostic pop
87#if defined(OS_TRACE_RTOS_LISTS)
89 head ()->thread_->priority ());
94#pragma GCC diagnostic push
96#elif defined(__GNUC__)
97#pragma GCC diagnostic ignored "-Wuseless-cast"
108#pragma GCC diagnostic pop
110#if defined(OS_TRACE_RTOS_LISTS)
132#if defined(OS_TRACE_RTOS_LISTS)
138 assert (th !=
nullptr);
204#if defined(OS_TRACE_RTOS_LISTS)
208 else if (prio <= after->thread_->priority ())
211#if defined(OS_TRACE_RTOS_LISTS)
216 else if (prio >
head ()->thread_->priority ())
218#pragma GCC diagnostic push
219#if defined(__clang__)
220#elif defined(__GNUC__)
221#pragma GCC diagnostic ignored "-Wuseless-cast"
226#pragma GCC diagnostic pop
228#if defined(OS_TRACE_RTOS_LISTS)
230 head ()->thread_->priority ());
235#pragma GCC diagnostic push
236#if defined(__clang__)
237#elif defined(__GNUC__)
238#pragma GCC diagnostic ignored "-Wuseless-cast"
249#pragma GCC diagnostic pop
251#if defined(OS_TRACE_RTOS_LISTS)
285 assert (th !=
nullptr);
294#if defined(OS_TRACE_RTOS_LISTS)
313#if defined(OS_TRACE_RTOS_LISTS_CONSTRUCT)
320#if defined(OS_TRACE_RTOS_LISTS_CONSTRUCT)
332#if defined(OS_TRACE_RTOS_LISTS_CONSTRUCT)
339#if defined(OS_TRACE_RTOS_LISTS_CONSTRUCT)
360#if !defined(OS_USE_RTOS_PORT_TIMER)
366#if defined(OS_TRACE_RTOS_LISTS_CONSTRUCT)
373#if defined(OS_TRACE_RTOS_LISTS_CONSTRUCT)
386 tmr.internal_interrupt_service_routine ();
407#pragma GCC diagnostic push
408#if defined(__clang__)
409#elif defined(__GNUC__)
410#pragma GCC diagnostic ignored "-Wnull-dereference"
423#if defined(OS_TRACE_RTOS_LISTS_CLOCKS)
425 static_cast<uint32_t
> (timestamp));
431#if defined(OS_TRACE_RTOS_LISTS_CLOCKS)
433 static_cast<uint32_t
> (after->
timestamp),
434 static_cast<uint32_t
> (timestamp));
437 else if (timestamp <
head ()->timestamp)
439#pragma GCC diagnostic push
440#if defined(__clang__)
441#elif defined(__GNUC__)
442#pragma GCC diagnostic ignored "-Wuseless-cast"
448#if defined(OS_TRACE_RTOS_LISTS_CLOCKS)
450 static_cast<uint32_t
> (timestamp),
451 static_cast<uint32_t
> (
head ()->timestamp));
453#pragma GCC diagnostic pop
459 while (timestamp < after->timestamp)
461#pragma GCC diagnostic push
462#if defined(__clang__)
463#elif defined(__GNUC__)
464#pragma GCC diagnostic ignored "-Wuseless-cast"
470#if defined(OS_TRACE_RTOS_LISTS_CLOCKS)
472 static_cast<uint32_t
> (after->
timestamp),
473 static_cast<uint32_t
> (timestamp));
475#pragma GCC diagnostic pop
480#pragma GCC diagnostic pop
509#pragma GCC diagnostic push
510#if defined(__clang__)
511#elif defined(__GNUC__)
512#pragma GCC diagnostic ignored "-Wnull-dereference"
515#pragma GCC diagnostic pop
518#if defined(OS_TRACE_RTOS_LISTS_CLOCKS)
546#if defined(OS_TRACE_RTOS_THREAD)
virtual timestamp_t now(void)
Tell the current time, possibly adjusted for epoch.
void check_timestamp(port::clock::timestamp_t now)
Check list time stamps.
volatile timestamp_node * head(void) const
Get list head.
void link(timestamp_node &node)
Add a new thread node to the list.
const char * name(void) const
Get object name.
thread * unlink_head(void)
Remove the top node from the list.
volatile waiting_thread_node * head(void) const
Get list head.
void link(waiting_thread_node &node)
Add a new thread node to the list.
void link(waiting_thread_node &node)
Add a new thread node to the list.
void link(thread &thread)
Add a new thread node to the list.
Double linked list node, with time stamp and thread.
timeout_thread_node(port::clock::timestamp_t ts, thread &th)
Construct a clock timeout node.
rtos::thread & thread
Reference to thread who initiated the timeout.
virtual ~timeout_thread_node() override
Destruct the node.
virtual void action(void) override
Action to perform when the time stamp is reached.
timer & tmr
Reference to waiting timer.
virtual void action(void) override
Action to perform when the time stamp is reached.
timer_node(port::clock::timestamp_t ts, timer &tm)
Construct a clock timer node.
virtual ~timer_node() override
Destruct the node.
Double linked list node, with time stamp.
port::clock::timestamp_t timestamp
Time stamp when the next action will be performed.
virtual ~timestamp_node()
Destruct the node.
timestamp_node(port::clock::timestamp_t ts)
Construct a node with a time stamp.
Double linked list node, with thread reference.
rtos::thread * thread_
Pointer to waiting thread.
void link(waiting_thread_node &node)
Add a new thread node to the list.
bool resume_one(void)
Wake-up one thread (the oldest with the highest priority)
volatile waiting_thread_node * head(void) const
Get list head.
void resume_all(void)
Wake-up all threads in the list.
Interrupts critical section RAII helper.
POSIX compliant thread, using the default RTOS allocator.
uint8_t state_t
Type of variables holding thread states.
result_t priority(priority_t prio)
Set the assigned scheduling priority.
void resume(void)
Resume the thread.
state_t state(void) const
Get thread scheduler state.
User single-shot or periodic timer.
Statically allocated core of a double linked list, pointers to next, previous.
static_double_list_links * next(void) const
static_double_list_links * prev(void) const
void unlink(void)
Remove the node from the list.
static_double_list_links head_
A list node used to point to head and tail.
void insert_after(static_double_list_links &node, static_double_list_links *after)
Insert a new node after existing node.
bool empty(void) const
Check if the list is empty.
void clear(void)
Clear the list.
volatile static_double_list_links * tail(void) const
Get the list tail.
int printf(const char *format,...)
Write a formatted string to the trace device.
int unlink(const char *name)
port::clock::timestamp_t timestamp_t
Type of variables holding clock time stamps.
clock_systick sysclock
The system clock object instance.
uint8_t priority_t
Type of variables holding thread priorities.
Single file µOS++ RTOS definitions.
@ running
Has the CPU and runs.
@ destroyed
Terminated and resources (like stack) released.
@ terminated
No longer usable, but resources not yet released.
@ ready
Present in the READY list and competing for CPU.