This library is stripped down version of NetServices library. HTTP server and client function is NOT supported.

Dependents:   imu-daq-eth

Committer:
idinor
Date:
Wed Jul 20 11:45:39 2011 +0000
Revision:
0:dcf3c92487ca

        

Who changed what in which revision?

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