Dependencies:   FatFileSystem mbed WeatherMeters SDFileSystem

Committer:
dcoban
Date:
Tue Apr 03 18:43:13 2012 +0000
Revision:
0:1a61c61d0845

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dcoban 0:1a61c61d0845 1 /*
dcoban 0:1a61c61d0845 2 * Author: Adam Dunkels <adam@sics.se>
dcoban 0:1a61c61d0845 3 *
dcoban 0:1a61c61d0845 4 */
dcoban 0:1a61c61d0845 5 #ifndef __LWIP_ARCH_CC_H__
dcoban 0:1a61c61d0845 6 #define __LWIP_ARCH_CC_H__
dcoban 0:1a61c61d0845 7 #include <mbed.h>
dcoban 0:1a61c61d0845 8
dcoban 0:1a61c61d0845 9 #define LITTLE_ENDIAN 1234
dcoban 0:1a61c61d0845 10
dcoban 0:1a61c61d0845 11 #define BYTE_ORDER LITTLE_ENDIAN
dcoban 0:1a61c61d0845 12
dcoban 0:1a61c61d0845 13 typedef unsigned char u8_t;
dcoban 0:1a61c61d0845 14 typedef signed char s8_t;
dcoban 0:1a61c61d0845 15 typedef unsigned short u16_t;
dcoban 0:1a61c61d0845 16 typedef signed short s16_t;
dcoban 0:1a61c61d0845 17 typedef unsigned int u32_t;
dcoban 0:1a61c61d0845 18 typedef signed int s32_t;
dcoban 0:1a61c61d0845 19 typedef unsigned int mem_ptr_t;
dcoban 0:1a61c61d0845 20
dcoban 0:1a61c61d0845 21 #ifndef NULL
dcoban 0:1a61c61d0845 22 #define NULL 0
dcoban 0:1a61c61d0845 23 #endif
dcoban 0:1a61c61d0845 24
dcoban 0:1a61c61d0845 25 #ifndef TRUE
dcoban 0:1a61c61d0845 26 #define TRUE 1
dcoban 0:1a61c61d0845 27 #endif
dcoban 0:1a61c61d0845 28
dcoban 0:1a61c61d0845 29 #ifndef FALSE
dcoban 0:1a61c61d0845 30 #define FALSE 0
dcoban 0:1a61c61d0845 31 #endif
dcoban 0:1a61c61d0845 32
dcoban 0:1a61c61d0845 33 #define LWIP_RAND rand
dcoban 0:1a61c61d0845 34
dcoban 0:1a61c61d0845 35 #define LWIP_PLATFORM_DIAG(x) printf x
dcoban 0:1a61c61d0845 36 #define LWIP_PLATFORM_ASSERT(x) error(x)
dcoban 0:1a61c61d0845 37
dcoban 0:1a61c61d0845 38 #define LWIP_PROVIDE_ERRNO
dcoban 0:1a61c61d0845 39
dcoban 0:1a61c61d0845 40 #ifdef __GNUC__
dcoban 0:1a61c61d0845 41 /* printf() format specifiers used by GCC. */
dcoban 0:1a61c61d0845 42 #define U16_F "hu"
dcoban 0:1a61c61d0845 43 #define S16_F "hd"
dcoban 0:1a61c61d0845 44 #define X16_F "hx"
dcoban 0:1a61c61d0845 45 #define U32_F "u"
dcoban 0:1a61c61d0845 46 #define S32_F "d"
dcoban 0:1a61c61d0845 47 #define X32_F "x"
dcoban 0:1a61c61d0845 48 #else /* !__GNUC__ */
dcoban 0:1a61c61d0845 49 /* printf() format specifiers used by ARM compiler. */
dcoban 0:1a61c61d0845 50 #define U16_F "hu"
dcoban 0:1a61c61d0845 51 #define S16_F "hd"
dcoban 0:1a61c61d0845 52 #define X16_F "hx"
dcoban 0:1a61c61d0845 53 #define U32_F "lu"
dcoban 0:1a61c61d0845 54 #define S32_F "ld"
dcoban 0:1a61c61d0845 55 #define X32_F "lx"
dcoban 0:1a61c61d0845 56 #endif /* __GNUC__ */
dcoban 0:1a61c61d0845 57
dcoban 0:1a61c61d0845 58 #if 0
dcoban 0:1a61c61d0845 59 /*Create compilation problems, and according to http://www.mail-archive.com/lwip-users@nongnu.org/msg06786.html,
dcoban 0:1a61c61d0845 60 lwIP uses packed structures, so packing the field is not really a good idea ;) */
dcoban 0:1a61c61d0845 61 #define PACK_STRUCT_FIELD(x) __packed x
dcoban 0:1a61c61d0845 62 #else
dcoban 0:1a61c61d0845 63 #define PACK_STRUCT_FIELD(x) x
dcoban 0:1a61c61d0845 64 #endif
dcoban 0:1a61c61d0845 65
dcoban 0:1a61c61d0845 66 #ifdef __GNUC__
dcoban 0:1a61c61d0845 67 /* Packing for structs in GCC. */
dcoban 0:1a61c61d0845 68 #define PACK_STRUCT_STRUCT __attribute__((packed))
dcoban 0:1a61c61d0845 69 #define PACK_STRUCT_BEGIN
dcoban 0:1a61c61d0845 70 #define PACK_STRUCT_END
dcoban 0:1a61c61d0845 71 #else /* !__GNUC__ */
dcoban 0:1a61c61d0845 72 /* Packing for structs in ARM compiler. */
dcoban 0:1a61c61d0845 73 #define PACK_STRUCT_STRUCT
dcoban 0:1a61c61d0845 74 #define PACK_STRUCT_BEGIN __packed
dcoban 0:1a61c61d0845 75 #define PACK_STRUCT_END
dcoban 0:1a61c61d0845 76 #endif /* __GNUC__ */
dcoban 0:1a61c61d0845 77
dcoban 0:1a61c61d0845 78 #define LWIP_CHKSUM_ALGORITHM 3
dcoban 0:1a61c61d0845 79
dcoban 0:1a61c61d0845 80
dcoban 0:1a61c61d0845 81 #endif /* __LWIP_ARCH_CC_H__ */