EasyManuals Logo

Espressif ESP32-S2 User Manual

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #866 background imageLoading...
Page #866 background image
Chapter 2. API Reference
(continued from previous page)
tskIDLE_PRIORITY,// Priority at which the task is created.
xStack, // Array to use as the task's stack.
&xTaskBuffer ); // Variable to hold the task's data
,structure.
// puxStackBuffer and pxTaskBuffer were not NULL, so the task will have
// been created, and xHandle will be the task's handle. Use the handle
// to suspend the task.
vTaskSuspend( xHandle );
}
Return If neither pxStackBuffer or pxTaskBuffer are NULL, then the task will be created and pdPASS is
returned. If either pxStackBuffer or pxTaskBuffer are NULL then the task will not be created and er-
rCOULD_NOT_ALLOCATE_REQUIRED_MEMORY is returned.
Note If program uses thread local variables (ones specified with__threadkeyword) then storage for them
will be allocated on the tasks stack.
Parameters
pvTaskCode: Pointer to the task entry function. Tasks must be implemented to never return (i.e.
continuous loop), or should be terminated using vTaskDelete function.
pcName: A descriptive name for the task. This is mainly used to facilitate debugging. The maxi-
mum length of the string is defined by configMAX_TASK_NAME_LEN in FreeRTOSConfig.h.
ulStackDepth: The size of the task stack specified as the number of bytes. Note that this differs
from vanilla FreeRTOS.
pvParameters: Pointer that will be used as the parameter for the task being created.
uxPriority: The priority at which the task will run.
pxStackBuffer: Must point to a StackType_t array that has at least ulStackDepth indexes -
the array will then be used as the tasks stack, removing the need for the stack to be allocated
dynamically.
pxTaskBuffer: Must point to a variable of type StaticTask_t, which will then be used to hold
the tasks data structures, removing the need for the memory to be allocated dynamically.
void vTaskAllocateMPURegions(TaskHandle_t xTask, const MemoryRegion_t *const pxRe-
gions)
Only available when configSUPPORT_DYNAMIC_ALLOCATION is set to 1.
xTaskCreateRestricted() should only be used in systems that include an MPU implementation.
Create a new task and add it to the list of tasks that are ready to run. The function parameters define the
memory regions and associated access permissions allocated to the task.
See xTaskCreateRestrictedStatic() for a version that does not use any dynamic memory allocation.
return pdPASS if the task was successfully created and added to a ready list, otherwise an error code defined
in the file projdefs.h
Parameters
pxTaskDefinition: Pointer to a structure that contains a member for each of the normal
xTaskCreate() parameters (see the xTaskCreate() API documentation) plus an optional stack buffer
and the memory region definitions.
pxCreatedTask: Used to pass back a handle by which the created task can be referenced.
Example usage:
// Create an TaskParameters_t structure that defines the task to be created.
static const TaskParameters_t xCheckTaskParameters =
{
vATask, // pvTaskCode - the function that implements the task.
"ATask", // pcName - just a text name for the task to assist debugging.
100, // usStackDepth - the stack size DEFINED IN WORDS.
NULL, // pvParameters - passed into the task function as the function
,parameters.
(continues on next page)
Espressif Systems 855
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Espressif ESP32-S2 and is the answer not in the manual?

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish