Dependencies: FatFileSystem mbed WeatherMeters SDFileSystem
NetStack/lwip/core/sys.c@0:1a61c61d0845, 2012-04-03 (annotated)
- Committer:
- dcoban
- Date:
- Tue Apr 03 18:43:13 2012 +0000
- Revision:
- 0:1a61c61d0845
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dcoban | 0:1a61c61d0845 | 1 | /** |
dcoban | 0:1a61c61d0845 | 2 | * @file |
dcoban | 0:1a61c61d0845 | 3 | * lwIP Operating System abstraction |
dcoban | 0:1a61c61d0845 | 4 | * |
dcoban | 0:1a61c61d0845 | 5 | */ |
dcoban | 0:1a61c61d0845 | 6 | |
dcoban | 0:1a61c61d0845 | 7 | /* |
dcoban | 0:1a61c61d0845 | 8 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. |
dcoban | 0:1a61c61d0845 | 9 | * All rights reserved. |
dcoban | 0:1a61c61d0845 | 10 | * |
dcoban | 0:1a61c61d0845 | 11 | * Redistribution and use in source and binary forms, with or without modification, |
dcoban | 0:1a61c61d0845 | 12 | * are permitted provided that the following conditions are met: |
dcoban | 0:1a61c61d0845 | 13 | * |
dcoban | 0:1a61c61d0845 | 14 | * 1. Redistributions of source code must retain the above copyright notice, |
dcoban | 0:1a61c61d0845 | 15 | * this list of conditions and the following disclaimer. |
dcoban | 0:1a61c61d0845 | 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
dcoban | 0:1a61c61d0845 | 17 | * this list of conditions and the following disclaimer in the documentation |
dcoban | 0:1a61c61d0845 | 18 | * and/or other materials provided with the distribution. |
dcoban | 0:1a61c61d0845 | 19 | * 3. The name of the author may not be used to endorse or promote products |
dcoban | 0:1a61c61d0845 | 20 | * derived from this software without specific prior written permission. |
dcoban | 0:1a61c61d0845 | 21 | * |
dcoban | 0:1a61c61d0845 | 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED |
dcoban | 0:1a61c61d0845 | 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
dcoban | 0:1a61c61d0845 | 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT |
dcoban | 0:1a61c61d0845 | 25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
dcoban | 0:1a61c61d0845 | 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT |
dcoban | 0:1a61c61d0845 | 27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
dcoban | 0:1a61c61d0845 | 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
dcoban | 0:1a61c61d0845 | 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
dcoban | 0:1a61c61d0845 | 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY |
dcoban | 0:1a61c61d0845 | 31 | * OF SUCH DAMAGE. |
dcoban | 0:1a61c61d0845 | 32 | * |
dcoban | 0:1a61c61d0845 | 33 | * This file is part of the lwIP TCP/IP stack. |
dcoban | 0:1a61c61d0845 | 34 | * |
dcoban | 0:1a61c61d0845 | 35 | * Author: Adam Dunkels <adam@sics.se> |
dcoban | 0:1a61c61d0845 | 36 | * |
dcoban | 0:1a61c61d0845 | 37 | */ |
dcoban | 0:1a61c61d0845 | 38 | |
dcoban | 0:1a61c61d0845 | 39 | #include "lwip/opt.h" |
dcoban | 0:1a61c61d0845 | 40 | |
dcoban | 0:1a61c61d0845 | 41 | #include "lwip/sys.h" |
dcoban | 0:1a61c61d0845 | 42 | |
dcoban | 0:1a61c61d0845 | 43 | /* Most of the functions defined in sys.h must be implemented in the |
dcoban | 0:1a61c61d0845 | 44 | * architecture-dependent file sys_arch.c */ |
dcoban | 0:1a61c61d0845 | 45 | |
dcoban | 0:1a61c61d0845 | 46 | #if !NO_SYS |
dcoban | 0:1a61c61d0845 | 47 | |
dcoban | 0:1a61c61d0845 | 48 | /** |
dcoban | 0:1a61c61d0845 | 49 | * Sleep for some ms. Timeouts are NOT processed while sleeping. |
dcoban | 0:1a61c61d0845 | 50 | * |
dcoban | 0:1a61c61d0845 | 51 | * @param ms number of milliseconds to sleep |
dcoban | 0:1a61c61d0845 | 52 | */ |
dcoban | 0:1a61c61d0845 | 53 | void |
dcoban | 0:1a61c61d0845 | 54 | sys_msleep(u32_t ms) |
dcoban | 0:1a61c61d0845 | 55 | { |
dcoban | 0:1a61c61d0845 | 56 | if (ms > 0) { |
dcoban | 0:1a61c61d0845 | 57 | sys_sem_t delaysem; |
dcoban | 0:1a61c61d0845 | 58 | err_t err = sys_sem_new(&delaysem, 0); |
dcoban | 0:1a61c61d0845 | 59 | if (err == ERR_OK) { |
dcoban | 0:1a61c61d0845 | 60 | sys_arch_sem_wait(&delaysem, ms); |
dcoban | 0:1a61c61d0845 | 61 | sys_sem_free(&delaysem); |
dcoban | 0:1a61c61d0845 | 62 | } |
dcoban | 0:1a61c61d0845 | 63 | } |
dcoban | 0:1a61c61d0845 | 64 | } |
dcoban | 0:1a61c61d0845 | 65 | |
dcoban | 0:1a61c61d0845 | 66 | #endif /* !NO_SYS */ |