STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
vTaskEndScheduler

task.

task.

h

void vTaskEndScheduler( void );
void vTaskEndScheduler(void) PRIVILEGED_FUNCTION
Definition tasks.c:2092

NOTE: At the time of writing only the x86 real mode port, which runs on a PC in place of DOS, implements this function.

Stops the real time kernel tick. All created tasks will be automatically deleted and multitasking (either preemptive or cooperative) will stop. Execution then resumes from the point where vTaskStartScheduler () was called, as if vTaskStartScheduler () had just returned.

See the demo application file main. c in the demo/PC directory for an example that uses vTaskEndScheduler ().

vTaskEndScheduler () requires an exit function to be defined within the portable layer (see vPortEndScheduler () in port. c for the PC port). This performs hardware specific operations such as stopping the kernel tick.

vTaskEndScheduler () will cause all of the resources allocated by the kernel to be freed - but will not free resources allocated by application tasks.

Example usage:

void vTaskCode( void * pvParameters )
{
for( ;; )
{
// Task code goes here.
// At some point we want to end the real time kernel processing
// so call ...
}
}
void vAFunction( void )
{
// Create at least one task before starting the kernel.
xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
// Start the real time kernel with preemption.
// Will only get here when the vTaskCode () task has called
// vTaskEndScheduler (). When we get here we are back to single task
// execution.
}
#define NULL
Definition usbd_def.h:44
#define tskIDLE_PRIORITY
Defines the priority used by the idle task.
Definition task.h:191
void vTaskStartScheduler(void) PRIVILEGED_FUNCTION
Definition tasks.c:1967