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