int getTaskId(taskFunc task)
task | : | Pointer to the task function |
---|
This function returns the task identifier of the task associated with the specified task function. It returns -1 if no such task is defined. If multiple tasks are using the same task function, it returns the first one found.
If the specified task exists, the task id is returned. If the task can’t be found, the value -1 is returned.
The Task Management Functions are specific to ChipKit and exceed the Arduino 1.6.x specification.
int blink_id;
int test_id;
unsigned long blink_var;
void blink_task(int id, void * tptr) {
digitalWrite(led, !digitalRead(led); // Toggle pin state
}
void setup() {
pinMode(led, OUTPUT);
blink_id = createTask(blink_task, 200, TASK_ENABLE, &blink_var);
test_id = getTaskId( blink_task);
}
createTask(), destroyTask(), getTaskId(), getTaskNextExec(), getTaskPeriod(), getTaskState(), getTaskVar(), setTaskPeriod(), setTaskState(), setTaskVar(), startTaskAt(),