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

The real-time timer is a high resolution, high priority timer which is used for controlling the rate at which the stepper motors are stepped. More...

#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  realtime_task_t
 Structure for tasks that can be scheduled with the real-time timer. More...

Defines

#define RTTIMER_TICKS_PER_MIN   (F_CPU/8L*60L)
 The number of ticks the real-time timer takes in one minute.
#define RTTIMER_SUCCESS   0
 'Success' return value.
#define RTTIMER_BUSY   -1
 'Busy' return value.
#define RTTIMER_NOT_RUNNING   -2
 'Not running' return value.

Functions

void rttimer_init (void)
 Initializes the real-time timer component.
int rttimer_schedule_ticks (realtime_task_t *t, uint16_t ticks)
 Schedules a task to be executed after a specified number of ticks.
int rttimer_cancel (void)
 Cancels the currently scheduled task.

Detailed Description

The real-time timer is a high resolution, high priority timer which is used for controlling the rate at which the stepper motors are stepped.

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

Definition in file realtime_timer.h.


Function Documentation

int rttimer_cancel ( void  )

Cancels the currently scheduled task.

Returns:
RTTIMER_SUCCESS on success or RTTIMER_NOT_RUNNING if the timer does not currently have any task scheduled.

Definition at line 153 of file realtime_timer.c.

void rttimer_init ( void  )

Initializes the real-time timer component.

This should only be called once on boot.

Definition at line 121 of file realtime_timer.c.

int rttimer_schedule_ticks ( realtime_task_t t,
uint16_t  ticks 
)

Schedules a task to be executed after a specified number of ticks.

Parameters:
tpointer to the task to be executed
ticksthe number of ticks to wait before executing the task
Returns:
RTTIMER_SUCCESS on success or RTTIMER_BUSY if the timer already has a scheduled task to be executed.

Definition at line 138 of file realtime_timer.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines