void destroyTask(int id)
id | : | Task identifier for the task to destroy |
---|
This function removes the specified task from the set of defined tasks.
None
The Task Management Functions are specific to ChipKit and exceed the Arduino 1.6.x specification.
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);
}
createTask(), destroyTask(), getTaskId(), getTaskNextExec(), getTaskPeriod(), getTaskState(), getTaskVar(), setTaskPeriod(), setTaskState(), setTaskVar(), startTaskAt(),