SuperTinyKernel™ RTOS 1.05.3
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
Loading...
Searching...
No Matches
stk::test::PrioritySleepRelaxCpuContext Struct Reference
Collaboration diagram for stk::test::PrioritySleepRelaxCpuContext:

Public Member Functions

 PrioritySleepRelaxCpuContext ()
void Clear ()
void Process ()

Public Attributes

uint32_t counter
PlatformTestMockplatform
ITasktask1
ITasktask2

Detailed Description

Definition at line 187 of file stktest_switchstrategyfpriority.cpp.

Constructor & Destructor Documentation

◆ PrioritySleepRelaxCpuContext()

stk::test::PrioritySleepRelaxCpuContext::PrioritySleepRelaxCpuContext ( )
inline

Definition at line 189 of file stktest_switchstrategyfpriority.cpp.

References Clear().

Here is the call graph for this function:

Member Function Documentation

◆ Clear()

void stk::test::PrioritySleepRelaxCpuContext::Clear ( )
inline

◆ Process()

void stk::test::PrioritySleepRelaxCpuContext::Process ( )
inline

Definition at line 206 of file stktest_switchstrategyfpriority.cpp.

207 {
208 Stack *&active = platform->m_stack_active;
209
210 platform->ProcessTick();
211
212 // ISR calls OnSysTick (task1 = active, task2 = idle (sleeping))
213 if (counter == 0)
214 {
215 CHECK_EQUAL_TEXT(active->SP, (size_t)task1->GetStack(), "sleep: expecting low-priority task1");
216 }
217 else
218 // ISR calls OnSysTick (task1 = idle (lower priority), task2 = active (higher priority))
219 if (counter == 1)
220 {
221 CHECK_EQUAL_TEXT(active->SP, (size_t)task2->GetStack(), "sleep: expecting high-priority task2");
222 }
223
224 ++counter;
225 }

References counter, platform, stk::Stack::SP, task1, and task2.

Member Data Documentation

◆ counter

uint32_t stk::test::PrioritySleepRelaxCpuContext::counter

Definition at line 202 of file stktest_switchstrategyfpriority.cpp.

Referenced by Clear(), and Process().

◆ platform

PlatformTestMock* stk::test::PrioritySleepRelaxCpuContext::platform

Definition at line 203 of file stktest_switchstrategyfpriority.cpp.

Referenced by Clear(), and Process().

◆ task1

ITask* stk::test::PrioritySleepRelaxCpuContext::task1

Definition at line 204 of file stktest_switchstrategyfpriority.cpp.

Referenced by Clear(), and Process().

◆ task2

ITask * stk::test::PrioritySleepRelaxCpuContext::task2

Definition at line 204 of file stktest_switchstrategyfpriority.cpp.

Referenced by Clear(), and Process().


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