embkernel
 All Classes Functions Variables Typedefs Groups Pages
Public Types | Static Public Member Functions | Static Public Attributes | Static Private Member Functions | Static Private Attributes | Friends | List of all members

Core class. More...

#include <Rtos.hpp>

Public Types

typedef uint32_t TICK
 TICK type.
 
typedef unsigned int PRIORITY
 Priority type.
 

Static Public Member Functions

static void start ()
 
static void sleep (TICK tick)
 
static void sleepUntil (TICK tick)
 
static bool isElapsed (TICK tick)
 
static constexpr TICK convertMsToTick (uint32_t ms)
 
static constexpr uint32_t convertTickToMs (TICK tick)
 
static TICK getTick ()
 
static RtosTaskgetCurrentTask ()
 
static void enterCriticalSection ()
 
static void exitCriticalSection ()
 
static void disableAllInt ()
 
static void enableAllInt ()
 
static void nop ()
 

Static Public Attributes

static constexpr TICK TICK_MAX = 0xFFFFFFFF
 Maximal tick value.
 
static constexpr TICK TICK_INFINITE = 0xFFFFFFFF
 This values is usually used to indicate an infinite intervall.
 

Static Private Member Functions

static void addTask (RtosTask *task)
 
static void removeTask (RtosTask *task)
 
static void putOnSleepingList (RtosTask *task, TICK tick)
 
static void putOnSuspendedList (RtosTask *task)
 
static void onTick ()
 
static void * schedule (void *stackPointer)
 
static void idleRun (RtosTask *task)
 

Static Private Attributes

static size_t sMaxPriorities = RTOS_CFG_MAX_PRIORITIES
 Maximal priority value for a task.
 
static void * sMemToFree = 0
 Pointer to a task stack that can be discarded.
 
static RtosTasksCurrentTask
 Pointer to the currently running task.
 
static RtosTask sIdleTask
 Idle task is the lower priority task.
 
static TICK sTick
 Tick counter value.
 
static RtosList sListReady [RTOS_CFG_MAX_PRIORITIES]
 Lists containing the task ready to run separated by priority value.
 
static RtosList sListSleep
 List containing the task which are sleeping.
 
static RtosList sListSuspended
 List containing the suspended task.
 
static size_t sCurrentTaskCount = 0
 Total count of task existing.
 

Friends

class RtosTask
 
class RtosSyncObject
 
class RtosPortable
 

Detailed Description

Core class.

Its main purpose it to schedule and synchronize the task.

Definition at line 25 of file Rtos.hpp.

Member Function Documentation

static constexpr TICK Rtos::convertMsToTick ( uint32_t  ms)
inlinestatic

Converts the defined milliseconds to its equivalent ticks value.

Parameters
msvalue to convert
Returns
the converted amount of ticks.

Definition at line 46 of file Rtos.hpp.

static constexpr uint32_t Rtos::convertTickToMs ( TICK  tick)
inlinestatic

Converts the defined tick count to its equivalent milliseconds value.

Parameters
tickvalue to convert
Returns
the converted milliseconds value.

Definition at line 55 of file Rtos.hpp.

static void Rtos::disableAllInt ( )
inlinestatic

Disables all interrupts on the system.

Definition at line 92 of file Rtos.hpp.

static void Rtos::enableAllInt ( )
inlinestatic

Enables all interrupts on the system.

Definition at line 99 of file Rtos.hpp.

static void Rtos::enterCriticalSection ( )
inlinestatic

Called at the beginning of a critical section of code which can't be interrupted by another task.

Definition at line 78 of file Rtos.hpp.

static void Rtos::exitCriticalSection ( )
inlinestatic

Called at the end of a critical section of code.

Definition at line 85 of file Rtos.hpp.

static RtosTask* Rtos::getCurrentTask ( )
inlinestatic

Gets the current running task.

Returns
the current task pointer.

Definition at line 71 of file Rtos.hpp.

static TICK Rtos::getTick ( )
inlinestatic

Gets the tick counter.

Returns
the current tick counter.

Definition at line 63 of file Rtos.hpp.

static void Rtos::nop ( )
inlinestatic

Simple no operation command.

Definition at line 106 of file Rtos.hpp.


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