yarf 0.1
Yet Another RepRap Firmware
Data Structures | Typedefs | Functions
src/scheduling/periodic.h File Reference

The periodic scheduler allows tasks to be executed at periodic intervals. More...

Go to the source code of this file.

Data Structures

struct  periodic_task
 Task that can be scheduled by the periodic scheduler. More...

Typedefs

typedef struct periodic_task periodic_task_t
 Task that can be scheduled by the periodic scheduler.

Functions

void periodic_init (void)
 Initializes the periodic scheduler.
void periodic_task_set (periodic_task_t *task, void(*f)(void), unsigned long ms)
 Initializes a periodic task to execute a given function at constant intervals of a given number of milliseconds.
void periodic_add (periodic_task_t *task)
 Adds a periodic task to the list of tasks to execute.
void periodic_remove (periodic_task_t *task)
 Removes a periodic task from the list of tasks to execute.

Detailed Description

The periodic scheduler allows tasks to be executed at periodic intervals.

Author:
Pieter Agten (pieter.agten@gmail.com)
Date:
30 okt 2011

Definition in file periodic.h.


Function Documentation

void periodic_add ( periodic_task_t task)

Adds a periodic task to the list of tasks to execute.

After calling this function for a specific task, that task will be executed at its corresponding interval.

Parameters:
taskpointer to the periodic task to add
See also:
periodic_task_remove
periodic_task_set

Definition at line 62 of file periodic.c.

void periodic_remove ( periodic_task_t task)

Removes a periodic task from the list of tasks to execute.

After calling this function for a specific task, that task will no longer be executed by the periodic scheduler.

Parameters:
taskpointer to the periodic task to remove
See also:
periodic_task_add

Definition at line 72 of file periodic.c.

void periodic_task_set ( periodic_task_t task,
void(*)(void)  f,
unsigned long  ms 
)

Initializes a periodic task to execute a given function at constant intervals of a given number of milliseconds.

Parameters:
taskpointer to the periodic task structure to initialize
fpointer to the function to execute when the periodic task needs to run
msnumber of milliseconds in between the periodic executions of the task
Note:
This only initializes a periodic task structure but does not add it to periodic scheduler's list of periodic tasks to execute.
See also:
periodic_add

Definition at line 53 of file periodic.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines