12#if defined(OS_USE_OS_APP_CONFIG_H)
13#include <cmsis-plus/os-app-config.h>
22#pragma clang diagnostic ignored "-Wc++98-compat"
47#pragma GCC diagnostic push
49#pragma clang diagnostic ignored "-Wpadded"
50#elif defined(__GNUC__)
51#pragma GCC diagnostic ignored "-Wpadded"
54 using main_args_t =
struct
60#pragma GCC diagnostic pop
62 static main_args_t main_args;
66 [[noreturn]]
static void
67 _main_trampoline (
void)
72 int code =
os_main (main_args.argc, main_args.argv);
94#if defined(OS_EXCLUDE_DYNAMIC_MEMORY_ALLOCATIONS)
101static std::aligned_storage<
sizeof (main_thread),
alignof (main_thread)>::type
110#if !defined(__APPLE__)
111 __attribute__ ((weak))
127#if defined(OS_HAS_INTERRUPTS_STACK)
132#if defined(__clang__)
138#if defined(__EXCEPTIONS)
148 main_args.argc = argc;
149 main_args.argv = argv;
151#if defined(OS_EXCLUDE_DYNAMIC_MEMORY_ALLOCATIONS)
157 new (&os_main_thread_)
158 main_thread{
"main",
reinterpret_cast<thread::func_t> (_main_trampoline),
167#pragma GCC diagnostic push
168#if defined(__clang__)
169#pragma clang diagnostic ignored "-Wcast-function-type-strict"
172 "main",
reinterpret_cast<thread::func_t> (_main_trampoline),
nullptr,
174#pragma GCC diagnostic pop
178#if !defined(OS_USE_RTOS_PORT_SCHEDULER)
191#if !defined(__APPLE__)
192 __attribute__ ((weak))
200#if !defined(OS_EXCLUDE_DYNAMIC_MEMORY_ALLOCATIONS)
205#if defined(OS_INTEGER_RTOS_DYNAMIC_MEMORY_SIZE_BYTES)
216#if defined(OS_HAS_INTERRUPTS_STACK)
static constexpr uint32_t frequency_hz
SysTick frequency in Hz.
void trace_print_statistics(void)
Print a long message with usage statistics.
std::size_t th_stack_size_bytes
Size of the user defined storage for the thread stack, in bytes.
std::size_t size(void)
Get the stack size.
static std::size_t default_size(void)
Get the default stack size.
std::size_t available(void)
Compute how much available stack remains.
Template of a POSIX compliant thread with local stack.
POSIX compliant thread, using the default RTOS allocator.
static const attributes initializer
Default thread initialiser.
thread::stack & stack(void)
Get the thread context stack.
void *(*)(func_args_t args) func_t
Type of thread function.
#define OS_INTEGER_RTOS_MAIN_STACK_SIZE_BYTES
Define the main thread stack size, in bytes.
void os_startup_create_thread_idle(void)
Create the idle thread.
void os_terminate_goodbye(void)
Display statistics and say goodbye before terminating.
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.
void dump_args(int argc, char *argv[])
Write the argv[] array to the trace device.
int os_main(int argc, char *argv[])
Application entry point, running on the main thread context.
class thread::stack * stack(void)
Get the interrupts stack.
memory_resource * get_default_resource(void) noexcept
Get the default RTOS system memory manager.
memory_resource * get_default_resource(void) noexcept
Get the default application memory manager.
void start(void)
Start the RTOS scheduler.
result_t initialize(void)
Initialise the RTOS scheduler.
int main(int argc, char *argv[])
Default implementation of main().
rtos::thread * os_main_thread
#define OS_STRING_RTOS_IMPL_YEAR
#define OS_STRING_RTOS_IMPL_VERSION
Single file µOS++ RTOS definitions.