![]() |
SuperTinyKernel™ RTOS 1.06.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
C-level callback table that mirrors stk::IPlatform::IEventOverrider.
More...
#include <stk_c.h>
Public Attributes | |
| bool(* | on_sleep )(stk_timeout_t sleep_ticks, void *user_data) |
| Called by the kernel when it is about to enter a sleep (idle) state. | |
| bool(* | on_hard_fault )(void *user_data) |
| Called by the kernel when a hard fault occurs (e.g. HRT deadline missed). | |
| void * | user_data |
| Opaque pointer forwarded unchanged to every callback. | |
C-level callback table that mirrors stk::IPlatform::IEventOverrider.
Fill in the function pointers you want to intercept, leave the others NULL (a NULL pointer causes the default platform driver behaviour to execute, identical to returning false from the C++ virtual method). The user_data pointer is forwarded to every callback so you can pass context without a global variable.
Both callbacks follow the same return-value convention as the C++ interface:
true → event fully handled; the platform driver does nothing further.false → not handled; the platform driver applies its default behaviour.stk_kernel_set_event_overrider() call until the kernel is destroyed. Static or global storage is recommended. stk_kernel_set_event_overrider() before stk_kernel_start(). | bool(* stk_event_overrider_t::on_hard_fault) (void *user_data) |
Called by the kernel when a hard fault occurs (e.g. HRT deadline missed).
| [in] | user_data | The user_data pointer from this struct. |
true if handled; false to let the platform driver handle it (which typically halts the system). NULL — treated as always returning false. | bool(* stk_event_overrider_t::on_sleep) (stk_timeout_t sleep_ticks, void *user_data) |
Called by the kernel when it is about to enter a sleep (idle) state.
| [in] | sleep_ticks | Number of ticks the kernel intends to sleep. |
| [in] | user_data | The user_data pointer from this struct. |
true if the sleep was handled by the application (kernel skips its own sleep logic); false to let the platform driver handle it. NULL — treated as always returning false. | void* stk_event_overrider_t::user_data |
Opaque pointer forwarded unchanged to every callback.
NULL if not needed.