Ethernetwebsoc
Dependencies: C12832_lcd LM75B WebSocketClient mbed-rtos mbed Socket lwip-eth lwip-sys lwip
EthernetInterface/lwip/include/lwip/timers.h@0:0ed2a7c7190c, 2013-05-31 (annotated)
- Committer:
- GordonSin
- Date:
- Fri May 31 04:09:54 2013 +0000
- Revision:
- 0:0ed2a7c7190c
31/5/2013;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
GordonSin | 0:0ed2a7c7190c | 1 | /* |
GordonSin | 0:0ed2a7c7190c | 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. |
GordonSin | 0:0ed2a7c7190c | 3 | * All rights reserved. |
GordonSin | 0:0ed2a7c7190c | 4 | * |
GordonSin | 0:0ed2a7c7190c | 5 | * Redistribution and use in source and binary forms, with or without modification, |
GordonSin | 0:0ed2a7c7190c | 6 | * are permitted provided that the following conditions are met: |
GordonSin | 0:0ed2a7c7190c | 7 | * |
GordonSin | 0:0ed2a7c7190c | 8 | * 1. Redistributions of source code must retain the above copyright notice, |
GordonSin | 0:0ed2a7c7190c | 9 | * this list of conditions and the following disclaimer. |
GordonSin | 0:0ed2a7c7190c | 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
GordonSin | 0:0ed2a7c7190c | 11 | * this list of conditions and the following disclaimer in the documentation |
GordonSin | 0:0ed2a7c7190c | 12 | * and/or other materials provided with the distribution. |
GordonSin | 0:0ed2a7c7190c | 13 | * 3. The name of the author may not be used to endorse or promote products |
GordonSin | 0:0ed2a7c7190c | 14 | * derived from this software without specific prior written permission. |
GordonSin | 0:0ed2a7c7190c | 15 | * |
GordonSin | 0:0ed2a7c7190c | 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED |
GordonSin | 0:0ed2a7c7190c | 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
GordonSin | 0:0ed2a7c7190c | 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT |
GordonSin | 0:0ed2a7c7190c | 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
GordonSin | 0:0ed2a7c7190c | 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT |
GordonSin | 0:0ed2a7c7190c | 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
GordonSin | 0:0ed2a7c7190c | 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
GordonSin | 0:0ed2a7c7190c | 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
GordonSin | 0:0ed2a7c7190c | 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY |
GordonSin | 0:0ed2a7c7190c | 25 | * OF SUCH DAMAGE. |
GordonSin | 0:0ed2a7c7190c | 26 | * |
GordonSin | 0:0ed2a7c7190c | 27 | * This file is part of the lwIP TCP/IP stack. |
GordonSin | 0:0ed2a7c7190c | 28 | * |
GordonSin | 0:0ed2a7c7190c | 29 | * Author: Adam Dunkels <adam@sics.se> |
GordonSin | 0:0ed2a7c7190c | 30 | * Simon Goldschmidt |
GordonSin | 0:0ed2a7c7190c | 31 | * |
GordonSin | 0:0ed2a7c7190c | 32 | */ |
GordonSin | 0:0ed2a7c7190c | 33 | #ifndef __LWIP_TIMERS_H__ |
GordonSin | 0:0ed2a7c7190c | 34 | #define __LWIP_TIMERS_H__ |
GordonSin | 0:0ed2a7c7190c | 35 | |
GordonSin | 0:0ed2a7c7190c | 36 | #include "lwip/opt.h" |
GordonSin | 0:0ed2a7c7190c | 37 | |
GordonSin | 0:0ed2a7c7190c | 38 | /* Timers are not supported when NO_SYS==1 and NO_SYS_NO_TIMERS==1 */ |
GordonSin | 0:0ed2a7c7190c | 39 | #define LWIP_TIMERS (!NO_SYS || (NO_SYS && !NO_SYS_NO_TIMERS)) |
GordonSin | 0:0ed2a7c7190c | 40 | |
GordonSin | 0:0ed2a7c7190c | 41 | #if LWIP_TIMERS |
GordonSin | 0:0ed2a7c7190c | 42 | |
GordonSin | 0:0ed2a7c7190c | 43 | #include "lwip/err.h" |
GordonSin | 0:0ed2a7c7190c | 44 | #include "lwip/sys.h" |
GordonSin | 0:0ed2a7c7190c | 45 | |
GordonSin | 0:0ed2a7c7190c | 46 | #ifdef __cplusplus |
GordonSin | 0:0ed2a7c7190c | 47 | extern "C" { |
GordonSin | 0:0ed2a7c7190c | 48 | #endif |
GordonSin | 0:0ed2a7c7190c | 49 | |
GordonSin | 0:0ed2a7c7190c | 50 | #ifndef LWIP_DEBUG_TIMERNAMES |
GordonSin | 0:0ed2a7c7190c | 51 | #ifdef LWIP_DEBUG |
GordonSin | 0:0ed2a7c7190c | 52 | #define LWIP_DEBUG_TIMERNAMES SYS_DEBUG |
GordonSin | 0:0ed2a7c7190c | 53 | #else /* LWIP_DEBUG */ |
GordonSin | 0:0ed2a7c7190c | 54 | #define LWIP_DEBUG_TIMERNAMES 0 |
GordonSin | 0:0ed2a7c7190c | 55 | #endif /* LWIP_DEBUG*/ |
GordonSin | 0:0ed2a7c7190c | 56 | #endif |
GordonSin | 0:0ed2a7c7190c | 57 | |
GordonSin | 0:0ed2a7c7190c | 58 | /** Function prototype for a timeout callback function. Register such a function |
GordonSin | 0:0ed2a7c7190c | 59 | * using sys_timeout(). |
GordonSin | 0:0ed2a7c7190c | 60 | * |
GordonSin | 0:0ed2a7c7190c | 61 | * @param arg Additional argument to pass to the function - set up by sys_timeout() |
GordonSin | 0:0ed2a7c7190c | 62 | */ |
GordonSin | 0:0ed2a7c7190c | 63 | typedef void (* sys_timeout_handler)(void *arg); |
GordonSin | 0:0ed2a7c7190c | 64 | |
GordonSin | 0:0ed2a7c7190c | 65 | struct sys_timeo { |
GordonSin | 0:0ed2a7c7190c | 66 | struct sys_timeo *next; |
GordonSin | 0:0ed2a7c7190c | 67 | u32_t time; |
GordonSin | 0:0ed2a7c7190c | 68 | sys_timeout_handler h; |
GordonSin | 0:0ed2a7c7190c | 69 | void *arg; |
GordonSin | 0:0ed2a7c7190c | 70 | #if LWIP_DEBUG_TIMERNAMES |
GordonSin | 0:0ed2a7c7190c | 71 | const char* handler_name; |
GordonSin | 0:0ed2a7c7190c | 72 | #endif /* LWIP_DEBUG_TIMERNAMES */ |
GordonSin | 0:0ed2a7c7190c | 73 | }; |
GordonSin | 0:0ed2a7c7190c | 74 | |
GordonSin | 0:0ed2a7c7190c | 75 | void sys_timeouts_init(void); |
GordonSin | 0:0ed2a7c7190c | 76 | |
GordonSin | 0:0ed2a7c7190c | 77 | #if LWIP_DEBUG_TIMERNAMES |
GordonSin | 0:0ed2a7c7190c | 78 | void sys_timeout_debug(u32_t msecs, sys_timeout_handler handler, void *arg, const char* handler_name); |
GordonSin | 0:0ed2a7c7190c | 79 | #define sys_timeout(msecs, handler, arg) sys_timeout_debug(msecs, handler, arg, #handler) |
GordonSin | 0:0ed2a7c7190c | 80 | #else /* LWIP_DEBUG_TIMERNAMES */ |
GordonSin | 0:0ed2a7c7190c | 81 | void sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg); |
GordonSin | 0:0ed2a7c7190c | 82 | #endif /* LWIP_DEBUG_TIMERNAMES */ |
GordonSin | 0:0ed2a7c7190c | 83 | |
GordonSin | 0:0ed2a7c7190c | 84 | void sys_untimeout(sys_timeout_handler handler, void *arg); |
GordonSin | 0:0ed2a7c7190c | 85 | #if NO_SYS |
GordonSin | 0:0ed2a7c7190c | 86 | void sys_check_timeouts(void); |
GordonSin | 0:0ed2a7c7190c | 87 | void sys_restart_timeouts(void); |
GordonSin | 0:0ed2a7c7190c | 88 | #else /* NO_SYS */ |
GordonSin | 0:0ed2a7c7190c | 89 | void sys_timeouts_mbox_fetch(sys_mbox_t *mbox, void **msg); |
GordonSin | 0:0ed2a7c7190c | 90 | #endif /* NO_SYS */ |
GordonSin | 0:0ed2a7c7190c | 91 | |
GordonSin | 0:0ed2a7c7190c | 92 | |
GordonSin | 0:0ed2a7c7190c | 93 | #ifdef __cplusplus |
GordonSin | 0:0ed2a7c7190c | 94 | } |
GordonSin | 0:0ed2a7c7190c | 95 | #endif |
GordonSin | 0:0ed2a7c7190c | 96 | |
GordonSin | 0:0ed2a7c7190c | 97 | #endif /* LWIP_TIMERS */ |
GordonSin | 0:0ed2a7c7190c | 98 | #endif /* __LWIP_TIMERS_H__ */ |