111 #define QMAX_NOTIFICATION_VALUE ( UINT32_MAX - 1UL )
125 #if ( Q_TASK_EVENT_FLAGS == 1 )
128 #define QEVENTFLAG_01 ( 0x00001000UL )
129 #define QEVENTFLAG_02 ( 0x00002000UL )
130 #define QEVENTFLAG_03 ( 0x00004000UL )
131 #define QEVENTFLAG_04 ( 0x00008000UL )
132 #define QEVENTFLAG_05 ( 0x00010000UL )
133 #define QEVENTFLAG_06 ( 0x00020000UL )
134 #define QEVENTFLAG_07 ( 0x00040000UL )
135 #define QEVENTFLAG_08 ( 0x00080000UL )
136 #define QEVENTFLAG_09 ( 0x00100000UL )
137 #define QEVENTFLAG_10 ( 0x00200000UL )
138 #define QEVENTFLAG_11 ( 0x00400000UL )
139 #define QEVENTFLAG_12 ( 0x00800000UL )
140 #define QEVENTFLAG_13 ( 0x01000000UL )
141 #define QEVENTFLAG_14 ( 0x02000000UL )
142 #define QEVENTFLAG_15 ( 0x04000000UL )
143 #define QEVENTFLAG_16 ( 0x08000000UL )
144 #define QEVENTFLAG_17 ( 0x10000000UL )
145 #define QEVENTFLAG_18 ( 0x20000000UL )
146 #define QEVENTFLAG_19 ( 0x40000000UL )
147 #define QEVENTFLAG_20 ( 0x80000000UL )
150 #define QEVENTFLAG_CLEAR ( qFalse )
153 #define QEVENTFLAG_SET ( qTrue )
162 typedef struct _qEvent_s {
268 typedef struct _qTask_s {
270 struct _qTask_Private_s {
272 void *taskData, *asyncData;
274 #if ( ( Q_FSM == 1 ) || ( Q_ATCLI == 1 ) )
277 #if ( Q_QUEUES == 1 )
281 #if ( Q_ALLOW_TASK_NAMING == 1 )
285 #if ( Q_TASK_COUNT_CYCLES == 1 )
288 #if ( Q_PRESERVE_TASK_ENTRY_ORDER == 1 )
302 #if ( Q_QUEUES == 1 )
403 #if ( Q_TASK_COUNT_CYCLES == 1 )
533 #define qTask_Suspend( Task ) qTask_Set_State( (Task), qDisabled )
541 #define qTask_Disable( Task ) qTask_Set_State( (Task), qDisabled )
549 #define qTask_Resume( Task ) qTask_Set_State( (Task), qEnabled )
557 #define qTask_Enable( Task ) qTask_Set_State( (Task), qEnabled )
568 #define qTask_ASleep( Task ) qTask_Set_State( (Task), qAsleep )
577 #define qTask_Awake( Task ) qTask_Set_State( (Task), qAwake )
585 #define qTask_IsEnabled( Task ) ( qEnabled == qTask_Get_State( (Task) ) )
589 #if ( Q_QUEUES == 1 )
633 #if ( Q_TASK_EVENT_FLAGS == 1 )
691 #if ( Q_ALLOW_TASK_NAMING == 1 )
qUINT32_t qClock_t
A 32-bit unsigned integer to hold ticks count. Epochs counter.
Definition qclock.h:66
qFloat32_t qTime_t
The typedef that specified an time quantity, usually expressed in seconds.
Definition qclock.h:33
qBool_t qTask_EventFlags_Modify(qTask_t *const Task, const qTask_Flag_t flags, const qBool_t action)
Modify the EventFlags for the provided task.
Definition qtasks.c:277
qTask_Flag_t qTask_EventFlags_Read(const qTask_t *const Task)
Returns the current value of the task's EventFlags.
Definition qtasks.c:292
qBool_t qTask_EventFlags_Check(qTask_t *const Task, qTask_Flag_t flagsToCheck, const qBool_t clearOnExit, const qBool_t checkForAll)
Check for flags set to qTrue inside the task Event-Flags.
Definition qtasks.c:303
#define qNode_MinimalFields
This macro can be used to create custom data that can be used as node of a list. User should locate t...
Definition qlists.h:79
qTask_ClrParam_t
An enum that defines the parameters than can be cleared for a task.
Definition qtasks.h:337
qBool_t qTask_HasPendingNotifications(const qTask_t *const Task)
Check if the task has pending notifications.
Definition qtasks.c:45
qTask_NotifyMode_t
An enum that defines the modes in which a notification can be spread.
Definition qtasks.h:327
qBool_t qTask_Notification_Queue(qTask_t *const Task, void *eventData)
Insert a notification in the FIFO priority queue. The scheduler get this notification as an asynchron...
Definition qtasks.c:31
qBool_t qTask_Notification_Send(qTask_t *const Task, void *eventData)
Sends a simple notification generating an asynchronous event. This method marks the task as ready for...
Definition qtasks.c:12
@ qTask_ClearSimpleNotifications
Definition qtasks.h:341
@ qTask_ClearCycles
Definition qtasks.h:340
@ qTask_ClearNotifications
Definition qtasks.h:343
@ qTask_ClearIterations
Definition qtasks.h:338
@ qTask_ClearTimeElapsed
Definition qtasks.h:339
@ qTask_ClearQueuedNotifications
Definition qtasks.h:342
@ qTask_NotifyQueued
Definition qtasks.h:330
@ qTask_NotifySimple
Definition qtasks.h:329
@ qTask_NotifyNULL
Definition qtasks.h:328
qBool_t qTask_Attach_Queue(qTask_t *const Task, qQueue_t *const q, const qQueueLinkMode_t mode, const qUINT16_t arg)
Attach a Queue to the Task.
Definition qtasks.c:251
qCycles_t qTask_Get_Cycles(const qTask_t *const Task)
Retrieve the number of task activations.
Definition qtasks.c:78
qState_t qTask_Get_State(const qTask_t *const Task)
Retrieve the task operational state.
Definition qtasks.c:63
qBool_t qTask_Set_Time(qTask_t *const Task, const qTime_t tValue)
Set/Change the Task execution interval.
Definition qtasks.c:95
qBool_t qTask_Set_Priority(qTask_t *const Task, const qPriority_t pValue)
Set/Change the task priority value.
Definition qtasks.c:128
qTask_GlobalState_t
An enum to describe the task global states.
Definition qtasks.h:116
qTask_t * qTask_Find_ByName(const char *name)
Tries to find the first task that matches the name provided.
Definition qtasks.c:361
void(* qTaskFcn_t)(qEvent_t arg)
Pointer to a task callback.
Definition qtasks.h:223
qBool_t qTask_Clear(qTask_t *const Task, const qTask_ClrParam_t param)
Clear the specified parameter for the task.
Definition qtasks.c:200
qBool_t qTask_Set_State(qTask_t *const Task, const qState_t s)
Set the task operational state.
Definition qtasks.c:157
qBool_t qTask_Set_Name(qTask_t *const Task, const char *name)
Set the task name.
Definition qtasks.c:335
qQueueLinkMode_t
An enum that defines the modes in which a queue can be linked to a task.
Definition qtasks.h:307
qUINT32_t qNotifier_t
A 32-bit unsigned integer type to hold a notification value.
Definition qtasks.h:105
qTask_t * qTask_Self(void)
Get the current running-task handle.
Definition qtasks.c:245
qBool_t qTask_Set_Callback(qTask_t *const Task, const qTaskFcn_t cFcn)
Set/Change the task callback function.
Definition qtasks.c:141
const char * qTask_Get_Name(const qTask_t *const Task)
Retrieves the task name.
Definition qtasks.c:350
qUINT32_t qTask_Flag_t
A 32-bit unsigned integer type to hold the task flags.
Definition qtasks.h:108
qBool_t qTask_Set_Iterations(qTask_t *const Task, const qIteration_t iValue)
Set/Change the number of task iterations.
Definition qtasks.c:106
qBool_t qTask_Set_Data(qTask_t *const Task, void *arg)
Set the task data.
Definition qtasks.c:187
qTrigger_t
An enum with all the possible values for the qEvent_t::Trigger member.
Definition qtasks.h:43
qTask_GlobalState_t qTask_Get_GlobalState(const qTask_t *const Task)
Retrieve the task global-state.
Definition qtasks.c:90
@ qSuspended
Definition qtasks.h:120
@ qUndefinedGlobalState
Definition qtasks.h:117
@ qReady
Definition qtasks.h:118
@ qRunning
Definition qtasks.h:121
@ qWaiting
Definition qtasks.h:119
@ qQueueMode_Count
Definition qtasks.h:310
@ qQueueMode_Empty
Definition qtasks.h:311
@ qQueueMode_Full
Definition qtasks.h:309
@ qQueueMode_Receiver
Definition qtasks.h:308
@ byEventFlags
When any event-flag is set.
Definition qtasks.h:92
@ byQueueEmpty
When the attached queue is empty. A pointer to the queue will be available in the qEvent_t::EventData...
Definition qtasks.h:88
@ qTriggerNULL
To indicate the absence of trigger. Reserved for internal use.
Definition qtasks.h:47
@ byQueueFull
When the attached queue is full. A pointer to the queue will be available in the qEvent_t::EventData ...
Definition qtasks.h:77
@ byQueueReceiver
When there are elements available in the attached qQueue, the scheduler make a data dequeue (auto-rec...
Definition qtasks.h:72
@ byNotificationQueued
When there is a queued notification in the FIFO priority queue. For this trigger, the dispatcher perf...
Definition qtasks.h:58
@ byNoReadyTasks
Only available when the Idle Task is triggered.
Definition qtasks.h:100
@ byQueueCount
When the element-count of the attached queue reaches the specified value. A pointer to the queue will...
Definition qtasks.h:83
@ byNotificationSimple
When the execution chain does, according to a requirement of asynchronous notification event prompted...
Definition qtasks.h:65
@ bySchedulingRelease
When the scheduler is released.
Definition qtasks.h:96
@ byTimeElapsed
When the time specified for the task elapsed.
Definition qtasks.h:51
qUINT32_t qCycles_t
A type to instantiate a variable that hold the number of task cycles.
Definition qtypes.h:152
qUINT8_t qBool_t
A type to instantiate an OS boolean variable.
Definition qtypes.h:139
qINT32_t qIteration_t
A type to instantiate a variable that hold the number of task iterations.
Definition qtypes.h:129
qUINT8_t qState_t
A type to instantiate an OS state value.
Definition qtypes.h:134
uint32_t qUINT32_t
Unsigned integer type with width of exactly 32 bits respectively.
Definition qtypes.h:48
uint16_t qUINT16_t
Unsigned integer type with width of exactly 16 bits respectively.
Definition qtypes.h:46
qUINT8_t qPriority_t
A type to instantiate a variable to hold the priority value of a task.
Definition qtypes.h:123
The task argument with all the regarding information of the task execution.
Definition qtasks.h:162
void * TaskData
Task arguments defined at the time of its creation. (Storage-Pointer)
Definition qtasks.h:167
qTrigger_t Trigger
This member indicates the event source that triggers the task execution. Possible values are describe...
Definition qtasks.h:180
qBool_t FirstIteration
Indicates whether current pass is the first iteration of the task. This flag will be only set when ti...
Definition qtasks.h:193
void * EventData
Associated data of the event. Specific data will reside here according to the event source....
Definition qtasks.h:174
qBool_t FirstCall
This field indicates that a task is running for the first time. Can be used for data initialization p...
Definition qtasks.h:185
qClock_t StartDelay
The number of epochs between current system time and point in time when the task was marked as Ready....
Definition qtasks.h:211
qBool_t LastIteration
Indicates whether current pass is the last iteration of the task. This flag will be only set when tim...
Definition qtasks.h:201
A Queue object.
Definition qqueues.h:53
A STimer(Software Timer) object.
Definition qstimers.h:32
A task node object.
Definition qtasks.h:268