FreeRTOSConfig.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. #ifndef FREERTOS_CONFIG_H
  2. #define FREERTOS_CONFIG_H
  3. #include "stdint.h"
  4. extern uint32_t SystemCoreClock;
  5. #if 1
  6. #define configCPU_CLOCK_HZ ( ( unsigned long ) SystemCoreClock )
  7. #define configTICK_RATE_HZ 1000
  8. #define configUSE_PREEMPTION 1
  9. #define configUSE_TIME_SLICING 1
  10. #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
  11. #define configUSE_TICKLESS_IDLE 0
  12. #define configMAX_PRIORITIES 32
  13. #define configMINIMAL_STACK_SIZE 128
  14. #define configMAX_TASK_NAME_LEN 16
  15. #define configTICK_TYPE_WIDTH_IN_BITS TICK_TYPE_WIDTH_32_BITS
  16. #define configIDLE_SHOULD_YIELD 1
  17. #define configTASK_NOTIFICATION_ARRAY_ENTRIES 1
  18. #define configQUEUE_REGISTRY_SIZE 0
  19. #define configENABLE_BACKWARD_COMPATIBILITY 1
  20. #define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0
  21. #define configUSE_MINI_LIST_ITEM 0
  22. #define configSTACK_DEPTH_TYPE size_t
  23. #define configMESSAGE_BUFFER_LENGTH_TYPE size_t
  24. //#define configHEAP_CLEAR_MEMORY_ON_FREE 1
  25. //#define configSTATS_BUFFER_MAX_LENGTH 0xFFFF
  26. #define configUSE_NEWLIB_REENTRANT 0
  27. #define configUSE_TIMERS 1
  28. #define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 )
  29. #define configTIMER_TASK_STACK_DEPTH (configMINIMAL_STACK_SIZE *2)
  30. #define configTIMER_QUEUE_LENGTH 5
  31. //#define configUSE_EVENT_GROUPS 1
  32. //#define configUSE_STREAM_BUFFERS 1
  33. #define configSUPPORT_STATIC_ALLOCATION 1
  34. #define configSUPPORT_DYNAMIC_ALLOCATION 1
  35. #define configKERNEL_PROVIDED_STATIC_MEMORY 1
  36. #define configTOTAL_HEAP_SIZE ((size_t)(80*1024))
  37. #define configAPPLICATION_ALLOCATED_HEAP 0
  38. #define configSTACK_ALLOCATION_FROM_SEPARATE_HEAP 0
  39. #define configENABLE_HEAP_PROTECTOR 0
  40. #ifdef __NVIC_PRIO_BITS
  41. #define configPRIO_BITS __NVIC_PRIO_BITS
  42. #else
  43. #define configPRIO_BITS 4
  44. #endif
  45. #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15
  46. #define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5
  47. #define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
  48. #define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
  49. #define configMAX_API_CALL_INTERRUPT_PRIORITY configMAX_SYSCALL_INTERRUPT_PRIORITY
  50. //#define configUSE_16_BIT_TICKS 0
  51. #define configUSE_IDLE_HOOK 0
  52. #define configUSE_TICK_HOOK 0
  53. #define configUSE_MALLOC_FAILED_HOOK 0
  54. #define configUSE_DAEMON_TASK_STARTUP_HOOK 0
  55. //#define configUSE_SB_COMPLETED_CALLBACK 0
  56. //#define configCHECK_FOR_STACK_OVERFLOW 0
  57. #define configGENERATE_RUN_TIME_STATS 0
  58. #if configGENERATE_RUN_TIME_STATS
  59. #include "./BSP/TIMER/btim.h"
  60. #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() ConfigureTimeForRunTimeStats()
  61. extern uint32_t FreeRTOSRunTimeTicks;
  62. #define portGET_RUN_TIME_COUNTER_VALUE() FreeRTOSRunTimeTicks
  63. #endif
  64. #define configUSE_TRACE_FACILITY 1
  65. #define configUSE_STATS_FORMATTING_FUNCTIONS 1
  66. #define configUSE_CO_ROUTINES 0
  67. #define configMAX_CO_ROUTINE_PRIORITIES 2
  68. #define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( TickType_t ) ( xTimeInMs ) * ( TickType_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000U ) )
  69. #define xPortPendSVHandler PendSV_Handler
  70. #define vPortSVCHandler SVC_Handler
  71. //#define xPortSysTickHandler SysTick_Handler
  72. #define vAssertCalled(char, int)
  73. #define configASSERT( x )
  74. //#define configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS 0
  75. #define configTOTAL_MPU_REGIONS 8
  76. //#define configTEX_S_C_B_FLASH 0x07UL
  77. //#define configTEX_S_C_B_SRAM 0x07UL
  78. #define configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY 0
  79. #define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS 0
  80. //#define configUSE_MPU_WRAPPERS_V1 0
  81. //#define configPROTECTED_KERNEL_OBJECT_POOL_SIZE 10
  82. //#define configSYSTEM_CALL_STACK_SIZE 128
  83. //#define configENABLE_ACCESS_CONTROL_LIST 1
  84. //#define configRUN_MULTIPLE_PRIORITIES 0
  85. //#define configUSE_CORE_AFFINITY 0
  86. //#define configTASK_DEFAULT_CORE_AFFINITY tskNO_AFFINITY
  87. //#define configUSE_TASK_PREEMPTION_DISABLE 0
  88. //#define configUSE_PASSIVE_IDLE_HOOK 0
  89. //#define configTIMER_SERVICE_TASK_CORE_AFFINITY tskNO_AFFINITY
  90. //#define secureconfigMAX_SECURE_CONTEXTS 5
  91. //#define configKERNEL_PROVIDED_STATIC_MEMORY 1
  92. //#define configENABLE_TRUSTZONE 1
  93. //#define configRUN_FREERTOS_SECURE_ONLY 1
  94. #define configENABLE_MPU 0
  95. #define configENABLE_FPU 1
  96. //#define configENABLE_MVE 1
  97. //#define configCHECK_HANDLER_INSTALLATION 1
  98. #define configUSE_TASK_NOTIFICATIONS 1
  99. #define configUSE_MUTEXES 1
  100. #define configUSE_RECURSIVE_MUTEXES 1
  101. #define configUSE_COUNTING_SEMAPHORES 1
  102. #define configUSE_QUEUE_SETS 1
  103. //#define configUSE_APPLICATION_TASK_TAG 0
  104. //#define configUSE_POSIX_ERRNO 0
  105. #define INCLUDE_vTaskPrioritySet 1
  106. #define INCLUDE_uxTaskPriorityGet 1
  107. #define INCLUDE_vTaskDelete 1
  108. #define INCLUDE_vTaskSuspend 1
  109. #define INCLUDE_xTaskDelayUntil 1
  110. #define INCLUDE_vTaskDelay 1
  111. #define INCLUDE_xTaskGetSchedulerState 1
  112. #define INCLUDE_xTaskGetCurrentTaskHandle 1
  113. #define INCLUDE_uxTaskGetStackHighWaterMark 1
  114. #define INCLUDE_xTaskGetIdleTaskHandle 1
  115. #define INCLUDE_eTaskGetState 1
  116. #define INCLUDE_xTimerPendFunctionCall 1
  117. #define INCLUDE_xTaskAbortDelay 1
  118. #define INCLUDE_xTaskGetHandle 1
  119. #define INCLUDE_xTaskResumeFromISR 1
  120. #else
  121. #define configUSE_PREEMPTION 1
  122. #define configCPU_CLOCK_HZ ( SystemCoreClock )
  123. #define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
  124. #define configMAX_PRIORITIES ( 15 )
  125. #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 )
  126. #define configTOTAL_HEAP_SIZE ( ( size_t ) ( 15 * 1024 ) )
  127. #define configMAX_TASK_NAME_LEN ( 16 )
  128. #define configUSE_16_BIT_TICKS 0
  129. #define configIDLE_SHOULD_YIELD 1
  130. #define configUSE_MUTEXES 1
  131. #define configUSE_RECURSIVE_MUTEXES 1
  132. #define configUSE_COUNTING_SEMAPHORES 1
  133. #define configQUEUE_REGISTRY_SIZE 8
  134. #define configUSE_APPLICATION_TASK_TAG 0
  135. #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
  136. /* hook function related definitions */
  137. #define configUSE_IDLE_HOOK 0
  138. #define configUSE_TICK_HOOK 0
  139. #define configCHECK_FOR_STACK_OVERFLOW 0
  140. #define configUSE_MALLOC_FAILED_HOOK 0
  141. /* run time and task stats gathering related definitions */
  142. #define configGENERATE_RUN_TIME_STATS 0
  143. #define configUSE_TRACE_FACILITY 1
  144. /* co-routine definitions */
  145. #define configUSE_CO_ROUTINES 0
  146. #define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
  147. /* software timer definitions */
  148. #define configUSE_TIMERS 1
  149. #define configTIMER_TASK_PRIORITY ( 2 )
  150. #define configTIMER_QUEUE_LENGTH 10
  151. #define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 )
  152. /* set to 1 to include the API function, or 0 to exclude the API function */
  153. #define INCLUDE_vTaskPrioritySet 1
  154. #define INCLUDE_uxTaskPriorityGet 1
  155. #define INCLUDE_vTaskDelete 1
  156. #define INCLUDE_vTaskCleanUpResources 0
  157. #define INCLUDE_vTaskSuspend 1
  158. #define INCLUDE_vTaskDelayUntil 1
  159. #define INCLUDE_vTaskDelay 1
  160. /* Cortex-M specific definitions */
  161. #ifdef __NVIC_PRIO_BITS
  162. /* __NVIC_PRIO_BITS will be specified when CMSIS is being used. */
  163. #define configPRIO_BITS __NVIC_PRIO_BITS
  164. #else
  165. #define configPRIO_BITS 4 /* 15 priority levels */
  166. #endif
  167. /* the lowest interrupt priority that can be used in a call to a "set priority" function */
  168. #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0xf
  169. /* The highest interrupt priority that can be used by any interrupt service
  170. routine that makes calls to interrupt safe FreeRTOS API functions. Do not call
  171. interrupt safe freertos api functions from any interrupt that has a higher
  172. priority than this! (higher priorities are lower numeric values. */
  173. #define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5
  174. /* interrupt priorities used by the kernel port layer itself */
  175. #define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
  176. /* configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero */
  177. #define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
  178. /* normal assert() semantics without relying on the provision of an assert.h header file */
  179. #define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }
  180. /* map the FreeRTOS port interrupt handlers to CMSIS standard names */
  181. #define vPortSVCHandler SVC_Handler
  182. #define xPortPendSVHandler PendSV_Handler
  183. //#define xPortSysTickHandler SysTick_Handler
  184. #endif
  185. #endif /* FREERTOS_CONFIG_H */