Espressif ESP32-S2 Programming Manual page 876

Table of Contents

Advertisement

Chapter 2. API Reference
}
}
void vAFunction( void )
{
//
Create at least one task before starting the
xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
//
Start the real time kernel
vTaskStartScheduler ();
//
Will only get here when the vTaskCode () task has called
//
vTaskEndScheduler
// execution.
}
void vTaskSuspendAll(void)
Suspends the scheduler without disabling interrupts. Context switches will not occur while the scheduler is
suspended.
After calling vTaskSuspendAll () the calling task will continue to execute without risk of being swapped out
until a call to xTaskResumeAll () has been made.
API functions that have the potential to cause a context switch (for example, vTaskDelayUntil(), xQueueSend(),
etc.) must not be called while the scheduler is suspended.
Example usage:
void vTask1( void
{
for( ;; )
{
//
Task code goes
// ...
//
At some point the task wants to perform a long operation during
//
which it does
//
taskENTER_CRITICAL ()/taskEXIT_CRITICAL ()
//
operation may cause interrupts to be missed
// ticks.
//
Prevent the real time kernel swapping out the
vTaskSuspendAll ();
//
Perform the operation
//
sections
//
During this time interrupts will still operate
//
tick count will be
// ...
//
The operation
xTaskResumeAll ();
}
}
BaseType_t xTaskResumeAll(void)
Resumes scheduler activity after it was suspended by a call to vTaskSuspendAll().
xTaskResumeAll() only resumes the scheduler. It does not unsuspend tasks that were previously suspended by
a call to vTaskSuspend().
Espressif Systems
with
preemption.
().
When we get here we are back to single task
*
pvParameters )
here.
not
want to get swapped
here.
as
we have
all
the microcontroller processing
maintained.
is
complete.
Restart the
865
Submit Document Feedback
kernel.
out.
It cannot use
as
the length of the
-
including the
task.
There
is
no need to use critical
and
kernel.
(continued from previous page)
time.
the kernel
Release v4.4

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Table of Contents

Save PDF