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 const MpuConfigOnConfigureMpu () const
 Called by the platform driver during initialization to obtain global, application-defined MPU configurations.
virtual bool OnException (EHwException exc_id, TId tid, const struct FaultContext *const ctx)
 Called by platform driver when hardware exception occurred.

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 1035 of file stk_common.h.

Member Function Documentation

◆ OnConfigureMpu()

virtual const MpuConfig * stk::IPlatform::IEventOverrider::OnConfigureMpu ( ) const
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

Definition at line 1067 of file stk_common.h.

1068 {
1069 return nullptr;
1070 }

◆ OnException()

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

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 1081 of file stk_common.h.

1082 {
1083 STK_UNUSED(exc_id);
1084 STK_UNUSED(tid);
1085 STK_UNUSED(ctx);
1086 return false;
1087 }
#define STK_UNUSED(X)
Explicitly marks a variable as unused to suppress compiler warnings.
Definition stk_defs.h:654

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 1051 of file stk_common.h.

1052 {
1053 return false;
1054 }

◆ 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 1041 of file stk_common.h.

1042 {
1043 STK_UNUSED(sleep_ticks);
1044 return false;
1045 }

References STK_UNUSED.


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