Fork of Smoothie to port to mbed non-LPC targets.
Fork of Smoothie by
libs/Network/uip/uip/clock.h@2:1df0b61d3b5a, 2014-02-28 (annotated)
- Committer:
- Michael J. Spencer
- Date:
- Fri Feb 28 18:52:52 2014 -0800
- Revision:
- 2:1df0b61d3b5a
Update to latest Smoothie.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Michael J. Spencer |
2:1df0b61d3b5a | 1 | /** |
Michael J. Spencer |
2:1df0b61d3b5a | 2 | * \defgroup clock Clock interface |
Michael J. Spencer |
2:1df0b61d3b5a | 3 | * |
Michael J. Spencer |
2:1df0b61d3b5a | 4 | * The clock interface is the interface between the \ref timer "timer library" |
Michael J. Spencer |
2:1df0b61d3b5a | 5 | * and the platform specific clock functionality. The clock |
Michael J. Spencer |
2:1df0b61d3b5a | 6 | * interface must be implemented for each platform that uses the \ref |
Michael J. Spencer |
2:1df0b61d3b5a | 7 | * timer "timer library". |
Michael J. Spencer |
2:1df0b61d3b5a | 8 | * |
Michael J. Spencer |
2:1df0b61d3b5a | 9 | * The clock interface does only one this: it measures time. The clock |
Michael J. Spencer |
2:1df0b61d3b5a | 10 | * interface provides a macro, CLOCK_SECOND, which corresponds to one |
Michael J. Spencer |
2:1df0b61d3b5a | 11 | * second of system time. |
Michael J. Spencer |
2:1df0b61d3b5a | 12 | * |
Michael J. Spencer |
2:1df0b61d3b5a | 13 | * \sa \ref timer "Timer library" |
Michael J. Spencer |
2:1df0b61d3b5a | 14 | * |
Michael J. Spencer |
2:1df0b61d3b5a | 15 | * @{ |
Michael J. Spencer |
2:1df0b61d3b5a | 16 | */ |
Michael J. Spencer |
2:1df0b61d3b5a | 17 | |
Michael J. Spencer |
2:1df0b61d3b5a | 18 | /* |
Michael J. Spencer |
2:1df0b61d3b5a | 19 | * Copyright (c) 2004, Swedish Institute of Computer Science. |
Michael J. Spencer |
2:1df0b61d3b5a | 20 | * All rights reserved. |
Michael J. Spencer |
2:1df0b61d3b5a | 21 | * |
Michael J. Spencer |
2:1df0b61d3b5a | 22 | * Redistribution and use in source and binary forms, with or without |
Michael J. Spencer |
2:1df0b61d3b5a | 23 | * modification, are permitted provided that the following conditions |
Michael J. Spencer |
2:1df0b61d3b5a | 24 | * are met: |
Michael J. Spencer |
2:1df0b61d3b5a | 25 | * 1. Redistributions of source code must retain the above copyright |
Michael J. Spencer |
2:1df0b61d3b5a | 26 | * notice, this list of conditions and the following disclaimer. |
Michael J. Spencer |
2:1df0b61d3b5a | 27 | * 2. Redistributions in binary form must reproduce the above copyright |
Michael J. Spencer |
2:1df0b61d3b5a | 28 | * notice, this list of conditions and the following disclaimer in the |
Michael J. Spencer |
2:1df0b61d3b5a | 29 | * documentation and/or other materials provided with the distribution. |
Michael J. Spencer |
2:1df0b61d3b5a | 30 | * 3. Neither the name of the Institute nor the names of its contributors |
Michael J. Spencer |
2:1df0b61d3b5a | 31 | * may be used to endorse or promote products derived from this software |
Michael J. Spencer |
2:1df0b61d3b5a | 32 | * without specific prior written permission. |
Michael J. Spencer |
2:1df0b61d3b5a | 33 | * |
Michael J. Spencer |
2:1df0b61d3b5a | 34 | * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND |
Michael J. Spencer |
2:1df0b61d3b5a | 35 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
Michael J. Spencer |
2:1df0b61d3b5a | 36 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
Michael J. Spencer |
2:1df0b61d3b5a | 37 | * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE |
Michael J. Spencer |
2:1df0b61d3b5a | 38 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
Michael J. Spencer |
2:1df0b61d3b5a | 39 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
Michael J. Spencer |
2:1df0b61d3b5a | 40 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
Michael J. Spencer |
2:1df0b61d3b5a | 41 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
Michael J. Spencer |
2:1df0b61d3b5a | 42 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
Michael J. Spencer |
2:1df0b61d3b5a | 43 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
Michael J. Spencer |
2:1df0b61d3b5a | 44 | * SUCH DAMAGE. |
Michael J. Spencer |
2:1df0b61d3b5a | 45 | * |
Michael J. Spencer |
2:1df0b61d3b5a | 46 | * This file is part of the uIP TCP/IP stack |
Michael J. Spencer |
2:1df0b61d3b5a | 47 | * |
Michael J. Spencer |
2:1df0b61d3b5a | 48 | * Author: Adam Dunkels <adam@sics.se> |
Michael J. Spencer |
2:1df0b61d3b5a | 49 | * |
Michael J. Spencer |
2:1df0b61d3b5a | 50 | * $Id: clock.h,v 1.3 2006/06/11 21:46:39 adam Exp $ |
Michael J. Spencer |
2:1df0b61d3b5a | 51 | */ |
Michael J. Spencer |
2:1df0b61d3b5a | 52 | #ifndef __CLOCK_H__ |
Michael J. Spencer |
2:1df0b61d3b5a | 53 | #define __CLOCK_H__ |
Michael J. Spencer |
2:1df0b61d3b5a | 54 | |
Michael J. Spencer |
2:1df0b61d3b5a | 55 | #include "clock-arch.h" |
Michael J. Spencer |
2:1df0b61d3b5a | 56 | |
Michael J. Spencer |
2:1df0b61d3b5a | 57 | #ifdef __cplusplus |
Michael J. Spencer |
2:1df0b61d3b5a | 58 | extern "C" { |
Michael J. Spencer |
2:1df0b61d3b5a | 59 | #endif |
Michael J. Spencer |
2:1df0b61d3b5a | 60 | |
Michael J. Spencer |
2:1df0b61d3b5a | 61 | /** |
Michael J. Spencer |
2:1df0b61d3b5a | 62 | * Initialize the clock library. |
Michael J. Spencer |
2:1df0b61d3b5a | 63 | * |
Michael J. Spencer |
2:1df0b61d3b5a | 64 | * This function initializes the clock library and should be called |
Michael J. Spencer |
2:1df0b61d3b5a | 65 | * from the main() function of the system. |
Michael J. Spencer |
2:1df0b61d3b5a | 66 | * |
Michael J. Spencer |
2:1df0b61d3b5a | 67 | */ |
Michael J. Spencer |
2:1df0b61d3b5a | 68 | void clock_init(void); |
Michael J. Spencer |
2:1df0b61d3b5a | 69 | |
Michael J. Spencer |
2:1df0b61d3b5a | 70 | /** |
Michael J. Spencer |
2:1df0b61d3b5a | 71 | * Get the current clock time. |
Michael J. Spencer |
2:1df0b61d3b5a | 72 | * |
Michael J. Spencer |
2:1df0b61d3b5a | 73 | * This function returns the current system clock time. |
Michael J. Spencer |
2:1df0b61d3b5a | 74 | * |
Michael J. Spencer |
2:1df0b61d3b5a | 75 | * \return The current clock time, measured in system ticks. |
Michael J. Spencer |
2:1df0b61d3b5a | 76 | */ |
Michael J. Spencer |
2:1df0b61d3b5a | 77 | clock_time_t clock_time(void); |
Michael J. Spencer |
2:1df0b61d3b5a | 78 | |
Michael J. Spencer |
2:1df0b61d3b5a | 79 | #ifdef __cplusplus |
Michael J. Spencer |
2:1df0b61d3b5a | 80 | } |
Michael J. Spencer |
2:1df0b61d3b5a | 81 | #endif |
Michael J. Spencer |
2:1df0b61d3b5a | 82 | /** |
Michael J. Spencer |
2:1df0b61d3b5a | 83 | * A second, measured in system clock time. |
Michael J. Spencer |
2:1df0b61d3b5a | 84 | * |
Michael J. Spencer |
2:1df0b61d3b5a | 85 | * \hideinitializer |
Michael J. Spencer |
2:1df0b61d3b5a | 86 | */ |
Michael J. Spencer |
2:1df0b61d3b5a | 87 | #ifdef CLOCK_CONF_SECOND |
Michael J. Spencer |
2:1df0b61d3b5a | 88 | #define CLOCK_SECOND CLOCK_CONF_SECOND |
Michael J. Spencer |
2:1df0b61d3b5a | 89 | #else |
Michael J. Spencer |
2:1df0b61d3b5a | 90 | #define CLOCK_SECOND (clock_time_t)32 |
Michael J. Spencer |
2:1df0b61d3b5a | 91 | #endif |
Michael J. Spencer |
2:1df0b61d3b5a | 92 | |
Michael J. Spencer |
2:1df0b61d3b5a | 93 | #endif /* __CLOCK_H__ */ |
Michael J. Spencer |
2:1df0b61d3b5a | 94 | |
Michael J. Spencer |
2:1df0b61d3b5a | 95 | /** @} */ |