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