rtconfig.h 6.1 KB
Newer Older
1 2 3
/* RT-Thread config file */
#ifndef __RTTHREAD_CFG_H__
#define __RTTHREAD_CFG_H__
4

5
/* SECTION: port for visual studio */
6 7 8 9 10
#ifdef _MSC_VER
#undef RT_USING_NEWLIB
#undef RT_USING_MINILIBC
#define NORESOURCE  //RT_VESRION in winuser.h
#define _CRT_ERRNO_DEFINED  //errno macro redefinition
G
goprife@gmail.com 已提交
11 12

#define HEAP_SIZE   (1024*1024*2)
13 14 15 16 17 18 19 20

/* disable some warning in MSC */
#pragma warning(disable:4273)	/* to ignore: warning C4273: inconsistent dll linkage */
#pragma warning(disable:4312)   /* to ignore: warning C4312: 'type cast' : conversion from 'rt_uint32_t' to 'rt_uint32_t *' */
#pragma warning(disable:4311)   /* to ignore: warning C4311: 'type cast' : pointer truncation from 'short *__w64 ' to 'long' */
#pragma warning(disable:4996)   /* to ignore: warning C4996: The POSIX name for this item is deprecated. */
#pragma warning(disable:4267)   /* to ignore: warning C4267: conversion from 'size_t' to 'rt_size_t', possible loss of data */
#pragma warning(disable:4244)   /* to ignore: warning C4244: '=' : conversion from '__w64 int' to 'rt_size_t', possible loss of data */
21 22
#endif

G
goprife@gmail.com 已提交
23
/* SECTION: basic kernel options */
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
/* RT_NAME_MAX*/
#define RT_NAME_MAX	8

/* RT_ALIGN_SIZE*/
#define RT_ALIGN_SIZE	4

/* PRIORITY_MAX */
#define RT_THREAD_PRIORITY_MAX  32	

/* Tick per Second */
#define RT_TICK_PER_SECOND	1000

/* SECTION: RT_DEBUG */
/* Thread Debug */
#define RT_DEBUG
#define RT_THREAD_DEBUG

#define RT_USING_OVERFLOW_CHECK

/* Using Hook */
#define RT_USING_HOOK

/* Using Software Timer */
/* #define RT_USING_TIMER_SOFT */
48 49 50
#define RT_TIMER_THREAD_PRIO		4
#define RT_TIMER_THREAD_STACK_SIZE	512
#define RT_TIMER_TICK_PER_SECOND	10
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69

/* SECTION: IPC */
/* Using Semaphore*/
#define RT_USING_SEMAPHORE

/* Using Mutex */
#define RT_USING_MUTEX

/* Using Event */
#define RT_USING_EVENT

/* Using MailBox */
#define RT_USING_MAILBOX

/* Using Message Queue */
#define RT_USING_MESSAGEQUEUE

/* SECTION: Memory Management */
/* Using Memory Pool Management*/
G
goprife@gmail.com 已提交
70
/* #define RT_USING_MEMPOOL */
71 72 73 74 75 76

/* Using Dynamic Heap Management */
#define RT_USING_HEAP

/* Using Small MM */
#define RT_USING_SMALL_MEM
G
goprife@gmail.com 已提交
77
/* #define RT_TINY_SIZE */
78 79 80 81

/* SECTION: Device System */
/* Using Device System */
#define RT_USING_DEVICE
G
goprife@gmail.com 已提交
82
/* #define RT_USING_UART1 */
83 84 85 86 87 88 89

/* SECTION: Console options */
#define RT_USING_CONSOLE
/* the buffer size of console*/
#define RT_CONSOLEBUF_SIZE	128
#define RT_CONSOLE_DEVICE_NAME	"sci0"

90
/* SECTION: component options */
G
goprife@gmail.com 已提交
91 92
#define RT_USING_COMPONENTS_INIT

93
/* SECTION: MTD interface options */
G
goprife@gmail.com 已提交
94 95 96 97 98
/* using mtd nand flash */
#define RT_USING_MTD_NAND
/* using mtd nor flash */
#define RT_USING_MTD_NOR

99 100 101 102 103 104
/* SECTION: finsh, a C-Express shell */
#define RT_USING_FINSH
/* Using symbol table */
#define FINSH_USING_SYMTAB
#define FINSH_USING_DESCRIPTION

105
/* SECTION: device file system */
106 107
#define RT_USING_DFS

G
goprife@gmail.com 已提交
108
/* DFS: ELM FATFS options */
109 110 111 112 113 114 115 116 117 118 119
#define RT_USING_DFS_ELMFAT
#define RT_DFS_ELM_WORD_ACCESS
/* Reentrancy (thread safe) of the FatFs module.  */
#define RT_DFS_ELM_REENTRANT
/* Number of volumes (logical drives) to be used. */
#define RT_DFS_ELM_DRIVES			2
/* #define RT_DFS_ELM_USE_LFN			1 */
#define RT_DFS_ELM_MAX_LFN			255
/* Maximum sector size to be handled. */
#define RT_DFS_ELM_MAX_SECTOR_SIZE  512

120
/* DFS: network file system options */
G
goprife@gmail.com 已提交
121 122
#define RT_USING_DFS_NFS

123
/* DFS: uffs nand file system options */
124
#define RT_USING_DFS_UFFS
125
/* configuration for uffs, more to see dfs_uffs.h and uffs_config.h */
G
goprife@gmail.com 已提交
126
/* use ecc soft, the uffs will do all the things about ecc */
127
#define RT_CONFIG_UFFS_ECC_MODE  UFFS_ECC_HW_AUTO
128
/* enable this ,you need provide a mark_badblock/check_block function */
129
//#define RT_UFFS_USE_CHECK_MARK_FUNCITON
G
goprife@gmail.com 已提交
130

131
/* DFS: uffs nor flash file system options */
G
goprife@gmail.com 已提交
132 133
#define RT_USING_DFS_JFFS2

134
/* DFS: windows share directory mounted to rt-thread/dfs  */
G
goprife@gmail.com 已提交
135 136 137
/* only used in bsp/simulator */
#define RT_USING_DFS_WINSHAREDIR

138
/* the max number of mounted file system */
139 140 141 142
#define DFS_FILESYSTEMS_MAX			4
/* the max number of opened files 		*/
#define DFS_FD_MAX					4

143
/* SECTION: lwip, a lightweight TCP/IP protocol stack */
G
goprife@gmail.com 已提交
144
/* #define RT_USING_LWIP */
145 146 147 148 149 150 151 152 153 154 155
/* LwIP uses RT-Thread Memory Management */
#define RT_LWIP_USING_RT_MEM
/* Enable ICMP protocol*/
#define RT_LWIP_ICMP
/* Enable UDP protocol*/
#define RT_LWIP_UDP
/* Enable TCP protocol*/
#define RT_LWIP_TCP
/* Enable DNS */
#define RT_LWIP_DNS

156
/* the number of simultaneously active TCP connections*/
157 158 159 160 161 162 163 164
#define RT_LWIP_TCP_PCB_NUM	5

/* Using DHCP */
/* #define RT_LWIP_DHCP */

/* ip address of target*/
#define RT_LWIP_IPADDR0	192
#define RT_LWIP_IPADDR1	168
G
goprife@gmail.com 已提交
165
#define RT_LWIP_IPADDR2	126
166 167 168 169 170
#define RT_LWIP_IPADDR3	30

/* gateway address of target*/
#define RT_LWIP_GWADDR0	192
#define RT_LWIP_GWADDR1	168
G
goprife@gmail.com 已提交
171
#define RT_LWIP_GWADDR2	126
172 173 174 175 176 177 178 179 180 181 182 183 184
#define RT_LWIP_GWADDR3	1

/* mask address of target*/
#define RT_LWIP_MSKADDR0	255
#define RT_LWIP_MSKADDR1	255
#define RT_LWIP_MSKADDR2	255
#define RT_LWIP_MSKADDR3	0

/* tcp thread options */
#define RT_LWIP_TCPTHREAD_PRIORITY		12
#define RT_LWIP_TCPTHREAD_MBOX_SIZE		10
#define RT_LWIP_TCPTHREAD_STACKSIZE		1024

185
/* Ethernet if thread options */
186 187 188 189 190 191 192 193 194 195
#define RT_LWIP_ETHTHREAD_PRIORITY		15
#define RT_LWIP_ETHTHREAD_MBOX_SIZE		10
#define RT_LWIP_ETHTHREAD_STACKSIZE		512

/* TCP sender buffer space */
#define RT_LWIP_TCP_SND_BUF	8192
/* TCP receive window. */
#define RT_LWIP_TCP_WND		8192

/* SECTION: RT-Thread/GUI */
196
#define RT_USING_RTGUI
197 198 199 200 201 202 203 204 205 206

/* name length of RTGUI object */
#define RTGUI_NAME_MAX		12
/* support 16 weight font */
#define RTGUI_USING_FONT16
/* support Chinese font */
#define RTGUI_USING_FONTHZ
/* use DFS as file interface */
#define RTGUI_USING_DFS_FILERW
/* use font file as Chinese font */
207
/* #define RTGUI_USING_HZ_FILE */
208 209 210 211 212 213 214 215 216 217
/* use Chinese bitmap font */
#define RTGUI_USING_HZ_BMP
/* use small size in RTGUI */
#define RTGUI_USING_SMALL_SIZE
/* use mouse cursor */
/* #define RTGUI_USING_MOUSE_CURSOR */
/* default font size in RTGUI */
#define RTGUI_DEFAULT_FONT_SIZE	16

/* image support */
G
goprife@gmail.com 已提交
218 219
#define RTGUI_IMAGE_XPM
#define RTGUI_IMAGE_BMP
220 221
/* #define RTGUI_IMAGE_JPEG */
/* #define RTGUI_IMAGE_PNG */
G
goprife@gmail.com 已提交
222
#define RTGUI_USING_NOTEBOOK_IMAGE
223 224

#endif