NetTribute library with debug turned on in FShandler Donatien Garner -> Segundo Equipo -> this version

Committer:
hexley
Date:
Fri Nov 19 01:54:45 2010 +0000
Revision:
0:281d6ff68967

        

Who changed what in which revision?

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