chipKIT® Development Platform

Inspired by Arduino™

Last edit: 2021-03-21 22:34 by Majenko

DestroyTask

  1. Synopsis

  2. Parameter

  3. Description

  4. Return Value

  5. Conforming To

  6. Example

  7. See Also

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(),