rtconfig.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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: APP MODULE */
  78. /* #define RT_USING_MODULE */
  79. /* SECTION: MTD interface options */
  80. /* using mtd nand flash */
  81. #define RT_USING_MTD_NAND
  82. /* using mtd nor flash */
  83. /* #define RT_USING_MTD_NOR */
  84. /* SECTION: finsh, a C-Express shell */
  85. #define RT_USING_FINSH
  86. /* Using symbol table */
  87. #define FINSH_USING_SYMTAB
  88. #define FINSH_USING_DESCRIPTION
  89. /* SECTION: device file system */
  90. #define RT_USING_DFS
  91. #define DFS_FILESYSTEM_TYPES_MAX 8
  92. /* DFS: ELM FATFS options */
  93. #define RT_USING_DFS_ELMFAT
  94. #define RT_DFS_ELM_WORD_ACCESS
  95. /* Reentrancy (thread safe) of the FatFs module. */
  96. #define RT_DFS_ELM_REENTRANT
  97. /* Number of volumes (logical drives) to be used. */
  98. #define RT_DFS_ELM_DRIVES 2
  99. /* #define RT_DFS_ELM_USE_LFN 1 */
  100. #define RT_DFS_ELM_MAX_LFN 255
  101. /* Maximum sector size to be handled. */
  102. #define RT_DFS_ELM_MAX_SECTOR_SIZE 512
  103. /* DFS: network file system options */
  104. /* #define RT_USING_DFS_NFS */
  105. /* DFS: UFFS nand file system options */
  106. #define RT_USING_DFS_UFFS
  107. /* configuration for uffs, more to see dfs_uffs.h and uffs_config.h */
  108. #define RT_CONFIG_UFFS_ECC_MODE UFFS_ECC_HW_AUTO
  109. /* enable this ,you need provide a mark_badblock/check_block function */
  110. /* #define RT_UFFS_USE_CHECK_MARK_FUNCITON */
  111. /* DFS: JFFS2 nor flash file system options */
  112. //#define RT_USING_DFS_JFFS2
  113. /* DFS: windows share directory mounted to rt-thread/dfs */
  114. /* only used in bsp/simulator */
  115. #ifdef _WIN32
  116. #define RT_USING_DFS_WINSHAREDIR
  117. #endif
  118. /* the max number of mounted file system */
  119. #define DFS_FILESYSTEMS_MAX 4
  120. /* the max number of opened files */
  121. #define DFS_FD_MAX 4
  122. /* SECTION: lwip, a lightweight TCP/IP protocol stack */
  123. /* #define RT_USING_LWIP */
  124. /* LwIP uses RT-Thread Memory Management */
  125. #define RT_LWIP_USING_RT_MEM
  126. /* Enable ICMP protocol*/
  127. #define RT_LWIP_ICMP
  128. /* Enable UDP protocol*/
  129. #define RT_LWIP_UDP
  130. /* Enable TCP protocol*/
  131. #define RT_LWIP_TCP
  132. /* Enable DNS */
  133. #define RT_LWIP_DNS
  134. /* the number of simultaneously active TCP connections*/
  135. #define RT_LWIP_TCP_PCB_NUM 5
  136. /* Using DHCP */
  137. /* #define RT_LWIP_DHCP */
  138. /* ip address of target*/
  139. #define RT_LWIP_IPADDR0 192
  140. #define RT_LWIP_IPADDR1 168
  141. #define RT_LWIP_IPADDR2 126
  142. #define RT_LWIP_IPADDR3 30
  143. /* gateway address of target*/
  144. #define RT_LWIP_GWADDR0 192
  145. #define RT_LWIP_GWADDR1 168
  146. #define RT_LWIP_GWADDR2 126
  147. #define RT_LWIP_GWADDR3 1
  148. /* mask address of target*/
  149. #define RT_LWIP_MSKADDR0 255
  150. #define RT_LWIP_MSKADDR1 255
  151. #define RT_LWIP_MSKADDR2 255
  152. #define RT_LWIP_MSKADDR3 0
  153. /* tcp thread options */
  154. #define RT_LWIP_TCPTHREAD_PRIORITY 12
  155. #define RT_LWIP_TCPTHREAD_MBOX_SIZE 10
  156. #define RT_LWIP_TCPTHREAD_STACKSIZE 1024
  157. /* Ethernet if thread options */
  158. #define RT_LWIP_ETHTHREAD_PRIORITY 15
  159. #define RT_LWIP_ETHTHREAD_MBOX_SIZE 10
  160. #define RT_LWIP_ETHTHREAD_STACKSIZE 512
  161. /* TCP sender buffer space */
  162. #define RT_LWIP_TCP_SND_BUF 8192
  163. /* TCP receive window. */
  164. #define RT_LWIP_TCP_WND 8192
  165. /* SECTION: RT-Thread/GUI */
  166. /* #define RT_USING_RTGUI */
  167. /* name length of RTGUI object */
  168. #define RTGUI_NAME_MAX 12
  169. /* support 16 weight font */
  170. #define RTGUI_USING_FONT16
  171. /* support Chinese font */
  172. #define RTGUI_USING_FONTHZ
  173. /* use DFS as file interface */
  174. #define RTGUI_USING_DFS_FILERW
  175. /* use font file as Chinese font */
  176. /* #define RTGUI_USING_HZ_FILE */
  177. /* use Chinese bitmap font */
  178. #define RTGUI_USING_HZ_BMP
  179. /* use small size in RTGUI */
  180. #define RTGUI_USING_SMALL_SIZE
  181. /* use mouse cursor */
  182. /* #define RTGUI_USING_MOUSE_CURSOR */
  183. /* default font size in RTGUI */
  184. #define RTGUI_DEFAULT_FONT_SIZE 16
  185. /* image support */
  186. #define RTGUI_IMAGE_XPM
  187. #define RTGUI_IMAGE_BMP
  188. /* #define RTGUI_IMAGE_JPEG */
  189. /* #define RTGUI_IMAGE_PNG */
  190. #define RTGUI_USING_NOTEBOOK_IMAGE
  191. #endif