Zigbee Protocol Controller 1.6.0
clock.h
Go to the documentation of this file.
1
24/*
25 * Copyright (c) 2004, Swedish Institute of Computer Science.
26 * All rights reserved.
27 *
28 * Redistribution and use in source and binary forms, with or without
29 * modification, are permitted provided that the following conditions
30 * are met:
31 * 1. Redistributions of source code must retain the above copyright
32 * notice, this list of conditions and the following disclaimer.
33 * 2. Redistributions in binary form must reproduce the above copyright
34 * notice, this list of conditions and the following disclaimer in the
35 * documentation and/or other materials provided with the distribution.
36 * 3. Neither the name of the Institute nor the names of its contributors
37 * may be used to endorse or promote products derived from this software
38 * without specific prior written permission.
39 *
40 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
41 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
43 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
44 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
45 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
46 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
48 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
49 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
50 * SUCH DAMAGE.
51 *
52 * This file is part of the Contiki operating system.
53 *
54 * Author: Adam Dunkels <adam@sics.se>
55 *
56 * $Id: clock.h,v 1.11 2009/01/24 15:20:11 adamdunkels Exp $
57 */
58#ifndef __CLOCK_H__
59#define __CLOCK_H__
60
61#include "contiki-conf.h"
62
63#ifdef __cplusplus
64extern "C" {
65#endif
66
67#if 0 /* XXX problems with signedness and use in timer_expired(). #if:ed it out for now. */
76#define CLOCK_LT(a, b) ((clock_time_t)((a) - (b)) < ((clock_time_t)(~((clock_time_t)0)) >> 1))
77#endif /* 0 */
78
90
98void clock_init(void);
99
107#ifdef ZIPGW
108unsigned long clock_time(void);
109#else
111#endif
112
121void clock_delay(unsigned int d);
122
128#ifdef CLOCK_CONF_SECOND
129#define CLOCK_SECOND CLOCK_CONF_SECOND
130#else
131#define CLOCK_SECOND (clock_time_t)32
132#endif
133
135unsigned short clock_fine(void);
136
137CCIF unsigned long clock_seconds(void);
138
139#ifdef __cplusplus
140}
141#endif
142
143#endif /* __CLOCK_H__ */
144
uint32_t clock_time_t
Definition: contiki-conf.h:31
#define CCIF
Definition: contiki-conf.h:24
CCIF clock_time_t clock_time(void)
Definition: clock.c:75
void clock_init(void)
CCIF unsigned long clock_seconds(void)
Definition: clock.c:83
int clock_lte(clock_time_t t1, clock_time_t t2)
Definition: clock.c:94
void clock_delay(unsigned int d)
Definition: clock.c:106
unsigned short clock_fine(void)
int clock_fine_max(void)