ZestCode
 
Loading...
Searching...
No Matches
task.h
1/*
2 * FreeRTOS Kernel V10.0.1
3 * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy of
6 * this software and associated documentation files (the "Software"), to deal in
7 * the Software without restriction, including without limitation the rights to
8 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 * the Software, and to permit persons to whom the Software is furnished to do so,
10 * subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in all
13 * copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 *
22 * http://www.FreeRTOS.org
23 * http://aws.amazon.com/freertos
24 *
25 * 1 tab == 4 spaces!
26 */
27
28#include "FreeRTOS.h"
29
30#ifndef INC_TASK_H
31#define INC_TASK_H
32
33#ifndef INC_FREERTOS_H
34 #error "include FreeRTOS.h must appear in source files before include task.h"
35#endif
36
37#include "list.h"
38
39#ifdef __cplusplus
40extern "C" {
41#endif
42
43/*-----------------------------------------------------------
44 * MACROS AND DEFINITIONS
45 *----------------------------------------------------------*/
46
47#define tskKERNEL_VERSION_NUMBER "V10.0.1"
48#define tskKERNEL_VERSION_MAJOR 10
49#define tskKERNEL_VERSION_MINOR 0
50#define tskKERNEL_VERSION_BUILD 1
51
62typedef void * task_t;
63
64/*
65 * Defines the prototype to which the application task hook function must
66 * conform.
67 */
68typedef int32_t (*TaskHookFunction_t)( void * );
69
70/* Task states returned by task_get_state. */
71typedef enum
72{
73 E_TASK_STATE_RUNNING = 0, /* A task is querying the state of itself, so must be running. */
74 E_TASK_STATE_READY, /* The task being queried is in a read or pending ready list. */
75 E_TASK_STATE_BLOCKED, /* The task being queried is in the Blocked state. */
76 E_TASK_STATE_SUSPENDED, /* The task being queried is in the Suspended state, or is in the Blocked state with an infinite time out. */
77 E_TASK_STATE_DELETED, /* The task being queried has been deleted, but its TCB has not yet been freed. */
78 E_TASK_STATE_INVALID /* Used as an 'invalid state' value. */
80
81/* Actions that can be performed when vTaskNotify() is called. */
82typedef enum
83{
84 E_NOTIFY_ACTION_NONE = 0, /* Notify the task without updating its notify value. */
85 E_NOTIFY_ACTION_BITS, /* Set bits in the task's notification value. */
86 E_NOTIFY_ACTION_INCR, /* Increment the task's notification value. */
87 E_NOTIFY_ACTION_OWRITE, /* Set the task's notification value to a specific value even if the previous value has not yet been read by the task. */
88 E_NOTIFY_ACTION_NO_OWRITE /* Set the task's notification value if the previous value has been read by the task. */
90
91/*
92 * Used internally only.
93 */
94typedef struct xTIME_OUT
95{
96 int32_t xOverflowCount;
97 uint32_t xTimeOnEntering;
98} TimeOut_t;
99
100
101/*
102 * Parameters required to create an MPU protected task.
103 */
104typedef struct xTASK_PARAMETERS
105{
106 task_fn_t pvTaskCode;
107 const char * const pcName; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
108 uint16_t usStackDepth;
109 void *pvParameters;
110 uint32_t uxPriority;
111 task_stack_t *puxStackBuffer;
112} TaskParameters_t;
113
114/* Used with the uxTaskGetSystemState() function to return the state of each task
115in the system. */
116typedef struct xTASK_STATUS
117{
118 task_t xHandle; /* The handle of the task to which the rest of the information in the structure relates. */
119 const char *pcTaskName; /* A pointer to the task's name. This value will be invalid if the task was deleted since the structure was populated! */ /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
120 uint32_t xTaskNumber; /* A number unique to the task. */
121 task_state_e_t eCurrentState; /* The state in which the task existed when the structure was populated. */
122 uint32_t uxCurrentPriority; /* The priority at which the task was running (may be inherited) when the structure was populated. */
123 uint32_t uxBasePriority; /* The priority to which the task will return if the task's current priority has been inherited to avoid unbounded priority inversion when obtaining a mutex. Only valid if configUSE_MUTEXES is defined as 1 in FreeRTOSConfig.h. */
124 uint32_t ulRunTimeCounter; /* The total run time allocated to the task so far, as defined by the run time stats clock. See http://www.freertos.org/rtos-run-time-stats.html. Only valid when configGENERATE_RUN_TIME_STATS is defined as 1 in FreeRTOSConfig.h. */
125 task_stack_t *pxStackBase; /* Points to the lowest address of the task's stack area. */
126 uint16_t usStackHighWaterMark; /* The minimum amount of stack space that has remained for the task since the task was created. The closer this value is to zero the closer the task has come to overflowing its stack. */
127} TaskStatus_t;
128
129/* Possible return values for eTaskConfirmSleepModeStatus(). */
130typedef enum
131{
132 eAbortSleep = 0, /* A task has been made ready or a context switch pended since portSUPPORESS_TICKS_AND_SLEEP() was called - abort entering a sleep mode. */
133 eStandardSleep, /* Enter a sleep mode that will not last any longer than the expected idle time. */
134 eNoTasksWaitingTimeout /* No tasks are waiting for a timeout so it is safe to enter a sleep mode that can only be exited by an external interrupt. */
135} eSleepModeStatus;
136
142#define tskIDLE_PRIORITY ( ( uint32_t ) 0U )
143
152#define taskYIELD() portYIELD()
153
166#define taskENTER_CRITICAL() portENTER_CRITICAL()
167#define taskENTER_CRITICAL_FROM_ISR() portSET_INTERRUPT_MASK_FROM_ISR()
168
181#define taskEXIT_CRITICAL() portEXIT_CRITICAL()
182#define taskEXIT_CRITICAL_FROM_ISR( x ) portCLEAR_INTERRUPT_MASK_FROM_ISR( x )
191#define taskDISABLE_INTERRUPTS() portDISABLE_INTERRUPTS()
192
201#define taskENABLE_INTERRUPTS() portENABLE_INTERRUPTS()
202
203/* Definitions returned by xTaskGetSchedulerState(). taskSCHEDULER_SUSPENDED is
2040 to generate more optimal code when configASSERT() is defined as the constant
205is used in assert() statements. */
206#define taskSCHEDULER_SUSPENDED ( ( int32_t ) 0 )
207#define taskSCHEDULER_NOT_STARTED ( ( int32_t ) 1 )
208#define taskSCHEDULER_RUNNING ( ( int32_t ) 2 )
209
210
211/*-----------------------------------------------------------
212 * TASK CREATION API
213 *----------------------------------------------------------*/
214
308#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
309 task_t task_create(task_fn_t function, void* const parameters,
310 uint32_t prio, const uint16_t stack_depth,
311 const char* const name);
312#endif
313
421#if( configSUPPORT_STATIC_ALLOCATION == 1 )
422 task_t task_create_static( task_fn_t task_code, void* const param,
423 uint32_t priority, const size_t stack_size,
424 const char* const name,
425 task_stack_t * const stack_buffer,
426 static_task_s_t * const task_buffer ) ;
427#endif /* configSUPPORT_STATIC_ALLOCATION */
428
468void task_delete( task_t xTaskToDelete ) ;
469
470/*-----------------------------------------------------------
471 * TASK CONTROL API
472 *----------------------------------------------------------*/
473
520void task_delay( const uint32_t xTicksToDelay ) ;
521
579void task_delay_until( uint32_t * const pxPreviousWakeTime, const uint32_t xTimeIncrement ) ;
580
604int32_t task_abort_delay( task_t xTask ) ;
605
651uint32_t task_get_priority( task_t xTask ) ;
652
659uint32_t uxTaskPriorityGetFromISR( task_t xTask ) ;
660
678
733void vTaskGetInfo( task_t xTask, TaskStatus_t *pxTaskStatus, int32_t xGetFreeStackSpace, task_state_e_t eState ) ;
734
775void task_set_priority( task_t xTask, uint32_t uxNewPriority ) ;
776
826void task_suspend( task_t xTaskToSuspend ) ;
827
875void task_resume( task_t xTaskToResume ) ;
876
904int32_t xTaskResumeFromISR( task_t xTaskToResume ) ;
905
906/*-----------------------------------------------------------
907 * SCHEDULER CONTROL
908 *----------------------------------------------------------*/
909
937void rtos_sched_start( void ) ;
938
993void rtos_sched_stop( void ) ;
994
1044void rtos_suspend_all( void ) ;
1045
1098int32_t rtos_resume_all( void ) ;
1099
1100/*-----------------------------------------------------------
1101 * TASK UTILITIES
1102 *----------------------------------------------------------*/
1103
1113uint32_t millis( void ) ;
1114
1129uint32_t xTaskGetTickCountFromISR( void ) ;
1130
1143uint32_t task_get_count( void ) ;
1144
1156char *task_get_name( task_t xTaskToQuery ) ; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
1157
1172task_t task_get_by_name( const char *pcNameToQuery ) ; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
1173
1193uint32_t uxTaskGetStackHighWaterMark( task_t xTask ) ;
1194
1195/* When using trace macros it is sometimes necessary to include task.h before
1196FreeRTOS.h. When this is done TaskHookFunction_t will not yet have been defined,
1197so the following two prototypes will cause a compilation error. This can be
1198fixed by simply guarding against the inclusion of these two prototypes unless
1199they are explicitly required by the configUSE_APPLICATION_TASK_TAG configuration
1200constant. */
1201#ifdef configUSE_APPLICATION_TASK_TAG
1202 #if configUSE_APPLICATION_TASK_TAG == 1
1211 void vTaskSetApplicationTaskTag( task_t xTask, TaskHookFunction_t pxHookFunction ) ;
1212
1219 TaskHookFunction_t xTaskGetApplicationTaskTag( task_t xTask ) ;
1220 #endif /* configUSE_APPLICATION_TASK_TAG ==1 */
1221#endif /* ifdef configUSE_APPLICATION_TASK_TAG */
1222
1223#if( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 )
1224
1225 /* Each task contains an array of pointers that is dimensioned by the
1226 configNUM_THREAD_LOCAL_STORAGE_POINTERS setting in FreeRTOSConfig.h. The
1227 kernel does not use the pointers itself, so the application writer can use
1228 the pointers for any purpose they wish. The following two functions are
1229 used to set and query a pointer respectively. */
1230 void vTaskSetThreadLocalStoragePointer( task_t xTaskToSet, int32_t xIndex, void *pvValue ) ;
1231 void *pvTaskGetThreadLocalStoragePointer( task_t xTaskToQuery, int32_t xIndex ) ;
1232
1233#endif
1234
1246int32_t xTaskCallApplicationTaskHook( task_t xTask, void *pvParameter ) ;
1247
1255task_t xTaskGetIdleTaskHandle( void ) ;
1256
1354uint32_t uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray, const uint32_t uxArraySize, uint32_t * const pulTotalRunTime ) ;
1355
1401void vTaskList( char * pcWriteBuffer ) ; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
1402
1455void vTaskGetRunTimeStats( char *pcWriteBuffer ) ; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
1456
1536int32_t task_notify_ext( task_t xTaskToNotify, uint32_t ulValue, notify_action_e_t eAction, uint32_t *pulPreviousNotificationValue ) ;
1537#define xTaskNotify( xTaskToNotify, ulValue, eAction ) task_notify_ext( ( xTaskToNotify ), ( ulValue ), ( eAction ), NULL )
1538#define xTaskNotifyAndQuery( xTaskToNotify, ulValue, eAction, pulPreviousNotifyValue ) task_notify_ext( ( xTaskToNotify ), ( ulValue ), ( eAction ), ( pulPreviousNotifyValue ) )
1539
1627int32_t xTaskGenericNotifyFromISR( task_t xTaskToNotify, uint32_t ulValue, notify_action_e_t eAction, uint32_t *pulPreviousNotificationValue, int32_t *pxHigherPriorityTaskWoken ) ;
1628#define xTaskNotifyFromISR( xTaskToNotify, ulValue, eAction, pxHigherPriorityTaskWoken ) xTaskGenericNotifyFromISR( ( xTaskToNotify ), ( ulValue ), ( eAction ), NULL, ( pxHigherPriorityTaskWoken ) )
1629#define xTaskNotifyAndQueryFromISR( xTaskToNotify, ulValue, eAction, pulPreviousNotificationValue, pxHigherPriorityTaskWoken ) xTaskGenericNotifyFromISR( ( xTaskToNotify ), ( ulValue ), ( eAction ), ( pulPreviousNotificationValue ), ( pxHigherPriorityTaskWoken ) )
1630
1704int32_t task_notify_wait( uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, uint32_t xTicksToWait ) ;
1705
1750int32_t task_notify(task_t xTaskToNotify);
1751
1805void vTaskNotifyGiveFromISR( task_t xTaskToNotify, int32_t *pxHigherPriorityTaskWoken ) ;
1806
1874uint32_t task_notify_take( bool xClearCountOnExit, uint32_t xTicksToWait ) ;
1875
1890int32_t task_notify_clear( task_t xTask );
1891
1892/*-----------------------------------------------------------
1893 * SCHEDULER INTERNALS AVAILABLE FOR PORTING PURPOSES
1894 *----------------------------------------------------------*/
1895
1896/*
1897 * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS ONLY
1898 * INTENDED FOR USE WHEN IMPLEMENTING A PORT OF THE SCHEDULER AND IS
1899 * AN INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
1900 *
1901 * Called from the real time kernel tick (either preemptive or cooperative),
1902 * this increments the tick count and checks if any tasks that are blocked
1903 * for a finite period required removing from a blocked list and placing on
1904 * a ready list. If a non-zero value is returned then a context switch is
1905 * required because either:
1906 * + A task was removed from a blocked list because its timeout had expired,
1907 * or
1908 * + Time slicing is in use and there is a task of equal priority to the
1909 * currently running task.
1910 */
1911int32_t xTaskIncrementTick( void ) ;
1912
1913/*
1914 * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN
1915 * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
1916 *
1917 * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED.
1918 *
1919 * Removes the calling task from the ready list and places it both
1920 * on the list of tasks waiting for a particular event, and the
1921 * list of delayed tasks. The task will be removed from both lists
1922 * and replaced on the ready list should either the event occur (and
1923 * there be no higher priority tasks waiting on the same event) or
1924 * the delay period expires.
1925 *
1926 * The 'unordered' version replaces the event list item value with the
1927 * xItemValue value, and inserts the list item at the end of the list.
1928 *
1929 * The 'ordered' version uses the existing event list item value (which is the
1930 * owning tasks priority) to insert the list item into the event list is task
1931 * priority order.
1932 *
1933 * @param pxEventList The list containing tasks that are blocked waiting
1934 * for the event to occur.
1935 *
1936 * @param xItemValue The item value to use for the event list item when the
1937 * event list is not ordered by task priority.
1938 *
1939 * @param xTicksToWait The maximum amount of time that the task should wait
1940 * for the event to occur. This is specified in kernel ticks,the constant
1941 * portTICK_PERIOD_MS can be used to convert kernel ticks into a real time
1942 * period.
1943 */
1944void vTaskPlaceOnEventList( List_t * const pxEventList, const uint32_t xTicksToWait ) ;
1945void vTaskPlaceOnUnorderedEventList( List_t * pxEventList, const uint32_t xItemValue, const uint32_t xTicksToWait ) ;
1946
1947/*
1948 * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN
1949 * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
1950 *
1951 * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED.
1952 *
1953 * This function performs nearly the same function as vTaskPlaceOnEventList().
1954 * The difference being that this function does not permit tasks to block
1955 * indefinitely, whereas vTaskPlaceOnEventList() does.
1956 *
1957 */
1958void vTaskPlaceOnEventListRestricted( List_t * const pxEventList, uint32_t xTicksToWait, const int32_t xWaitIndefinitely ) ;
1959
1960/*
1961 * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN
1962 * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
1963 *
1964 * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED.
1965 *
1966 * Removes a task from both the specified event list and the list of blocked
1967 * tasks, and places it on a ready queue.
1968 *
1969 * xTaskRemoveFromEventList()/vTaskRemoveFromUnorderedEventList() will be called
1970 * if either an event occurs to unblock a task, or the block timeout period
1971 * expires.
1972 *
1973 * xTaskRemoveFromEventList() is used when the event list is in task priority
1974 * order. It removes the list item from the head of the event list as that will
1975 * have the highest priority owning task of all the tasks on the event list.
1976 * vTaskRemoveFromUnorderedEventList() is used when the event list is not
1977 * ordered and the event list items hold something other than the owning tasks
1978 * priority. In this case the event list item value is updated to the value
1979 * passed in the xItemValue parameter.
1980 *
1981 * @return pdTRUE if the task being removed has a higher priority than the task
1982 * making the call, otherwise pdFALSE.
1983 */
1984int32_t xTaskRemoveFromEventList( const List_t * const pxEventList ) ;
1985void vTaskRemoveFromUnorderedEventList( list_item_t * pxEventListItem, const uint32_t xItemValue ) ;
1986
1987/*
1988 * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS ONLY
1989 * INTENDED FOR USE WHEN IMPLEMENTING A PORT OF THE SCHEDULER AND IS
1990 * AN INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
1991 *
1992 * Sets the pointer to the current TCB to the TCB of the highest priority task
1993 * that is ready to run.
1994 */
1995void vTaskSwitchContext( void ) ;
1996
1997/*
1998 * THESE FUNCTIONS MUST NOT BE USED FROM APPLICATION CODE. THEY ARE USED BY
1999 * THE EVENT BITS MODULE.
2000 */
2001uint32_t uxTaskResetEventItemValue( void ) ;
2002
2003/*
2004 * Return the handle of the calling task.
2005 */
2006task_t task_get_current( void ) ;
2007
2008/*
2009 * Capture the current time status for future reference.
2010 */
2011void vTaskSetTimeOutState( TimeOut_t * const pxTimeOut ) ;
2012
2013/*
2014 * Compare the time status now with that previously captured to see if the
2015 * timeout has expired.
2016 */
2017int32_t xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut, uint32_t * const pxTicksToWait ) ;
2018
2019/*
2020 * Shortcut used by the queue implementation to prevent unnecessary call to
2021 * taskYIELD();
2022 */
2023void vTaskMissedYield( void ) ;
2024
2025/*
2026 * Returns the scheduler state as taskSCHEDULER_RUNNING,
2027 * taskSCHEDULER_NOT_STARTED or taskSCHEDULER_SUSPENDED.
2028 */
2029int32_t xTaskGetSchedulerState( void ) ;
2030
2031/*
2032 * Raises the priority of the mutex holder to that of the calling task should
2033 * the mutex holder have a priority less than the calling task.
2034 */
2035int32_t xTaskPriorityInherit( task_t const pxMutexHolder ) ;
2036
2037/*
2038 * Set the priority of a task back to its proper priority in the case that it
2039 * inherited a higher priority while it was holding a semaphore.
2040 */
2041int32_t xTaskPriorityDisinherit( task_t const pxMutexHolder ) ;
2042
2043/*
2044 * If a higher priority task attempting to obtain a mutex caused a lower
2045 * priority task to inherit the higher priority task's priority - but the higher
2046 * priority task then timed out without obtaining the mutex, then the lower
2047 * priority task will disinherit the priority again - but only down as far as
2048 * the highest priority task that is still waiting for the mutex (if there were
2049 * more than one task waiting for the mutex).
2050 */
2051void vTaskPriorityDisinheritAfterTimeout( task_t const pxMutexHolder, uint32_t uxHighestPriorityWaitingTask ) ;
2052
2053/*
2054 * Get the uxTCBNumber assigned to the task referenced by the xTask parameter.
2055 */
2056uint32_t uxTaskGetTaskNumber( task_t xTask ) ;
2057
2058/*
2059 * Set the uxTaskNumber of the task referenced by the xTask parameter to
2060 * uxHandle.
2061 */
2062void vTaskSetTaskNumber( task_t xTask, const uint32_t uxHandle ) ;
2063
2064/*
2065 * Only available when configUSE_TICKLESS_IDLE is set to 1.
2066 * If tickless mode is being used, or a low power mode is implemented, then
2067 * the tick interrupt will not execute during idle periods. When this is the
2068 * case, the tick count value maintained by the scheduler needs to be kept up
2069 * to date with the actual execution time by being skipped forward by a time
2070 * equal to the idle period.
2071 */
2072void vTaskStepTick( const uint32_t xTicksToJump ) ;
2073
2074/*
2075 * Only avilable when configUSE_TICKLESS_IDLE is set to 1.
2076 * Provided for use within portSUPPRESS_TICKS_AND_SLEEP() to allow the port
2077 * specific sleep function to determine if it is ok to proceed with the sleep,
2078 * and if it is ok to proceed, if it is ok to sleep indefinitely.
2079 *
2080 * This function is necessary because portSUPPRESS_TICKS_AND_SLEEP() is only
2081 * called with the scheduler suspended, not from within a critical section. It
2082 * is therefore possible for an interrupt to request a context switch between
2083 * portSUPPRESS_TICKS_AND_SLEEP() and the low power mode actually being
2084 * entered. eTaskConfirmSleepModeStatus() should be called from a short
2085 * critical section between the timer being stopped and the sleep mode being
2086 * entered to ensure it is ok to proceed into the sleep mode.
2087 */
2088eSleepModeStatus eTaskConfirmSleepModeStatus( void ) ;
2089
2090/*
2091 * For internal use only. Increment the mutex held count when a mutex is
2092 * taken and return the handle of the task that has taken the mutex.
2093 */
2094void *pvTaskIncrementMutexHeldCount( void ) ;
2095
2096/*
2097 * For internal use only. Same as vTaskSetTimeOutState(), but without a critial
2098 * section.
2099 */
2100void vTaskInternalSetTimeOutState( TimeOut_t * const pxTimeOut ) ;
2101
2102
2103#ifdef __cplusplus
2104}
2105#endif
2106#endif /* INC_TASK_H */
bool task_abort_delay(task_t task)
uint32_t task_notify(task_t task)
void * task_t
Definition rtos.h:100
task_state_e_t
Definition rtos.h:119
task_t task_create(task_fn_t function, void *const parameters, uint32_t prio, const uint16_t stack_depth, const char *const name)
void task_delay(const uint32_t milliseconds)
notify_action_e_t
Definition rtos.h:131
void task_suspend(task_t task)
void task_resume(task_t task)
task_state_e_t task_get_state(task_t task)
void task_delay_until(uint32_t *const prev_time, const uint32_t delta)
uint32_t task_get_count(void)
uint32_t task_notify_ext(task_t task, uint32_t value, notify_action_e_t action, uint32_t *prev_value)
uint32_t task_get_priority(task_t task)
void task_set_priority(task_t task, uint32_t prio)
uint32_t task_notify_take(bool clear_on_exit, uint32_t timeout)
task_t task_get_by_name(const char *name)
char * task_get_name(task_t task)
uint32_t millis(void)
void task_delete(task_t task)
task_t task_get_current()
bool task_notify_clear(task_t task)
void(* task_fn_t)(void *)
Definition rtos.h:108
@ E_TASK_STATE_SUSPENDED
Definition rtos.h:123
@ E_TASK_STATE_RUNNING
Definition rtos.h:120
@ E_TASK_STATE_INVALID
Definition rtos.h:125
@ E_TASK_STATE_DELETED
Definition rtos.h:124
@ E_TASK_STATE_READY
Definition rtos.h:121
@ E_TASK_STATE_BLOCKED
Definition rtos.h:122
@ E_NOTIFY_ACTION_OWRITE
Definition rtos.h:135
@ E_NOTIFY_ACTION_NO_OWRITE
Definition rtos.h:136
@ E_NOTIFY_ACTION_NONE
Definition rtos.h:132
@ E_NOTIFY_ACTION_INCR
Definition rtos.h:134
@ E_NOTIFY_ACTION_BITS
Definition rtos.h:133
task_t task_create_static(task_fn_t task_code, void *const param, uint32_t priority, const size_t stack_size, const char *const name, task_stack_t *const stack_buffer, static_task_s_t *const task_buffer)
int32_t rtos_resume_all(void)
void rtos_suspend_all(void)
Definition task.h:105
Definition task.h:117
Definition task.h:95