rtconfig.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. /* RT-Thread config file */
  2. #ifndef __RTTHREAD_CFG_H__
  3. #define __RTTHREAD_CFG_H__
  4. #define RT_HEAP_SIZE (1024*1024*2)
  5. #if defined(_MSC_VER)
  6. /* SECTION: port for visual studio */
  7. #undef RT_USING_NEWLIB
  8. #undef RT_USING_MINILIBC
  9. #define NORESOURCE //RT_VESRION in winuser.h
  10. #define _CRT_ERRNO_DEFINED //errno macro redefinition
  11. #define _INC_WTIME_INL//dfs_elm.c time.h conflicts with wtime.inl
  12. #define _INC_TIME_INL //dfs_elm.c time.h conflicts with wtime.inl
  13. /* disable some warning in MSC */
  14. #pragma warning(disable:4273) /* to ignore: warning C4273: inconsistent dll linkage */
  15. #pragma warning(disable:4312) /* to ignore: warning C4312: 'type cast' : conversion from 'rt_uint32_t' to 'rt_uint32_t *' */
  16. #pragma warning(disable:4311) /* to ignore: warning C4311: 'type cast' : pointer truncation from 'short *__w64 ' to 'long' */
  17. #pragma warning(disable:4996) /* to ignore: warning C4996: The POSIX name for this item is deprecated. */
  18. #pragma warning(disable:4267) /* to ignore: warning C4267: conversion from 'size_t' to 'rt_size_t', possible loss of data */
  19. #pragma warning(disable:4244) /* to ignore: warning C4244: '=' : conversion from '__w64 int' to 'rt_size_t', possible loss of data */
  20. #elif defined(__GNUC__)
  21. #define RT_USING_NOLIBC
  22. #if defined(__MINGW32__)
  23. #define _NO_OLDNAMES /* to ignore: mode_t in sys/type.h */
  24. #endif
  25. #endif
  26. /* SECTION: basic kernel options */
  27. /* RT_NAME_MAX*/
  28. #define RT_NAME_MAX 8
  29. /* RT_ALIGN_SIZE*/
  30. #define RT_ALIGN_SIZE 4
  31. /* PRIORITY_MAX */
  32. #define RT_THREAD_PRIORITY_MAX 32
  33. /* Tick per Second */
  34. #define RT_TICK_PER_SECOND 100
  35. /* SECTION: RT_DEBUG */
  36. /* Thread Debug */
  37. #define RT_DEBUG
  38. //#define RT_DEBUG_SCHEDULER 1
  39. #define RT_THREAD_DEBUG
  40. #define RT_USING_OVERFLOW_CHECK
  41. /* Using Hook */
  42. #define RT_USING_HOOK
  43. /* Using Software Timer */
  44. /* #define RT_USING_TIMER_SOFT */
  45. #define RT_TIMER_THREAD_PRIO 4
  46. #define RT_TIMER_THREAD_STACK_SIZE 512
  47. #define RT_TIMER_TICK_PER_SECOND 10
  48. /* SECTION: IPC */
  49. /* Using Semaphore*/
  50. #define RT_USING_SEMAPHORE
  51. /* Using Mutex */
  52. #define RT_USING_MUTEX
  53. /* Using Event */
  54. #define RT_USING_EVENT
  55. /* Using MailBox */
  56. #define RT_USING_MAILBOX
  57. /* Using Message Queue */
  58. #define RT_USING_MESSAGEQUEUE
  59. /* SECTION: Memory Management */
  60. /* Using Memory Pool Management*/
  61. /* #define RT_USING_MEMPOOL */
  62. /* Using Dynamic Heap Management */
  63. #define RT_USING_HEAP
  64. /* Using Small MM */
  65. #define RT_USING_SMALL_MEM
  66. /* #define RT_TINY_SIZE */
  67. /* SECTION: Device System */
  68. /* Using Device System */
  69. #define RT_USING_DEVICE
  70. #define RT_USING_DEVICE_IPC
  71. /* #define RT_USING_UART1 */
  72. /* SECTION: Console options */
  73. #define RT_USING_CONSOLE
  74. /* the buffer size of console*/
  75. #define RT_CONSOLEBUF_SIZE 128
  76. #define RT_CONSOLE_DEVICE_NAME "sci0"
  77. /* SECTION: component options */
  78. #define RT_USING_COMPONENTS_INIT
  79. /* SECTION: APP MODULE */
  80. /* #define RT_USING_MODULE */
  81. /* SECTION: MTD interface options */
  82. /* using mtd nand flash */
  83. #define RT_USING_MTD_NAND
  84. /* using mtd nor flash */
  85. /* #define RT_USING_MTD_NOR */
  86. /* SECTION: finsh, a C-Express shell */
  87. #define RT_USING_FINSH
  88. /* Using symbol table */
  89. #define FINSH_USING_SYMTAB
  90. #define FINSH_USING_DESCRIPTION
  91. /* SECTION: device file system */
  92. #define RT_USING_DFS
  93. #define DFS_FILESYSTEM_TYPES_MAX 8
  94. /* DFS: ELM FATFS options */
  95. #define RT_USING_DFS_ELMFAT
  96. #define RT_DFS_ELM_WORD_ACCESS
  97. /* Reentrancy (thread safe) of the FatFs module. */
  98. #define RT_DFS_ELM_REENTRANT
  99. /* Number of volumes (logical drives) to be used. */
  100. #define RT_DFS_ELM_DRIVES 2
  101. /* #define RT_DFS_ELM_USE_LFN 1 */
  102. #define RT_DFS_ELM_MAX_LFN 255
  103. /* Maximum sector size to be handled. */
  104. #define RT_DFS_ELM_MAX_SECTOR_SIZE 512
  105. /* DFS: network file system options */
  106. /* #define RT_USING_DFS_NFS */
  107. /* DFS: UFFS nand file system options */
  108. #define RT_USING_DFS_UFFS
  109. /* configuration for uffs, more to see dfs_uffs.h and uffs_config.h */
  110. #define RT_CONFIG_UFFS_ECC_MODE UFFS_ECC_HW_AUTO
  111. /* enable this ,you need provide a mark_badblock/check_block function */
  112. /* #define RT_UFFS_USE_CHECK_MARK_FUNCITON */
  113. /* DFS: JFFS2 nor flash file system options */
  114. //#define RT_USING_DFS_JFFS2
  115. /* DFS: windows share directory mounted to rt-thread/dfs */
  116. /* only used in bsp/simulator */
  117. #ifdef _WIN32
  118. #define RT_USING_DFS_WINSHAREDIR
  119. #endif
  120. /* the max number of mounted file system */
  121. #define DFS_FILESYSTEMS_MAX 4
  122. /* the max number of opened files */
  123. #define DFS_FD_MAX 4
  124. /* SECTION: lwip, a lightweight TCP/IP protocol stack */
  125. /* #define RT_USING_LWIP */
  126. /* LwIP uses RT-Thread Memory Management */
  127. #define RT_LWIP_USING_RT_MEM
  128. /* Enable ICMP protocol*/
  129. #define RT_LWIP_ICMP
  130. /* Enable UDP protocol*/
  131. #define RT_LWIP_UDP
  132. /* Enable TCP protocol*/
  133. #define RT_LWIP_TCP
  134. /* Enable DNS */
  135. #define RT_LWIP_DNS
  136. /* the number of simultaneously active TCP connections*/
  137. #define RT_LWIP_TCP_PCB_NUM 5
  138. /* Using DHCP */
  139. /* #define RT_LWIP_DHCP */
  140. /* ip address of target*/
  141. #define RT_LWIP_IPADDR0 192
  142. #define RT_LWIP_IPADDR1 168
  143. #define RT_LWIP_IPADDR2 126
  144. #define RT_LWIP_IPADDR3 30
  145. /* gateway address of target*/
  146. #define RT_LWIP_GWADDR0 192
  147. #define RT_LWIP_GWADDR1 168
  148. #define RT_LWIP_GWADDR2 126
  149. #define RT_LWIP_GWADDR3 1
  150. /* mask address of target*/
  151. #define RT_LWIP_MSKADDR0 255
  152. #define RT_LWIP_MSKADDR1 255
  153. #define RT_LWIP_MSKADDR2 255
  154. #define RT_LWIP_MSKADDR3 0
  155. /* tcp thread options */
  156. #define RT_LWIP_TCPTHREAD_PRIORITY 12
  157. #define RT_LWIP_TCPTHREAD_MBOX_SIZE 10
  158. #define RT_LWIP_TCPTHREAD_STACKSIZE 1024
  159. /* Ethernet if thread options */
  160. #define RT_LWIP_ETHTHREAD_PRIORITY 15
  161. #define RT_LWIP_ETHTHREAD_MBOX_SIZE 10
  162. #define RT_LWIP_ETHTHREAD_STACKSIZE 512
  163. /* TCP sender buffer space */
  164. #define RT_LWIP_TCP_SND_BUF 8192
  165. /* TCP receive window. */
  166. #define RT_LWIP_TCP_WND 8192
  167. /* SECTION: RT-Thread/GUI */
  168. /* #define RT_USING_RTGUI */
  169. /* name length of RTGUI object */
  170. #define RTGUI_NAME_MAX 12
  171. /* support 16 weight font */
  172. #define RTGUI_USING_FONT16
  173. /* support Chinese font */
  174. #define RTGUI_USING_FONTHZ
  175. /* use DFS as file interface */
  176. #define RTGUI_USING_DFS_FILERW
  177. /* use font file as Chinese font */
  178. /* #define RTGUI_USING_HZ_FILE */
  179. /* use Chinese bitmap font */
  180. #define RTGUI_USING_HZ_BMP
  181. /* use small size in RTGUI */
  182. #define RTGUI_USING_SMALL_SIZE
  183. /* use mouse cursor */
  184. /* #define RTGUI_USING_MOUSE_CURSOR */
  185. /* default font size in RTGUI */
  186. #define RTGUI_DEFAULT_FONT_SIZE 16
  187. /* image support */
  188. #define RTGUI_IMAGE_XPM
  189. #define RTGUI_IMAGE_BMP
  190. /* #define RTGUI_IMAGE_JPEG */
  191. /* #define RTGUI_IMAGE_PNG */
  192. #define RTGUI_USING_NOTEBOOK_IMAGE
  193. #endif