00001 /** 00002 * \defgroup clock Clock library 00003 * @{ 00004 * 00005 * The clock library is the interface between Contiki and the platform 00006 * specific clock functionality. The clock library performs a single 00007 * function: measuring time. Additionally, the clock library provides 00008 * a macro, CLOCK_SECOND, which corresponds to one second of system 00009 * time. 00010 * 00011 * \note The clock library need in many cases not be used 00012 * directly. Rather, the \ref timer "timer library" should be used. 00013 * 00014 * \sa \ref timer "Timer library" 00015 */ 00016 00017 /* 00018 * Copyright (c) 2004, Swedish Institute of Computer Science. 00019 * All rights reserved. 00020 * 00021 * Redistribution and use in source and binary forms, with or without 00022 * modification, are permitted provided that the following conditions 00023 * are met: 00024 * 1. Redistributions of source code must retain the above copyright 00025 * notice, this list of conditions and the following disclaimer. 00026 * 2. Redistributions in binary form must reproduce the above copyright 00027 * notice, this list of conditions and the following disclaimer in the 00028 * documentation and/or other materials provided with the distribution. 00029 * 3. Neither the name of the Institute nor the names of its contributors 00030 * may be used to endorse or promote products derived from this software 00031 * without specific prior written permission. 00032 * 00033 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 00034 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00035 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00036 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 00037 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00038 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00039 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00040 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00041 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00042 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00043 * SUCH DAMAGE. 00044 * 00045 * This file is part of the Contiki operating system. 00046 * 00047 * Author: Adam Dunkels <adam@sics.se> 00048 * 00049 * $Id: clock.h,v 1.2 2005/05/18 18:43:36 adam Exp $ 00050 */ 00051 #ifndef __CLOCK_H__ 00052 #define __CLOCK_H__ 00053 00054 #include "clock-conf.h" 00055 00056 /** 00057 * Initialize the clock library. 00058 * 00059 * This function initializes the clock library and should be called 00060 * from the main() function of the system. 00061 * 00062 */ 00063 void clock_init(void); 00064 00065 /** 00066 * Get the current clock time. 00067 * 00068 * This function returns the current system clock time. 00069 * 00070 * \return The current clock time, measured in system ticks. 00071 */ 00072 clock_time_t clock_time(void); 00073 00074 /** 00075 * A second, measured in system clock time. 00076 * 00077 * \hideinitializer 00078 */ 00079 #ifdef CLOCK_CONF_SECOND 00080 #define CLOCK_SECOND CLOCK_CONF_SECOND 00081 #else 00082 #define CLOCK_SECOND (clock_time_t)32 00083 #endif 00084 00085 #endif /* __CLOCK_H__ */
1.3.6