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 #877 background imageLoading...
Page #877 background image
Chapter 2. API Reference
Example usage:
void vTask1( void * pvParameters )
{
for( ;; )
{
// Task code goes here.
// ...
// At some point the task wants to perform a long operation during
// which it does not want to get swapped out. It cannot use
// taskENTER_CRITICAL ()/taskEXIT_CRITICAL () as the length of the
// operation may cause interrupts to be missed - including the
// ticks.
// Prevent the real time kernel swapping out the task.
vTaskSuspendAll ();
// Perform the operation here. There is no need to use critical
// sections as we have all the microcontroller processing time.
// During this time interrupts will still operate and the real
// time kernel tick count will be maintained.
// ...
// The operation is complete. Restart the kernel. We want to force
// a context switch - but there is no point if resuming the scheduler
// caused a context switch already.
if( !xTaskResumeAll () )
{
taskYIELD ();
}
}
}
Return If resuming the scheduler caused a context switch then pdTRUE is returned, otherwise pdFALSE is
returned.
TickType_t xTaskGetTickCount(void)
Return The count of ticks since vTaskStartScheduler was called.
TickType_t xTaskGetTickCountFromISR(void)
This is a version of xTaskGetTickCount() that is safe to be called from an ISR - provided that TickType_t is
the natural word size of the microcontroller being used or interrupt nesting is either not supported or not being
used.
Return The count of ticks since vTaskStartScheduler was called.
UBaseType_t uxTaskGetNumberOfTasks(void)
Return The number of tasks that the real time kernel is currently managing. This includes all ready, blocked
and suspended tasks. A task that has been deleted but not yet freed by the idle task will also be included
in the count.
char *pcTaskGetName(TaskHandle_t xTaskToQuery)
Return The text (human readable) name of the task referenced by the handle xTaskToQuery. A task can
query its own name by either passing in its own handle, or by setting xTaskToQuery to NULL.
TaskHandle_t xTaskGetHandle(const char *pcNameToQuery)
NOTE: This function takes a relatively long time to complete and should be used sparingly.
Return The handle of the task that has the human readable name pcNameToQuery. NULL is returned if
no matching name is found. INCLUDE_xTaskGetHandle must be set to 1 in FreeRTOSConfig.h for
Espressif Systems 866
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