提交 26e8c8c1 编写于 作者: G gary.li.wenchao.4

remove maximun value of base type

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@427 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 7918251c
......@@ -21,6 +21,11 @@
extern "C" {
#endif
/* RT-Thread version information */
#define RT_VERSION 3
#define RT_SUBVERSION 0
/* date type defination */
typedef signed char rt_int8_t;
typedef signed short rt_int16_t;
typedef signed long rt_int32_t;
......@@ -29,18 +34,28 @@ typedef unsigned short rt_uint16_t;
typedef unsigned long rt_uint32_t;
typedef int rt_bool_t;
#define RT_UINT8_MAX 0xff
#define RT_UINT16_MAX 0xffff
#define RT_UINT32_MAX 0xffffffff
/* 32bit CPU */
typedef long rt_base_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 */
#define RT_TRUE 1
#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 */
#include <stdarg.h>
#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_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
*/
......@@ -117,7 +114,8 @@ typedef rt_uint32_t rt_off_t; /* Type for offset. */
/*@}*/
#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
#define RT_ASSERT(EX)
#endif
......@@ -194,7 +192,7 @@ enum rt_object_class_type
RT_Object_Class_MailBox, /* The object is a mail box. */
#endif
#ifdef RT_USING_MESSAGEQUEUE
RT_Object_Class_MessageQueue,/* The object is a message queue. */
RT_Object_Class_MessageQueue, /* The object is a message queue. */
#endif
#ifdef RT_USING_MEMPOOL
RT_Object_Class_MemPool, /* The object is a memory pool. */
......@@ -207,7 +205,7 @@ enum rt_object_class_type
RT_Object_Class_Module, /* The object is a module. */
#endif
RT_Object_Class_Unknown, /* The object is unknown. */
RT_Object_Class_Static = 0x80/* The object is a static object. */
RT_Object_Class_Static = 0x80 /* The object is a static object. */
};
/*
......@@ -252,7 +250,7 @@ struct rt_timer
rt_list_t list; /* the node of timer list. */
void (*timeout_func)(void* parameter);/* timeout function. */
void (*timeout_func)(void* parameter); /* timeout function. */
void *parameter; /* timeout function's parameter. */
rt_tick_t init_tick; /* timer timeout tick. */
......@@ -414,7 +412,7 @@ struct rt_mutex
rt_ubase_t value; /* value of mutex. */
struct rt_thread* owner; /* current owner of mutex. */
struct rt_thread *owner; /* current owner of mutex. */
rt_uint8_t original_priority; /* priority of last thread hold the mutex. */
rt_ubase_t hold; /* numbers of thread hold the mutex. */
......@@ -499,11 +497,11 @@ struct rt_mempool
{
struct rt_object parent;
void* start_address; /* memory pool start */
void *start_address; /* memory pool start */
rt_size_t size; /* size of memory pool */
rt_size_t block_size; /* size of memory blocks */
rt_uint8_t* block_list; /* memory blocks list */
rt_uint8_t *block_list; /* memory blocks list */
rt_size_t block_total_count; /* numbers of memory block */
rt_size_t block_free_count; /* numbers of free memory block */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册