SuperTinyKernel™ RTOS 1.08.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
Loading...
Searching...
No Matches
stk::IPlatform::IEventOverrider Class Reference

Interface for a platform event overrider. More...

#include <stk_common.h>

Inheritance diagram for stk::IPlatform::IEventOverrider:

Public Member Functions

virtual bool OnSleep (Timeout sleep_ticks)
 Called by the Kernel when it is entering a sleep mode.
virtual bool OnHardFault ()
 Called by Kernel when hard fault happens.
virtual bool OnException (EHwException exc_id, TId tid, const struct FaultContext *const ctx)
 Called by the platform driver during initialization to obtain global, application-defined MPU configurations.

Detailed Description

Interface for a platform event overrider.

Note
Optional. Can be used to extend functionality of default IPlatform driver handlers from the user-space.

Definition at line 1076 of file stk_common.h.

Member Function Documentation

◆ OnException()

virtual bool stk::IPlatform::IEventOverrider::OnException ( EHwException exc_id,
TId tid,
const struct FaultContext *const ctx )
inlinevirtual

Called by the platform driver during initialization to obtain global, application-defined MPU configurations.

Allows user-space code to configure custom MPU regions (e.g., shared data/code sections or peripheral blocks) and enable state at system startup. Unlike per-task MPU regions set via ITask::GetMpuRegions(), configurations returned by this callback apply globally across the platform driver.

Returns
Pointer to a constant MpuConfig structure encapsulating global region descriptors and enable state, or nullptr if no custom global MPU configuration is supplied.
Note
Optional. The default implementation returns nullptr.
The underlying MpuConfig instance referenced by the returned pointer must remain valid for the duration of platform initialization (e.g., point to a static instance).
See also
MpuConfig, ITask::GetMpuRegions

Called by platform driver when hardware exception occurred.

Parameters
[in]exc_idHardware exception id, see EHwException.
[in]tidTId of the currently active task.
[in]ctxFaultContext which includes hardware exception frame captured at fault entry (see hw::ExceptionFrame). PC is the true faulting instruction address; may be nullptr if unavailable.
Returns
True if event is handled otherwise False to let driver handle it.
See also
EHwException

Definition at line 1124 of file stk_common.h.

1125 {
1126 STK_UNUSED(exc_id);
1127 STK_UNUSED(tid);
1128 STK_UNUSED(ctx);
1129 return false;
1130 }
#define STK_UNUSED(X)
Explicitly marks a variable as unused to suppress compiler warnings.
Definition stk_defs.h:715

References STK_UNUSED.

◆ OnHardFault()

virtual bool stk::IPlatform::IEventOverrider::OnHardFault ( )
inlinevirtual

Called by Kernel when hard fault happens.

Note
Normally called by Kernel when one of the scheduled tasks missed its deadline (see stk::KERNEL_HRT, IPlatform::HardFault).
Returns
True if event is handled otherwise False to let driver handle it.

Reimplemented in EventOverrider.

Definition at line 1092 of file stk_common.h.

1093 {
1094 return false;
1095 }

◆ OnSleep()

virtual bool stk::IPlatform::IEventOverrider::OnSleep ( Timeout sleep_ticks)
inlinevirtual

Called by the Kernel when it is entering a sleep mode.

Returns
True if event is handled otherwise False to let driver handle it.

Reimplemented in EventOverrider.

Definition at line 1082 of file stk_common.h.

1083 {
1084 STK_UNUSED(sleep_ticks);
1085 return false;
1086 }

References STK_UNUSED.


The documentation for this class was generated from the following file: