35#pragma clang diagnostic ignored "-Wc++98-compat"
75#if defined(OS_TRACE_RTOS_LISTS)
79 else if (prio <= after->thread_->priority ())
82#if defined(OS_TRACE_RTOS_LISTS)
87 else if (prio >
head ()->thread_->priority ())
92#if defined(OS_TRACE_RTOS_LISTS)
94 head ()->thread_->priority ());
107#if defined(OS_TRACE_RTOS_LISTS)
129#if defined(OS_TRACE_RTOS_LISTS)
135 assert (th !=
nullptr);
200#if defined(OS_TRACE_RTOS_LISTS)
204 else if (prio <= after->thread_->priority ())
207#if defined(OS_TRACE_RTOS_LISTS)
212 else if (prio >
head ()->thread_->priority ())
217#if defined(OS_TRACE_RTOS_LISTS)
219 head ()->thread_->priority ());
232#if defined(OS_TRACE_RTOS_LISTS)
266 assert (th !=
nullptr);
275#if defined(OS_TRACE_RTOS_LISTS)
295#if defined(OS_TRACE_RTOS_LISTS_CONSTRUCT)
302#if defined(OS_TRACE_RTOS_LISTS_CONSTRUCT)
315#if defined(OS_TRACE_RTOS_LISTS_CONSTRUCT)
322#if defined(OS_TRACE_RTOS_LISTS_CONSTRUCT)
343#if !defined(OS_USE_RTOS_PORT_TIMER)
350#if defined(OS_TRACE_RTOS_LISTS_CONSTRUCT)
357#if defined(OS_TRACE_RTOS_LISTS_CONSTRUCT)
370 tmr.internal_interrupt_service_routine ();
402#if defined(OS_TRACE_RTOS_LISTS_CLOCKS)
404 static_cast<uint32_t
> (timestamp));
410#if defined(OS_TRACE_RTOS_LISTS_CLOCKS)
412 static_cast<uint32_t
> (after->
timestamp),
413 static_cast<uint32_t
> (timestamp));
416 else if (timestamp <
head ()->timestamp)
422#if defined(OS_TRACE_RTOS_LISTS_CLOCKS)
424 static_cast<uint32_t
> (timestamp),
425 static_cast<uint32_t
> (
head ()->timestamp));
432 while (timestamp < after->timestamp)
437#if defined(OS_TRACE_RTOS_LISTS_CLOCKS)
439 static_cast<uint32_t
> (after->
timestamp),
440 static_cast<uint32_t
> (timestamp));
477#if defined(OS_TRACE_RTOS_LISTS_CLOCKS)
505#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.