remove maximun value of base type

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@427 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
gary.li.wenchao.4 2010-02-20 09:22:43 +00:00
parent 7918251ca6
commit 26e8c8c1ab

View File

@ -21,6 +21,11 @@
extern "C" { extern "C" {
#endif #endif
/* RT-Thread version information */
#define RT_VERSION 3
#define RT_SUBVERSION 0
/* date type defination */
typedef signed char rt_int8_t; typedef signed char rt_int8_t;
typedef signed short rt_int16_t; typedef signed short rt_int16_t;
typedef signed long rt_int32_t; typedef signed long rt_int32_t;
@ -29,18 +34,28 @@ typedef unsigned short rt_uint16_t;
typedef unsigned long rt_uint32_t; typedef unsigned long rt_uint32_t;
typedef int rt_bool_t; typedef int rt_bool_t;
#define RT_UINT8_MAX 0xff
#define RT_UINT16_MAX 0xffff
#define RT_UINT32_MAX 0xffffffff
/* 32bit CPU */ /* 32bit CPU */
typedef long rt_base_t; typedef long rt_base_t;
typedef unsigned long rt_ubase_t; typedef unsigned long rt_ubase_t;
/* RT-Thread definitions */
typedef rt_base_t rt_err_t; /* Type for error number. */
typedef rt_uint32_t rt_time_t; /* Type for time stamp. */
typedef rt_uint32_t rt_tick_t; /* Type for tick count. */
typedef rt_base_t rt_flag_t; /* Type for flags. */
typedef rt_ubase_t rt_size_t; /* Type for size number. */
typedef rt_ubase_t rt_dev_t; /* Type for device. */
typedef rt_uint32_t rt_off_t; /* Type for offset. */
/* RT-Thread bool type definitions */ /* RT-Thread bool type definitions */
#define RT_TRUE 1 #define RT_TRUE 1
#define RT_FALSE 0 #define RT_FALSE 0
/* maximun value of base type */
#define RT_UINT8_MAX 0xff /* Maxium number of UINT8. */
#define RT_UINT16_MAX 0xffff /* Maxium number of UINT16. */
#define RT_UINT32_MAX 0xffffffff /* Maxium number of UINT32. */
#ifdef __CC_ARM /* ARM Compiler */ #ifdef __CC_ARM /* ARM Compiler */
#include <stdarg.h> #include <stdarg.h>
#define SECTION(x) __attribute__((section(x))) #define SECTION(x) __attribute__((section(x)))
@ -83,24 +98,6 @@ typedef unsigned long rt_ubase_t;
#define RT_MM_PAGE_MASK (RT_MM_PAGE_SIZE - 1) #define RT_MM_PAGE_MASK (RT_MM_PAGE_SIZE - 1)
#define RT_MM_PAGE_BITS 12 #define RT_MM_PAGE_BITS 12
/* RT-Thread definitions */
typedef rt_base_t rt_err_t; /* Type for error number. */
typedef rt_uint32_t rt_time_t; /* Type for time stamp. */
typedef rt_uint32_t rt_tick_t; /* Type for tick count. */
typedef rt_base_t rt_flag_t; /* Type for flags. */
typedef rt_ubase_t rt_size_t; /* Type for size number. */
typedef rt_ubase_t rt_dev_t; /* Type for device. */
typedef rt_uint32_t rt_off_t; /* Type for offset. */
/* maximun value of base type */
#define RT_UINT8_MAX 0xff /* Maxium number of UINT8. */
#define RT_UINT16_MAX 0xffff /* Maxium number of UINT16. */
#define RT_UINT32_MAX 0xffffffff /* Maxium number of UINT32. */
/* RT-Thread version information */
#define RT_VERSION 3
#define RT_SUBVERSION 0
/** /**
* @addtogroup Error * @addtogroup Error
*/ */
@ -117,7 +114,8 @@ typedef rt_uint32_t rt_off_t; /* Type for offset. */
/*@}*/ /*@}*/
#ifdef RT_DEBUG #ifdef RT_DEBUG
#define RT_ASSERT(EX) if (!(EX)) { rt_kprintf("(%s) assert failed at %s:%d \n", #EX, __FUNCTION__, __LINE__); while (1);} #define RT_ASSERT(EX) if (!(EX)) { rt_kprintf("(%s) assert failed at %s:%d \n", \
#EX, __FUNCTION__, __LINE__); while (1);}
#else #else
#define RT_ASSERT(EX) #define RT_ASSERT(EX)
#endif #endif