GetTaskPeriod

From chipKIT
Jump to: navigation, search

Synopsis

unsigned long getTaskPeriod(int id)  

Parameter

id  : Task identifier for the task

Description

This function returns the current scheduling interval for the specified task. The scheduling interval is the time in milliseconds between successive executions of the task function.

Return Value

Returns task scheduling interval in milliseconds.

Conforming To

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

Example

int blink_id;
unsigned long blink_period;
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);
  blink_period = getTaskPeriod( blink_id);
}

See Also

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