FreeRTOSConfig.h 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. /*
  2. FreeRTOS V7.3.0 - Copyright (C) 2012 Real Time Engineers Ltd.
  3. FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT
  4. http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
  5. ***************************************************************************
  6. * *
  7. * FreeRTOS tutorial books are available in pdf and paperback. *
  8. * Complete, revised, and edited pdf reference manuals are also *
  9. * available. *
  10. * *
  11. * Purchasing FreeRTOS documentation will not only help you, by *
  12. * ensuring you get running as quickly as possible and with an *
  13. * in-depth knowledge of how to use FreeRTOS, it will also help *
  14. * the FreeRTOS project to continue with its mission of providing *
  15. * professional grade, cross platform, de facto standard solutions *
  16. * for microcontrollers - completely free of charge! *
  17. * *
  18. * >>> See http://www.FreeRTOS.org/Documentation for details. <<< *
  19. * *
  20. * Thank you for using FreeRTOS, and thank you for your support! *
  21. * *
  22. ***************************************************************************
  23. This file is part of the FreeRTOS distribution.
  24. FreeRTOS is free software; you can redistribute it and/or modify it under
  25. the terms of the GNU General Public License (version 2) as published by the
  26. Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
  27. >>>NOTE<<< The modification to the GPL is included to allow you to
  28. distribute a combined work that includes FreeRTOS without being obliged to
  29. provide the source code for proprietary components outside of the FreeRTOS
  30. kernel. FreeRTOS is distributed in the hope that it will be useful, but
  31. WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  32. or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  33. more details. You should have received a copy of the GNU General Public
  34. License and the FreeRTOS license exception along with FreeRTOS; if not it
  35. can be viewed here: http://www.freertos.org/a00114.html and also obtained
  36. by writing to Richard Barry, contact details for whom are available on the
  37. FreeRTOS WEB site.
  38. 1 tab == 4 spaces!
  39. ***************************************************************************
  40. * *
  41. * Having a problem? Start by reading the FAQ "My application does *
  42. * not run, what could be wrong?" *
  43. * *
  44. * http://www.FreeRTOS.org/FAQHelp.html *
  45. * *
  46. ***************************************************************************
  47. http://www.FreeRTOS.org - Documentation, training, latest versions, license
  48. and contact details.
  49. http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
  50. including FreeRTOS+Trace - an indispensable productivity tool.
  51. Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell
  52. the code with commercial support, indemnification, and middleware, under
  53. the OpenRTOS brand: http://www.OpenRTOS.com. High Integrity Systems also
  54. provide a safety engineered and independently SIL3 certified version under
  55. the SafeRTOS brand: http://www.SafeRTOS.com.
  56. */
  57. #ifndef FREERTOS_CONFIG_H
  58. #define FREERTOS_CONFIG_H
  59. #if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__)
  60. #include <stdint.h>
  61. extern uint32_t SystemCoreClock;
  62. #endif
  63. #include "platform_autoconf.h"
  64. /*-----------------------------------------------------------
  65. * Application specific definitions.
  66. *
  67. * These definitions should be adjusted for your particular hardware and
  68. * application requirements.
  69. *
  70. * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
  71. * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
  72. *
  73. * See http://www.freertos.org/a00110.html.
  74. *----------------------------------------------------------*/
  75. #define configUSE_PREEMPTION 1
  76. #define configUSE_IDLE_HOOK 1
  77. #define configUSE_TICK_HOOK 0
  78. #define configCPU_CLOCK_HZ ( SystemCoreClock )
  79. #define configTICK_RATE_HZ ( ( uint32_t ) 1000 )
  80. #define configSYSTICK_CLOCK_HZ 32768
  81. #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 512 )
  82. #ifdef CONFIG_WIFI_EN
  83. #define configTOTAL_HEAP_SIZE ( ( size_t ) ( 100 * 1024 ) )
  84. #else
  85. #define configTOTAL_HEAP_SIZE ( ( size_t ) ( 20 * 1024 ) )
  86. #endif
  87. #define configMAX_TASK_NAME_LEN ( 10 )
  88. #define configUSE_TRACE_FACILITY 0
  89. #define configUSE_16_BIT_TICKS 0
  90. #define configIDLE_SHOULD_YIELD 0
  91. #define configUSE_CO_ROUTINES 1
  92. #define configUSE_MUTEXES 1
  93. #define configUSE_TIMERS 1
  94. #define configMAX_PRIORITIES ( 11 )
  95. #define PRIORITIE_OFFSET ( 4 )
  96. #define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
  97. #define configUSE_COUNTING_SEMAPHORES 1
  98. #define configUSE_ALTERNATIVE_API 0
  99. #define configCHECK_FOR_STACK_OVERFLOW 2
  100. #define configUSE_RECURSIVE_MUTEXES 1
  101. #define configQUEUE_REGISTRY_SIZE 0
  102. #define configGENERATE_RUN_TIME_STATS 0
  103. #if configGENERATE_RUN_TIME_STATS
  104. #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() //( ulHighFrequencyTimerTicks = 0UL )
  105. #define portGET_RUN_TIME_COUNTER_VALUE() xTickCount //ulHighFrequencyTimerTicks
  106. #undef configUSE_TRACE_FACILITY
  107. #define configUSE_TRACE_FACILITY 1
  108. #define portCONFIGURE_STATS_PEROID_VALUE 1000 //unit Ticks
  109. #endif
  110. #define configTIMER_TASK_PRIORITY ( 1 )
  111. #define configTIMER_QUEUE_LENGTH ( 10 )
  112. #define configTIMER_TASK_STACK_DEPTH ( 512 ) //USE_MIN_STACK_SIZE modify from 512 to 256
  113. #if (__IASMARM__ != 1)
  114. extern void freertos_pre_sleep_processing(unsigned int *expected_idle_time);
  115. extern void freertos_post_sleep_processing(unsigned int *expected_idle_time);
  116. extern int freertos_ready_to_sleep();
  117. /* Enable tickless power saving. */
  118. #define configUSE_TICKLESS_IDLE 1
  119. /* In wlan usage, this value is suggested to use value less than 80 milliseconds */
  120. #define configEXPECTED_IDLE_TIME_BEFORE_SLEEP 2
  121. /* It's magic trick that let us can use our own sleep function */
  122. #define configPRE_SLEEP_PROCESSING( x ) ( freertos_pre_sleep_processing(&x) )
  123. #define configPOST_SLEEP_PROCESSING( x ) ( freertos_post_sleep_processing(&x) )
  124. /* It's magic trick that let us can enable/disable tickless dynamically */
  125. #define traceLOW_POWER_IDLE_BEGIN(); do { \
  126. if (!freertos_ready_to_sleep()) { \
  127. mtCOVERAGE_TEST_MARKER(); \
  128. break; \
  129. }
  130. // portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime );
  131. #define traceLOW_POWER_IDLE_END(); } while (0);
  132. /* It's FreeRTOS related feature but it's not included in FreeRTOS design. */
  133. #define configUSE_WAKELOCK_PMU 1
  134. #endif // #if (__IASMARM__ != 1)
  135. /* Set the following definitions to 1 to include the API function, or zero
  136. to exclude the API function. */
  137. #define INCLUDE_vTaskPrioritySet 1
  138. #define INCLUDE_uxTaskPriorityGet 1
  139. #define INCLUDE_vTaskDelete 1
  140. #define INCLUDE_vTaskCleanUpResources 0
  141. #define INCLUDE_vTaskSuspend 1
  142. #define INCLUDE_vTaskDelayUntil 1
  143. #define INCLUDE_vTaskDelay 1
  144. #define INCLUDE_pcTaskGetTaskName 1
  145. #define INCLUDE_xTimerPendFunctionCall 1
  146. /* Cortex-M specific definitions. */
  147. #ifdef __NVIC_PRIO_BITS
  148. /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
  149. #define configPRIO_BITS __NVIC_PRIO_BITS
  150. #else
  151. #define configPRIO_BITS 4 /* 15 priority levels */
  152. #endif
  153. /* The lowest interrupt priority that can be used in a call to a "set priority"
  154. function. */
  155. #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0x0f
  156. /* The highest interrupt priority that can be used by any interrupt service
  157. routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
  158. INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
  159. PRIORITY THAN THIS! (higher priorities are lower numeric values. */
  160. #define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5
  161. /* Interrupt priorities used by the kernel port layer itself. These are generic
  162. to all Cortex-M ports, and do not rely on any particular library functions. */
  163. #define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
  164. /* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
  165. See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
  166. #define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
  167. //#define RTK_MODE_TIMER
  168. #endif /* FREERTOS_CONFIG_H */