OS  v1.7.5
Documentation
Loading...
Searching...
No Matches
Managing tasks

API interface to manage tasks. More...

Collaboration diagram for Managing tasks:

Topics

 Event Flags
 API interface for the built-in-task Event Flags.
 

Classes

class  qOS::event_t
 The task argument with all the regarding information of the task execution. More...
 
class  qOS::task
 A task node object. More...
 

Typedefs

using qOS::taskFcn_t
 Pointer to a task callback.
 
using qOS::notifier_t
 A 32-bit unsigned integer type to hold a notification value.
 

Enumerations

enum class  qOS::trigger : uint8_t {
  qOS::trigger::None , qOS::trigger::byTimeElapsed , qOS::trigger::byNotificationQueued , qOS::trigger::byNotificationSimple ,
  qOS::trigger::byQueueReceiver , qOS::trigger::byQueueFull , qOS::trigger::byQueueCount , qOS::trigger::byQueueEmpty ,
  qOS::trigger::byEventFlags , qOS::trigger::bySchedulingRelease , qOS::trigger::byNoReadyTasks
}
 An enum with all the possible values for the event_t::getTrigger() method. More...
 
enum class  qOS::globalState : uint8_t {
  qOS::globalState::UNDEFINED , qOS::globalState::READY , qOS::globalState::WAITING , qOS::globalState::SUSPENDED ,
  qOS::globalState::RUNNING
}
 An enum to describe the task global states. More...
 
enum class  qOS::taskState { qOS::taskState::DISABLED_STATE , qOS::taskState::ENABLED_STATE , qOS::taskState::AWAKE_STATE , qOS::taskState::ASLEEP_STATE }
 An enum that defines the possible task operational states. More...
 
enum class  qOS::queueLinkMode : uint32_t { qOS::queueLinkMode::QUEUE_RECEIVER , qOS::queueLinkMode::QUEUE_FULL , qOS::queueLinkMode::QUEUE_COUNT , qOS::queueLinkMode::QUEUE_EMPTY }
 An enum that defines the modes in which a queue can be linked to a task. More...
 

Detailed Description

API interface to manage tasks.

Precondition
In order to be able to manage a task, make sure the task has already been added to the scheduling scheme by using one of the core::addk() overloads

Typedef Documentation

◆ notifier_t

A 32-bit unsigned integer type to hold a notification value.

◆ taskFcn_t

Pointer to a task callback.

Enumeration Type Documentation

◆ globalState

enum class qOS::globalState : uint8_t
strong

An enum to describe the task global states.

Enumerator
UNDEFINED 

A task should never reach this state(Reserved for internal use)

READY 

The task has completed preparations for running, but cannot run because a task with a higher precedence is running.

WAITING 

The task cannot run because the conditions for running are not in place.

SUSPENDED 

The task doesn't take part in what is going on. Normally this state is taken after the globalState::RUNNING state or when the task doesn't reach the globalState::READY state

RUNNING 

The task is currently being executed.

◆ queueLinkMode

enum class qOS::queueLinkMode : uint32_t
strong

An enum that defines the modes in which a queue can be linked to a task.

Enumerator
QUEUE_RECEIVER 

This mode will trigger the task if there are elements in the queue. Data will be extracted automatically in every trigger and will be available in the event_t::EventData field.

QUEUE_FULL 

This mode will trigger the task if the queue is full. A pointer to the queue will be available in the event_t::EventData field.

QUEUE_COUNT 

This mode will trigger the task if the count of elements in the queue reach the specified value. A pointer to the queue will be available in the event_t::EventData field.

QUEUE_EMPTY 

This mode will trigger the task if the queue is empty. A pointer to the queue will be available in the event_t::EventData field.

◆ taskState

enum class qOS::taskState
strong

An enum that defines the possible task operational states.

Each task has independent operating states from those globally controlled by the scheduler. These states can be handled by the application writer to modify the event flow to the task and consequently, affect the transition to the globalState::READY global state

Enumerator
DISABLED_STATE 

In this state, the time events will be discarded. This operational state is available when the ENABLE bit is cleared.

ENABLED_STATE 

The task can catch all the events. This operational state is available when the ENABLE bit is set.

AWAKE_STATE 

In this state, the task is conceptually in an alert mode, handling most of the available events. This operational state is available when the SHUTDOWN bit is set, allowing the next operational states to be available:

ASLEEP_STATE 

Task operability is put into a deep doze mode, so the task can not be triggered by the lower precedence events. This operational state is available when the SHUTDOWN bit is cleared. The task can exit from this operational state when it receives a high precedence event (a queued notification) or using the task::setState() method.

◆ trigger

enum class qOS::trigger : uint8_t
strong

An enum with all the possible values for the event_t::getTrigger() method.

Enumerator
None 

To indicate the absence of trigger. Reserved for internal use.

byTimeElapsed 

When the time specified for the task elapsed.

byNotificationQueued 

When there is a queued notification in the FIFO priority queue. For this trigger, the dispatcher performs a dequeue operation automatically. A pointer to the extracted event data will be available in the event_t::EventData field.

byNotificationSimple 

When the execution chain does, according to a requirement of asynchronous notification event prompted by core::notify(). A pointer to the notified data will be available in the event_t::EventData field.

byQueueReceiver 

When there are elements available in the attached queue, the scheduler make a data dequeue (auto-receive) from the front. A pointer to the received data will be available in the event_t::EventData field.

byQueueFull 

When the attached queue is full. A pointer to the queue will be available in the event_t::EventData field.

byQueueCount 

When the element-count of the attached queue reaches the specified value. A pointer to the queue will be available in the event_t::EventData field.

byQueueEmpty 

When the attached queue is empty. A pointer to the queue will be available in the event_t::EventData field.

byEventFlags 

When any event-flag is set.

bySchedulingRelease 

When the scheduler is released.

byNoReadyTasks 

Only available when the Idle Task is triggered.