⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rtconfig.h

📁 RT-Thread是发展中的下一代微内核嵌入式实时操作系统
💻 H
字号:
/*
 * File      : rtconfig.h
 * This file is part of RT-Thread RTOS
 * COPYRIGHT (C) 2006, RT-Thread Development Team
 *
 * The license and distribution terms for this file may be
 * found in the file LICENSE in this distribution or at
 * http://openlab.rt-thread.com/license/LICENSE.
 *
 * Change Logs:
 * Date           Author       Notes
 * 2006-09-23     Bernard      the first version for sgps44b0
 */

#ifndef __RT_CONFIG_H__
#define __RT_CONFIG_H__

#ifdef __cplusplus
extern "C" {
#endif

typedef char  rt_int8;
typedef short rt_int16;
typedef long  rt_int32;
typedef unsigned char  rt_uint8;
typedef unsigned short rt_uint16;
typedef unsigned long  rt_uint32;

#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;

#ifdef __CC_ARM
#define rt_inline static __inline
#else
#define rt_inline static inline
#endif

/* maximun name length */
#define RT_NAME_MAX				8
/* size of align */
#define RT_ALIGN_SIZE			4

/* debug options */
/* #define RT_DEBUG */

/* printf option */
/* precision support for rt_kprintf */
#define RT_PRINTF_PRECISION
/* special support for rt_kprintf */
#define RT_PRINTF_SPECIAL

/* thread option */
#define RT_THREAD_PRIORITY_MAX	256

/* sync and ipc option */
#define RT_USING_SEMAPHORE
#define RT_USING_MUTEX
#define RT_USING_EVENT
#define RT_USING_FASTEVENT
#define RT_USING_MAILBOX
#define RT_USING_MESSAGEQUEUE
#define RT_USING_MEMPOOL
#define RT_USING_HEAP

/* length of rt_event */
#define RT_EVENT_LENGTH 		32

/* tick and timer option */
#define RT_TICK_PER_SECOND		100

/* memory management option */
#define RT_MM_PAGE_SIZE			4096
#define RT_MM_PAGE_BITS			12

/* console option */
#define RT_CONSOLEBUF_SIZE		128

/* task option */
/* #define RT_USING_TASK */

/* hook option */
#define RT_USING_HOOK

#ifdef __CC_ARM
typedef void *__sys_va_list;
typedef __sys_va_list va_list;
#define __va_rounded_size(type)	\
	(((sizeof (type) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
#define va_start(ap, lastarg)	\
	(ap = ((char *) &(lastarg) + __va_rounded_size(lastarg))) 
#define va_end(ap)	((void)0)
/*	little endian */
#define va_arg(ap, type)	\
	(ap = (__sys_va_list) ((char *) (ap) + __va_rounded_size (type)),  \
	*((type *) (void *) ((char *) (ap) - __va_rounded_size (type))))

#define SECTION(x) 

#else
typedef __builtin_va_list va_list;
#define va_start(v,l)	__builtin_stdarg_start((v),l)
#define va_end			__builtin_va_end
#define va_arg			__builtin_va_arg
#define __va_copy(d,s)	__builtin_va_copy((d),(s))

#define SECTION(x) __attribute__((section(x)))

#endif

/* The CPU's working rate */
#define MCLK		(60000000)
#ifdef __cplusplus
}
#endif

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -