OpenWSN Firmware
opentimers.c File Reference
#include "openwsn.h"
#include "opentimers.h"
#include "bsp_timer.h"
#include "leds.h"

Functions

void opentimers_timer_callback ()
 Function called when the hardware timer expires. More...
 
void opentimers_init ()
 Initialize this module. More...
 
opentimer_id_t opentimers_start (uint32_t duration, timer_type_t type, time_type_t timetype, opentimers_cbt callback)
 Start a timer. More...
 
void opentimers_setPeriod (opentimer_id_t id, time_type_t timetype, uint32_t newDuration)
 Replace the period of a running timer. More...
 
void opentimers_stop (opentimer_id_t id)
 Stop a running timer. More...
 
void opentimers_restart (opentimer_id_t id)
 Restart a stop timer. More...
 
void opentimers_sleepTimeCompesation (uint16_t sleepTime)
 

Variables

opentimers_vars_t opentimers_vars
 Definition of the "opentimers" driver. More...
 

Function Documentation

void opentimers_timer_callback ( )

Function called when the hardware timer expires.

Executed in interrupt mode.

This function maps the expiration event to possibly multiple timers, calls the corresponding callback(s), and restarts the hardware timer with the next timer to expire.

Variable Documentation

opentimers_vars_t opentimers_vars

Definition of the "opentimers" driver.

This driver uses a single hardware timer, which it virtualizes to support at most MAX_NUM_TIMERS timers.

Author
Xavi Vilajosana xvila.nosp@m.josa.nosp@m.na@ee.nosp@m.cs.b.nosp@m.erkel.nosp@m.ey.e.nosp@m.du, March 2012.