*** stock_iot-lab_M3/openwsn/opentimers.h Thu Apr 24 11:01:37 2014 --- riot-openwsn-wip/openwsn/opentimers.h Thu Apr 24 16:53:30 2014 *************** *** 9,14 **** --- 9,24 ---- #include "openwsn.h" + #include "hwtimer_cpu.h" + #include "periph_conf.h" + + /** + \addtogroup drivers + \{ + \addtogroup OpenTimers + \{ + */ + //=========================== define ========================================== /// Maximum number of timers that can run concurrently *************** *** 22,27 **** --- 32,39 ---- typedef void (*opentimers_cbt)(void); + #define OPENTIMERS_HWTIMER_ID (1) + //=========================== typedef ========================================= typedef enum { *************** *** 46,54 **** bool hasExpired; // whether the callback has to be called } opentimers_t; //=========================== prototypes ====================================== ! void opentimers_init(); opentimer_id_t opentimers_start(uint32_t duration, timer_type_t type, time_type_t timetype, --- 58,74 ---- bool hasExpired; // whether the callback has to be called } opentimers_t; + //=========================== module variables ================================ + + typedef struct { + opentimers_t timersBuf[MAX_NUM_TIMERS]; + bool running; + PORT_TIMER_WIDTH currentTimeout; // current timeout, in ticks + } opentimers_vars_t; + //=========================== prototypes ====================================== ! void opentimers_init(void); opentimer_id_t opentimers_start(uint32_t duration, timer_type_t type, time_type_t timetype, *************** *** 57,60 **** --- 77,87 ---- void opentimers_stop(opentimer_id_t id); void opentimers_restart(opentimer_id_t id); + void opentimers_sleepTimeCompesation(uint16_t sleepTime); + + /** + \} + \} + */ + #endif