- Main Page
- Related Pages
- Data Structures
- Files

# cc.h

Go to the documentation of this file.

    00001 /*This file has been prepared for Doxygen automatic documentation generation.*/
    00015 /* Copyright (c) 2009 Atmel Corporation. All rights reserved.
    00016  *
    00017  * Redistribution and use in source and binary forms, with or without
    00018  * modification, are permitted provided that the following conditions are met:
    00019  *
    00020  * 1. Redistributions of source code must retain the above copyright notice, this
    00021  * list of conditions and the following disclaimer.
    00022  *
    00023  * 2. Redistributions in binary form must reproduce the above copyright notice,
    00024  * this list of conditions and the following disclaimer in the documentation
    00025  * and/or other materials provided with the distribution.
    00026  *
    00027  * 3. The name of Atmel may not be used to endorse or promote products derived
    00028  * from this software without specific prior written permission.
    00029  *
    00030  * 4. This software may only be redistributed and used in connection with an Atmel
    00031  * AVR product.
    00032  *
    00033  * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
    00034  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    00035  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
    00036  * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
    00037  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
    00038  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
    00039  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    00040  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    00041  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    00042  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
    00043  *
    00044  */
    00045
    00046 #ifndef __ARCH_CC_H__
    00047 #define __ARCH_CC_H__
    00048
    00049 /* Include some files for defining library routines */
    00050 /*#include <string.h>
    00051 #include <sys/time.h>*/
    00052
    00053 /* Define platform endianness */
    00054 #ifndef BYTE_ORDER
    00055 #define BYTE_ORDER BIG_ENDIAN
    00056 #endif /* BYTE_ORDER */
    00057
    00058 /* Define generic types used in lwIP */
    00059 typedef unsigned   char    u8_t;
    00060 typedef signed     char    s8_t;
    00061 typedef unsigned   short   u16_t;
    00062 typedef signed     short   s16_t;
    00063 typedef unsigned   long    u32_t;
    00064 typedef signed     long    s32_t;
    00065
    00066 typedef u32_t mem_ptr_t;
    00067
    00068 /* Define (sn)printf formatters for these lwIP types */
    00069 #define U16_F "hu"
    00070 #define S16_F "hd"
    00071 #define X16_F "hx"
    00072 #define U32_F "lu"
    00073 #define S32_F "ld"
    00074 #define X32_F "lx"
    00075
    00076 /* Compiler hints for packing structures */
    00077 #define PACK_STRUCT_FIELD(x) x
    00078
    00079 #if __GNUC__
    00080 #define PACK_STRUCT_STRUCT __attribute__ ((__packed__))
    00081 #elif __ICCAVR32__
    00082 #define PACK_STRUCT_STRUCT
    00083 #endif
    00084
    00085 #if __GNUC__
    00086 #define PACK_STRUCT_BEGIN
    00087 #elif __ICCAVR32__
    00088 #define PACK_STRUCT_BEGIN _Pragma("pack(1)")
    00089 #endif
    00090
    00091 #if __GNUC__
    00092 #define PACK_STRUCT_END
    00093 #elif __ICCAVR32__
    00094 #define PACK_STRUCT_END _Pragma("pack()")
    00095 #endif
    00096
    00097
    00098 /* Plaform specific diagnostic output */
    00099
    00100 /* Include some files for defining library routines */
    00101 #include <stdlib.h>
    00102 #include <string.h>
    00103 #include <stdarg.h>
    00104 #include "print_funcs.h"
    00105 //extern void print_lwip_dbg( const char *format, ... )
    00106 //#define LWIP_PLATFORM_DIAG(x) do { print_lwip_dbg x; } while(1)
    00107 #define LWIP_PLATFORM_DIAG(x) { char tmpbuf[150];sprintf(tmpbuf,x);print_dbg(tmpbuf);}
    00108 //#define LWIP_PLATFORM_DIAG(x)
    00109
    00110 #define LWIP_PLATFORM_ASSERT(x) do {/*printf("Assertion \"%s\" failed at line %d in %s\n", x, __LINE__, __FILE__); \
    00111                                       fflush(NULL); abort();*/} while(1)
    00112
    00113 #define LWIP_PROVIDE_ERRNO // Make lwip/arch.h define the codes which are used throughout.
    00114
    00115 #endif /* __ARCH_CC_H__ */