DestroyTask

From chipKIT
Jump to: navigation, search

Synopsis

 void destroyTask(int id)

Parameter

id  : Task identifier for the task to destroy

Description

This function removes the specified task from the set of defined tasks.

Return Value

None

Conforming To

The Task Management Functions are specific to ChipKit and exceed the Arduino 1.6.x specification.

Example

 int led = 13;
 int blink_id;
 unsigned long blink_var;
 void blink_task(int id, void * tptr) {
   digitalWrite(led, !digitalRead(led); // Toggle pin state
 }
 void setup() {
   pinMode(led, OUTPUT);
   // create the task
   blink_id = createTask(blink_task, 200, TASK_ENABLE, &blink_var);
   // destroy the task
   destroyTask(blink_id);
 }

See Also

createTask(), destroyTask(), getTaskId(), getTaskNextExec(), getTaskPeriod(), getTaskState(), getTaskVar(), setTaskPeriod(), setTaskState(), setTaskVar(), startTaskAt(),