rtconfig.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. /* RT-Thread config file */
  2. #ifndef __RTTHREAD_CFG_H__
  3. #define __RTTHREAD_CFG_H__
  4. // <RDTConfigurator URL="http://www.rt-thread.com/eclipse">
  5. // <integer name="RT_NAME_MAX" description="Maximal size of kernel object name length" default="6" />
  6. #define RT_NAME_MAX 6
  7. // <integer name="RT_ALIGN_SIZE" description="Alignment size for CPU architecture data access" default="4" />
  8. #define RT_ALIGN_SIZE 4
  9. // <integer name="RT_THREAD_PRIORITY_MAX" description="Maximal level of thread priority" default="32">
  10. // <item description="8">8</item>
  11. // <item description="32">32</item>
  12. // <item description="256">256</item>
  13. // </integer>
  14. #define RT_THREAD_PRIORITY_MAX 32
  15. // <integer name="RT_TICK_PER_SECOND" description="OS tick per second" default="100" />
  16. #define RT_TICK_PER_SECOND 100
  17. // <section name="RT_DEBUG" description="Kernel Debug Configuration" default="true" >
  18. #define RT_DEBUG
  19. // <bool name="RT_THREAD_DEBUG" description="Thread debug enable" default="false" />
  20. // #define RT_THREAD_DEBUG
  21. // <bool name="RT_USING_OVERFLOW_CHECK" description="Thread stack over flow detect" default="true" />
  22. #define RT_USING_OVERFLOW_CHECK
  23. // </section>
  24. // <bool name="RT_USING_HOOK" description="Using hook functions" default="true" />
  25. #define RT_USING_HOOK
  26. // <section name="RT_USING_TIMER_SOFT" description="Using software timer which will start a thread to handle soft-timer" default="true" >
  27. // #define RT_USING_TIMER_SOFT
  28. // <integer name="RT_TIMER_THREAD_PRIO" description="The priority level of timer thread" default="4" />
  29. #define RT_TIMER_THREAD_PRIO 4
  30. // <integer name="RT_TIMER_THREAD_STACK_SIZE" description="The stack size of timer thread" default="512" />
  31. #define RT_TIMER_THREAD_STACK_SIZE 512
  32. // </section>
  33. // <section name="IPC" description="Inter-Thread communication" default="always" >
  34. // <bool name="RT_USING_SEMAPHORE" description="Using semaphore in the system" default="true" />
  35. #define RT_USING_SEMAPHORE
  36. // <bool name="RT_USING_MUTEX" description="Using mutex in the system" default="true" />
  37. #define RT_USING_MUTEX
  38. // <bool name="RT_USING_EVENT" description="Using event group in the system" default="true" />
  39. #define RT_USING_EVENT
  40. // <bool name="RT_USING_MAILBOX" description="Using mailbox in the system" default="true" />
  41. #define RT_USING_MAILBOX
  42. // <bool name="RT_USING_MESSAGEQUEUE" description="Using message queue in the system" default="true" />
  43. #define RT_USING_MESSAGEQUEUE
  44. // </section>
  45. // <section name="MM" description="Memory Management" default="always" >
  46. // <bool name="RT_USING_MEMPOOL" description="Using Memory Pool Management in the system" default="true" />
  47. #define RT_USING_MEMPOOL
  48. // <bool name="RT_USING_MEMHEAP" description="Using Memory Heap Object in the system" default="true" />
  49. #define RT_USING_MEMHEAP
  50. // <bool name="RT_USING_HEAP" description="Using Dynamic Heap Management in the system" default="true" />
  51. #define RT_USING_HEAP
  52. // <bool name="RT_USING_SMALL_MEM" description="Optimizing for small memory" default="false" />
  53. #define RT_USING_SMALL_MEM
  54. // <bool name="RT_USING_SLAB" description="Using SLAB memory management for large memory" default="false" />
  55. // #define RT_USING_SLAB
  56. // </section>
  57. // <section name="RT_USING_DEVICE" description="Using Device Driver Framework" default="true" >
  58. #define RT_USING_DEVICE
  59. // <bool name="RT_USING_DEVICE_IPC" description="Using Inter-Thread communication for Device" default="true" >
  60. #define RT_USING_DEVICE_IPC
  61. // <bool name="RT_USING_SERIAL" description="Using serial device framework" default="true">
  62. #define RT_USING_SERIAL
  63. // <bool name="RT_USING_UART0" description="Using UART0" default="true" />
  64. #define RT_USING_UART0
  65. // </section>
  66. // <section name="RT_USING_CONSOLE" description="Using console" default="true" >
  67. #define RT_USING_CONSOLE
  68. // <integer name="RT_CONSOLEBUF_SIZE" description="The buffer size for console output" default="128" />
  69. #define RT_CONSOLEBUF_SIZE 128
  70. // <string name="RT_CONSOLE_DEVICE_NAME" description="The device name for console" default="uart" />
  71. #define RT_CONSOLE_DEVICE_NAME "console"
  72. // </section>
  73. // <section name="RT_USING_FINSH" description="Using finsh as shell, which is a C-Express shell" default="true" >
  74. #define RT_USING_FINSH
  75. // <bool name="FINSH_USING_SYMTAB" description="Using symbol table in finsh shell" default="true" />
  76. #define FINSH_USING_SYMTAB
  77. // <bool name="FINSH_USING_DESCRIPTION" description="Keeping description in symbol table" default="true" />
  78. #define FINSH_USING_DESCRIPTION
  79. // <integer name="FINSH_THREAD_STACK_SIZE" description="The stack size for finsh thread" default="4096" />
  80. #define FINSH_THREAD_STACK_SIZE 4096
  81. // <bool name="FINSH_USING_MSH" description="Enable module shell feature" />
  82. #define FINSH_USING_MSH
  83. // <bool name="FINSH_USING_MSH_DEFAULT" description="Use module shell as the default shell" />
  84. #define FINSH_USING_MSH_DEFAULT
  85. // </section>
  86. // <section name="LIBC" description="C Runtime library setting" default="always" >
  87. // <bool name="RT_USING_LIBC" description="Using C library" default="true" />
  88. // #define RT_USING_LIBC
  89. // <bool name="RT_USING_PTHREADS" description="Using POSIX threads library" default="true" />
  90. // #define RT_USING_PTHREADS
  91. // <bool name="RT_USING_COMPONENTS_INIT" description="Using automatically component initialization." default="true" />
  92. // #define RT_USING_COMPONENTS_INIT
  93. // <bool name="RT_USING_MODULE" description="Enable Moudle Application" default="true" />
  94. // #define RT_USING_MODULE
  95. // </section>
  96. // <section name="RT_USING_DFS" description="Device file system" default="true" >
  97. #define RT_USING_DFS
  98. // <bool name="DFS_USING_WORKDIR" description="Using working directory" default="true" />
  99. #define DFS_USING_WORKDIR
  100. // <integer name="DFS_FILESYSTEMS_MAX" description="The maximal number of mounted file system" default="4" />
  101. #define DFS_FILESYSTEMS_MAX 2
  102. // <integer name="DFS_FD_MAX" description="The maximal number of opened files" default="4" />
  103. #define DFS_FD_MAX 4
  104. // <bool name="RT_USING_DFS_ELMFAT" description="Using ELM FatFs" default="true" />
  105. #define RT_USING_DFS_ELMFAT
  106. // <integer name="RT_DFS_ELM_USE_LFN" description="Support long file name" default="0">
  107. // <item description="LFN with static LFN working buffer">1</item>
  108. // <item description="LFN with dynamic LFN working buffer on the stack">2</item>
  109. // <item description="LFN with dynamic LFN working buffer on the heap">3</item>
  110. // </integer>
  111. #define RT_DFS_ELM_USE_LFN 3
  112. // <integer name="RT_DFS_ELM_CODE_PAGE" description="OEM code page" default="437">
  113. #define RT_DFS_ELM_CODE_PAGE 437
  114. // <integer name="RT_DFS_ELM_MAX_LFN" description="Maximal size of file name length" default="255" />
  115. #define RT_DFS_ELM_MAX_LFN 128
  116. // <bool name="RT_USING_DFS_YAFFS2" description="Using YAFFS2" default="false" />
  117. // #define RT_USING_DFS_YAFFS2
  118. // <bool name="RT_USING_DFS_UFFS" description="Using UFFS" default="false" />
  119. // #define RT_USING_DFS_UFFS
  120. // <bool name="RT_USING_DFS_DEVFS" description="Using devfs for device objects" default="true" />
  121. // #define RT_USING_DFS_DEVFS
  122. // <bool name="RT_USING_DFS_NFS" description="Using NFS v3 client file system" default="false" />
  123. // #define RT_USING_DFS_NFS
  124. // <string name="RT_NFS_HOST_EXPORT" description="NFSv3 host export" default="192.168.1.5:/" />
  125. #define RT_NFS_HOST_EXPORT "192.168.1.5:/"
  126. // <bool name="RT_USING_DFS_WINSHAREDIR" description="shared windows file to rtt" default="false" />
  127. #define RT_USING_DFS_WINSHAREDIR
  128. // </section>
  129. // <section name="RT_USING_LWIP" description="lwip, a lightweight TCP/IP protocol stack" default="true" >
  130. // #define RT_USING_LWIP
  131. // <bool name="RT_LWIP_ICMP" description="Enable ICMP protocol" default="true" />
  132. #define RT_LWIP_ICMP
  133. // <bool name="RT_LWIP_IGMP" description="Enable IGMP protocol" default="false" />
  134. // #define RT_LWIP_IGMP
  135. // <bool name="RT_LWIP_UDP" description="Enable UDP protocol" default="true" />
  136. #define RT_LWIP_UDP
  137. // <bool name="RT_LWIP_TCP" description="Enable TCP protocol" default="true" />
  138. #define RT_LWIP_TCP
  139. // <bool name="RT_LWIP_DNS" description="Enable DNS protocol" default="true" />
  140. #define RT_LWIP_DNS
  141. // <bool name="RT_LWIP_SNMP" description="Enable SNMP protocol" default="false" />
  142. // #define RT_LWIP_SNMP
  143. // <bool name="RT_LWIP_DHCP" description="Enable DHCP client to get IP address" default="false" />
  144. // #define RT_LWIP_DHCP
  145. // <integer name="RT_LWIP_TCPTHREAD_PRIORITY" description="the thread priority of TCP thread" default="128" />
  146. #define RT_LWIP_TCPTHREAD_PRIORITY 12
  147. // <integer name="RT_LWIP_TCPTHREAD_MBOX_SIZE" description="the mail box size of TCP thread to wait for" default="32" />
  148. #define RT_LWIP_TCPTHREAD_MBOX_SIZE 8
  149. // <integer name="RT_LWIP_TCPTHREAD_STACKSIZE" description="the thread stack size of TCP thread" default="4096" />
  150. #define RT_LWIP_TCPTHREAD_STACKSIZE 4096
  151. // <integer name="RT_LWIP_ETHTHREAD_PRIORITY" description="the thread priority of ethnetif thread" default="144" />
  152. #define RT_LWIP_ETHTHREAD_PRIORITY 14
  153. // <integer name="RT_LWIP_ETHTHREAD_MBOX_SIZE" description="the mail box size of ethnetif thread to wait for" default="8" />
  154. #define RT_LWIP_ETHTHREAD_MBOX_SIZE 8
  155. // <integer name="RT_LWIP_ETHTHREAD_STACKSIZE" description="the stack size of ethnetif thread" default="512" />
  156. #define RT_LWIP_ETHTHREAD_STACKSIZE 512
  157. // <ipaddr name="RT_LWIP_IPADDR" description="IP address of device" default="192.168.1.30" />
  158. #define RT_LWIP_IPADDR0 192
  159. #define RT_LWIP_IPADDR1 168
  160. #define RT_LWIP_IPADDR2 1
  161. #define RT_LWIP_IPADDR3 30
  162. // <ipaddr name="RT_LWIP_GWADDR" description="Gateway address of device" default="192.168.1.1" />
  163. #define RT_LWIP_GWADDR0 192
  164. #define RT_LWIP_GWADDR1 168
  165. #define RT_LWIP_GWADDR2 1
  166. #define RT_LWIP_GWADDR3 1
  167. // <ipaddr name="RT_LWIP_MSKADDR" description="Mask address of device" default="255.255.255.0" />
  168. #define RT_LWIP_MSKADDR0 255
  169. #define RT_LWIP_MSKADDR1 255
  170. #define RT_LWIP_MSKADDR2 255
  171. #define RT_LWIP_MSKADDR3 0
  172. // </section>
  173. // <section name="RT_USING_RTGUI" description="RT-Thread/GUI" default="true" >
  174. // #define RT_USING_RTGUI
  175. // <integer name="RTGUI_NAME_MAX" description="the name size of RT-Thread/GUI widget/objects" default="12" />
  176. #define RTGUI_NAME_MAX 12
  177. // <bool name="RTGUI_USING_SMALL_SIZE" description="use small size in RT-Thread/GUI" default="true" />
  178. #define RTGUI_USING_SMALL_SIZE
  179. // <bool name="RTGUI_USING_FONT16" description="support 16 weight font" default="true" />
  180. #define RTGUI_USING_FONT16
  181. // <bool name="RTGUI_USING_FONT12" description="support 12 weight font" default="true" />
  182. // #define RTGUI_USING_FONT12
  183. // <bool name="RTGUI_USING_FONTHZ" description="support Chinese font" default="true" />
  184. #define RTGUI_USING_FONTHZ
  185. // <integer name="RTGUI_DEFAULT_FONT_SIZE" description="default font size in RT-Thread/GUI" default="16" />
  186. #define RTGUI_DEFAULT_FONT_SIZE 16
  187. // <bool name="RTGUI_USING_DFS_FILERW" description="use RT-Thread/DFS as file interface" default="true" />
  188. #define RTGUI_USING_DFS_FILERW
  189. // <bool name="RTGUI_USING_HZ_BMP" description="use Chinese font bitmap engine" default="true" />
  190. #define RTGUI_USING_HZ_BMP
  191. // <bool name="RTGUI_IMAGE_XPM" description="Using xpm image in RTGUI" default="true" />
  192. #define RTGUI_IMAGE_XPM
  193. // <bool name="RTGUI_IMAGE_JPEG" description="Using jpeg image in RTGUI" default="true" />
  194. // #define RTGUI_IMAGE_JPEG
  195. // <bool name="RTGUI_IMAGE_PNG" description="Using PNG image in RTGUI" default="true" />
  196. // #define RTGUI_IMAGE_PNG
  197. // <bool name="RTGUI_IMAGE_PNG" description="Using PNG image in RTGUI" default="true" />
  198. #define RTGUI_IMAGE_BMP
  199. // <bool name="RTGUI_USING_HZ_FILE" description="use font file as Chinese font" default="false" />
  200. #define RTGUI_USING_HZ_FILE
  201. // <bool name="RTGUI_USING_MOUSE_CURSOR" description="use mouse cursor" default="false" />
  202. #define RTGUI_USING_MOUSE_CURSOR
  203. // </section>
  204. // </RDTConfigurator>
  205. #define RT_HEAP_SIZE (1024*1024*2)
  206. #if defined(_MSC_VER)
  207. #define NORESOURCE //RT_VESRION in winuser.h
  208. #define _CRT_ERRNO_DEFINED //errno macro redefinition
  209. #define _INC_WTIME_INL//dfs_elm.c time.h conflicts with wtime.inl
  210. #define _INC_TIME_INL //dfs_elm.c time.h conflicts with wtime.inl
  211. /* disable some warning in MSC */
  212. #pragma warning(disable:4273) /* to ignore: warning C4273: inconsistent dll linkage */
  213. #pragma warning(disable:4312) /* to ignore: warning C4312: 'type cast' : conversion from 'rt_uint32_t' to 'rt_uint32_t *' */
  214. #pragma warning(disable:4311) /* to ignore: warning C4311: 'type cast' : pointer truncation from 'short *__w64 ' to 'long' */
  215. #pragma warning(disable:4996) /* to ignore: warning C4996: The POSIX name for this item is deprecated. */
  216. #pragma warning(disable:4267) /* to ignore: warning C4267: conversion from 'size_t' to 'rt_size_t', possible loss of data */
  217. #pragma warning(disable:4244) /* to ignore: warning C4244: '=' : conversion from '__w64 int' to 'rt_size_t', possible loss of data */
  218. #elif defined(__GNUC__)
  219. #define RT_USING_NOLIBC
  220. #endif /* end of _MSC_VER */
  221. #endif